fix failing tests in selenium-2 due to website change (#14422)

This commit is contained in:
Ehsan Sasanianno 2023-07-17 17:57:08 +02:00 committed by GitHub
parent 3e0164ef0a
commit 5b5e921b22
2 changed files with 6 additions and 8 deletions

View File

@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.ElementNotInteractableException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
@ -49,10 +50,8 @@ final class ExplicitWaitLiveTest {
@Test
void givenPage_whenNavigatingWithoutExplicitWait_thenElementNotInteractable() {
driver.navigate().to("https://www.baeldung.com/");
driver.findElement(LOCATOR_ABOUT).click();
assertThrows(ElementNotInteractableException.class, () -> driver.findElement(LOCATOR_ABOUT_BAELDUNG).click());
WebElement about = driver.findElement(LOCATOR_ABOUT_BAELDUNG);
assertThrows(ElementNotInteractableException.class, about::click);
}
@Test

View File

@ -11,6 +11,7 @@ import org.junit.jupiter.api.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.ElementNotInteractableException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.support.ui.ExpectedConditions;
@ -53,10 +54,8 @@ final class FluentWaitLiveTest {
@Test
void givenPage_whenNavigatingWithoutFluentWait_thenElementNotInteractable() {
driver.navigate().to("https://www.baeldung.com/");
driver.findElement(LOCATOR_ABOUT).click();
assertThrows(ElementNotInteractableException.class, () -> driver.findElement(LOCATOR_ABOUT_BAELDUNG).click());
WebElement about = driver.findElement(LOCATOR_ABOUT_BAELDUNG);
assertThrows(ElementNotInteractableException.class, about::click);
}
@Test