24
24
import static org .junit .Assert .assertThat ;
25
25
import static org .junit .Assert .fail ;
26
26
import static org .junit .Assume .assumeFalse ;
27
+ import static org .openqa .selenium .Platform .ANDROID ;
27
28
import static org .openqa .selenium .WaitingConditions .newWindowIsOpened ;
28
29
import static org .openqa .selenium .WaitingConditions .windowHandleCountToBe ;
29
30
import static org .openqa .selenium .WaitingConditions .windowHandleCountToBeGreaterThan ;
@@ -199,6 +200,7 @@ public void testShouldBeAbleToIterateOverAllOpenWindows() {
199
200
@ Test
200
201
@ Ignore (MARIONETTE )
201
202
public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang () {
203
+ throws Exception {
202
204
assumeFalse (Browser .detect () == Browser .opera &&
203
205
TestUtilities .getEffectivePlatform ().is (Platform .WINDOWS ));
204
206
@@ -214,6 +216,10 @@ public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToH
214
216
215
217
driver .switchTo ().window ("result" );
216
218
219
+ // TODO Remove sleep when https://code.google.com/p/chromedriver/issues/detail?id=1044 is fixed.
220
+ if (TestUtilities .isChrome (driver ) && TestUtilities .getEffectivePlatform (driver ).is (ANDROID )) {
221
+ Thread .sleep (1000 );
222
+ }
217
223
try {
218
224
wait .until (ExpectedConditions .presenceOfElementLocated (By .id ("close" )));
219
225
driver .findElement (By .id ("close" )).click ();
@@ -233,7 +239,7 @@ public void testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToH
233
239
@ JavascriptEnabled
234
240
@ Test
235
241
@ Ignore (MARIONETTE )
236
- public void testCanCallGetWindowHandlesAfterClosingAWindow () {
242
+ public void testCanCallGetWindowHandlesAfterClosingAWindow () throws Exception {
237
243
assumeFalse (Browser .detect () == Browser .opera &&
238
244
TestUtilities .getEffectivePlatform ().is (Platform .WINDOWS ));
239
245
@@ -251,6 +257,10 @@ public void testCanCallGetWindowHandlesAfterClosingAWindow() {
251
257
driver .switchTo ().window ("result" );
252
258
int allWindowHandles = driver .getWindowHandles ().size ();
253
259
260
+ // TODO Remove sleep when https://code.google.com/p/chromedriver/issues/detail?id=1044 is fixed.
261
+ if (TestUtilities .isChrome (driver ) && TestUtilities .getEffectivePlatform (driver ).is (ANDROID )) {
262
+ Thread .sleep (1000 );
263
+ }
254
264
try {
255
265
wait .until (ExpectedConditions .presenceOfElementLocated (By .id ("close" ))).click ();
256
266
0 commit comments