From 1656d62102b2ee8139f103c3aea3e30a98ae311c Mon Sep 17 00:00:00 2001 From: Augusto Date: Tue, 12 Mar 2024 18:28:02 +0100 Subject: [PATCH] Removing JUnit dependency that probably causes this bug due to a testng dependency --- pom.xml | 8 -------- .../com/fullteaching/e2e/no_elastest/utils/Wait.java | 11 +++-------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/pom.xml b/pom.xml index 459116f..0ad3caf 100644 --- a/pom.xml +++ b/pom.xml @@ -49,8 +49,6 @@ 5.10.2 - 4.13.2 - 5.6.3 1.1.0 @@ -116,12 +114,6 @@ 5.10.2 test - - junit - junit - ${junit.version} - test - io.github.bonigarcia selenium-jupiter diff --git a/src/test/java/com/fullteaching/e2e/no_elastest/utils/Wait.java b/src/test/java/com/fullteaching/e2e/no_elastest/utils/Wait.java index 7f06b00..3f12a07 100644 --- a/src/test/java/com/fullteaching/e2e/no_elastest/utils/Wait.java +++ b/src/test/java/com/fullteaching/e2e/no_elastest/utils/Wait.java @@ -1,6 +1,5 @@ package com.fullteaching.e2e.no_elastest.utils; -import org.junit.Assert; import org.openqa.selenium.JavascriptExecutor; import org.openqa.selenium.WebDriver; import org.openqa.selenium.support.ui.ExpectedCondition; @@ -26,15 +25,11 @@ public static void footer(WebDriver wd) { } public static void waitForPageLoaded(WebDriver driver) { //13 lines - //DO NOT TOUCH THAT!! It's critical for some waiting ExpectedCondition expectation = driver1 -> ((JavascriptExecutor) driver1).executeScript("return document.readyState").toString().equals("complete"); - try { - WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); - wait.until(expectation); - } catch (Throwable error) { - Assert.fail("Timeout waiting for Page Load Request to complete."); - } + WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(30)); + + wait.until(expectation); } }