Test dependency solved our issues ....

This commit is contained in:
Dirk Jahnke 2019-07-27 21:31:52 +02:00
parent a79732166e
commit 7bd5014dc9
1 changed files with 1 additions and 11 deletions

View File

@ -91,7 +91,6 @@ public class BasicTest {
Assert.assertEquals(welcomeMessage, expectedWelcomeMessage);
// we leave our tests always with having the driver located to the top frame
//driver.switchTo().defaultContent();
driver.switchTo().parentFrame();
}
@ -99,13 +98,9 @@ public class BasicTest {
public void verifyExistenceOfMainMenuButtons() {
System.out.println("----------------------------- verifyExistenceOfMainMenuButtons ----------------------------------");
driver.navigate().refresh();
//driver.switchTo().defaultContent();
//driver.switchTo().frame(0);
System.out.println("Current URL=" + driver.getCurrentUrl());
FredlTestHelper.printPageSource();
//FredlTestHelper.printPageSource();
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("oben"));
//Assert.assertEquals(FredlTestHelper.elementExistsByXpath("//frame[@name='oben']"), true);
//driver.switchTo().frame(driver.findElement(By.xpath("//frame[@name='oben']")));
// Verify existence of menu buttons
Assert.assertEquals(FredlTestHelper.elementExistsById("admin-menu-button"), true);
Assert.assertEquals(FredlTestHelper.elementExistsById("loco-menu-button"), true);
@ -119,18 +114,13 @@ public class BasicTest {
Assert.assertEquals(FredlTestHelper.elementExistsById("idman-menu-button"), true);
Assert.assertEquals(FredlTestHelper.elementExistsById("lola-menu-button"), true);
Assert.assertEquals(FredlTestHelper.elementExistsById("logout-menu-button"), true);
//driver.switchTo().defaultContent();
driver.switchTo().parentFrame();
}
@Test (dependsOnMethods={"verifyExistenceOfMainMenuButtons"})
public void verifyLogout() {
System.out.println("----------------------------- verifyLogout ----------------------------------");
//driver.switchTo().defaultContent();
//driver.switchTo().frame(0);
wait.until(ExpectedConditions.frameToBeAvailableAndSwitchToIt("oben"));
//Assert.assertEquals(FredlTestHelper.elementExistsByXpath("//frame[@name='oben']"), true);
//driver.switchTo().frame(driver.findElement(By.xpath("//frame[@name='oben']")));
driver.findElement(By.id("logout-menu-button")).click();
Assert.assertEquals(FredlTestHelper.elementExistsByXpath("//input[@name='doLogin']"), true);
}