From dc2c38ce68fb7c892a08aaf43e952969efbf729f Mon Sep 17 00:00:00 2001 From: Steffen Schaefer Date: Mon, 23 Jul 2018 14:06:41 +0200 Subject: [PATCH] Bug 4339: For WebDriver implementations that do not use tabs but distinct extra windows we need to manually maximize those extra windows. On Windows this is e.g. needed for IE. --- .../TestLeaderboardConfiguration.java | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/test/leaderboard/TestLeaderboardConfiguration.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/test/leaderboard/TestLeaderboardConfiguration.java index 23bc8f34445..0d7e4497bf7 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/test/leaderboard/TestLeaderboardConfiguration.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/test/leaderboard/TestLeaderboardConfiguration.java @@ -134,13 +134,13 @@ public class TestLeaderboardConfiguration extends AbstractSeleniumTest { SeriesEditDialogPO seriesDialog = regattaDetails.editSeries(RegattaStructureManagementPanelPO.DEFAULT_SERIES_NAME); seriesDialog.deleteRace("D3"); seriesDialog.pressOk(true); - final List expectedRaces = Arrays.asList("D1", "D2", "D4", "D5"); - regattaDetails.waitForRacesOfSeries(RegattaStructureManagementPanelPO.DEFAULT_SERIES_NAME, expectedRaces); + final List expectedRaces = Arrays.asList("D1", "D2", "D4", "D5"); + regattaDetails.waitForRacesOfSeries(RegattaStructureManagementPanelPO.DEFAULT_SERIES_NAME, expectedRaces); // Now we can check the result with our expectation leaderboardWindow.switchToWindow(); leaderboard.refresh(); - assertThat("Race names do not match after deletion of race 'D3'", table.getRaceNames(), - equalTo(expectedRaces)); + assertThat("Race names do not match after deletion of race 'D3'", table.getRaceNames(), + equalTo(expectedRaces)); }); } @@ -187,6 +187,16 @@ public class TestLeaderboardConfiguration extends AbstractSeleniumTest { final WindowManager manager = this.environment.getWindowManager(); final WebDriverWindow defaultWindow = manager.getCurrentWindow(); final WebDriverWindow extraWindow = manager.openNewWindow(); + try { + extraWindow.switchToWindow(); + // On WebDriver implementations that support it, the window is maximized + // This makes our Tests work much better on Windows + getWebDriver().manage().window().maximize(); + } catch (Exception e) { + // maximizing isn't supported on all Systems / WebDriver implementations + } finally { + defaultWindow.switchToWindow(); + } try { defaultAndExtraWindow.accept(defaultWindow, extraWindow); } finally {