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.
This commit is contained in:
Steffen Schaefer committed 2018-07-23 14:06:41 +02:00
1 parent 0fc686c553
commit dc2c38ce68
1 file changed
+14 -4
@@ -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<String> expectedRaces = Arrays.asList("D1", "D2", "D4", "D5");
regattaDetails.waitForRacesOfSeries(RegattaStructureManagementPanelPO.DEFAULT_SERIES_NAME, expectedRaces);
final List<String> 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 {