From 1506e057b3d3c1afa5a02db581c16c958018359d Mon Sep 17 00:00:00 2001 From: Dirk Jahnke Date: Sat, 27 Jul 2019 19:49:14 +0200 Subject: [PATCH] Debug ........ --- .../java/org/fremo/fredl/test/BasicTest.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/test/java/org/fremo/fredl/test/BasicTest.java b/src/test/java/org/fremo/fredl/test/BasicTest.java index 9412047..37c652b 100644 --- a/src/test/java/org/fremo/fredl/test/BasicTest.java +++ b/src/test/java/org/fremo/fredl/test/BasicTest.java @@ -94,11 +94,12 @@ public class BasicTest { @Test public void verifyExistenceOfMainMenuButtons() { - //driver.switchTo().defaultContent(); - driver.switchTo().frame(0); + driver.switchTo().defaultContent(); + //driver.switchTo().frame(0); FredlTestHelper.printPageSource(); - Assert.assertEquals(FredlTestHelper.elementExistsByXpath("//frame[@name='oben']"), true); - driver.switchTo().frame(driver.findElement(By.xpath("//frame[@name='oben']"))); + 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); @@ -112,15 +113,16 @@ 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().defaultContent(); } @Test public void verifyLogout() { - //driver.switchTo().defaultContent(); - driver.switchTo().frame(0); - Assert.assertEquals(FredlTestHelper.elementExistsByXpath("//frame[@name='oben']"), true); - driver.switchTo().frame(driver.findElement(By.xpath("//frame[@name='oben']"))); + 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); }