43
43
import org .openqa .selenium .support .ui .ExpectedCondition ;
44
44
import org .openqa .selenium .testing .Ignore ;
45
45
import org .openqa .selenium .testing .JUnit4TestBase ;
46
- import org .openqa .selenium .testing .JavascriptEnabled ;
47
46
import org .openqa .selenium .testing .NeedsLocalEnvironment ;
48
47
import org .openqa .selenium .testing .NoDriverAfterTest ;
49
48
import org .openqa .selenium .testing .NotYetImplemented ;
@@ -78,7 +77,6 @@ private String promptPage(String defaultText) {
78
77
"<div id='text'>acceptor</div>" ));
79
78
}
80
79
81
- @ JavascriptEnabled
82
80
@ NoDriverAfterTest
83
81
@ Test
84
82
public void testShouldBeAbleToOverrideTheWindowAlertMethod () {
@@ -92,7 +90,6 @@ public void testShouldBeAbleToOverrideTheWindowAlertMethod() {
92
90
assertEquals ("Testing Alerts" , driver .getTitle ());
93
91
}
94
92
95
- @ JavascriptEnabled
96
93
@ Test
97
94
public void testShouldAllowUsersToAcceptAnAlertManually () {
98
95
driver .get (alertPage ("cheese" ));
@@ -105,7 +102,6 @@ public void testShouldAllowUsersToAcceptAnAlertManually() {
105
102
assertEquals ("Testing Alerts" , driver .getTitle ());
106
103
}
107
104
108
- @ JavascriptEnabled
109
105
@ Test
110
106
public void testShouldAllowUsersToAcceptAnAlertWithNoTextManually () {
111
107
driver .get (alertPage ("" ));
@@ -118,7 +114,6 @@ public void testShouldAllowUsersToAcceptAnAlertWithNoTextManually() {
118
114
assertEquals ("Testing Alerts" , driver .getTitle ());
119
115
}
120
116
121
- @ JavascriptEnabled
122
117
@ NeedsLocalEnvironment (reason = "Carefully timing based" )
123
118
@ Test
124
119
@ Ignore (CHROME )
@@ -144,7 +139,6 @@ public void testShouldGetTextOfAlertOpenedInSetTimeout() throws Exception {
144
139
}
145
140
}
146
141
147
- @ JavascriptEnabled
148
142
@ Test
149
143
public void testShouldAllowUsersToDismissAnAlertManually () {
150
144
driver .get (alertPage ("cheese" ));
@@ -157,7 +151,6 @@ public void testShouldAllowUsersToDismissAnAlertManually() {
157
151
assertEquals ("Testing Alerts" , driver .getTitle ());
158
152
}
159
153
160
- @ JavascriptEnabled
161
154
@ Test
162
155
public void testShouldAllowAUserToAcceptAPrompt () {
163
156
driver .get (promptPage (null ));
@@ -170,7 +163,6 @@ public void testShouldAllowAUserToAcceptAPrompt() {
170
163
assertEquals ("Testing Prompt" , driver .getTitle ());
171
164
}
172
165
173
- @ JavascriptEnabled
174
166
@ Test
175
167
public void testShouldAllowAUserToDismissAPrompt () {
176
168
driver .get (promptPage (null ));
@@ -183,7 +175,6 @@ public void testShouldAllowAUserToDismissAPrompt() {
183
175
assertEquals ("Testing Prompt" , driver .getTitle ());
184
176
}
185
177
186
- @ JavascriptEnabled
187
178
@ NotYetImplemented (value = MARIONETTE , reason = "https://github.com/mozilla/geckodriver/issues/607" )
188
179
public void testShouldAllowAUserToSetTheValueOfAPrompt () {
189
180
driver .get (promptPage (null ));
@@ -196,7 +187,6 @@ public void testShouldAllowAUserToSetTheValueOfAPrompt() {
196
187
wait .until (textInElementLocated (By .id ("text" ), "cheese" ));
197
188
}
198
189
199
- @ JavascriptEnabled
200
190
@ Test
201
191
@ Ignore (CHROME )
202
192
@ Ignore (value = MARIONETTE , issue = "https://github.com/mozilla/geckodriver/issues/274" )
@@ -214,7 +204,6 @@ public void testSettingTheValueOfAnAlertThrows() {
214
204
}
215
205
}
216
206
217
- @ JavascriptEnabled
218
207
@ Test
219
208
public void testShouldAllowTheUserToGetTheTextOfAnAlert () {
220
209
driver .get (alertPage ("cheese" ));
@@ -227,7 +216,6 @@ public void testShouldAllowTheUserToGetTheTextOfAnAlert() {
227
216
assertEquals ("cheese" , value );
228
217
}
229
218
230
- @ JavascriptEnabled
231
219
@ Test
232
220
public void testShouldAllowTheUserToGetTheTextOfAPrompt () {
233
221
driver .get (promptPage (null ));
@@ -240,7 +228,6 @@ public void testShouldAllowTheUserToGetTheTextOfAPrompt() {
240
228
assertEquals ("Enter something" , value );
241
229
}
242
230
243
- @ JavascriptEnabled
244
231
@ Test
245
232
public void testAlertShouldNotAllowAdditionalCommandsIfDismissed () {
246
233
driver .get (alertPage ("cheese" ));
@@ -253,7 +240,6 @@ public void testAlertShouldNotAllowAdditionalCommandsIfDismissed() {
253
240
assertThat (t , instanceOf (NoAlertPresentException .class ));
254
241
}
255
242
256
- @ JavascriptEnabled
257
243
@ SwitchToTopAfterTest
258
244
@ Test
259
245
@ Ignore (MARIONETTE )
@@ -273,7 +259,6 @@ public void testShouldAllowUsersToAcceptAnAlertInAFrame() {
273
259
assertEquals ("Testing Alerts" , driver .getTitle ());
274
260
}
275
261
276
- @ JavascriptEnabled
277
262
@ SwitchToTopAfterTest
278
263
@ Test
279
264
@ Ignore (MARIONETTE )
@@ -296,7 +281,6 @@ public void testShouldAllowUsersToAcceptAnAlertInANestedFrame() {
296
281
assertEquals ("Testing Alerts" , driver .getTitle ());
297
282
}
298
283
299
- @ JavascriptEnabled
300
284
@ Test
301
285
public void testSwitchingToMissingAlertThrows () throws Exception {
302
286
driver .get (alertPage ("cheese" ));
@@ -305,7 +289,6 @@ public void testSwitchingToMissingAlertThrows() throws Exception {
305
289
assertThat (t , instanceOf (NoAlertPresentException .class ));
306
290
}
307
291
308
- @ JavascriptEnabled
309
292
@ Test
310
293
public void testSwitchingToMissingAlertInAClosedWindowThrows () throws Exception {
311
294
String blank = appServer .create (new Page ());
@@ -327,7 +310,6 @@ public void testSwitchingToMissingAlertInAClosedWindowThrows() throws Exception
327
310
}
328
311
}
329
312
330
- @ JavascriptEnabled
331
313
@ Test
332
314
public void testPromptShouldUseDefaultValueIfNoKeysSent () {
333
315
driver .get (promptPage ("This is a default value" ));
@@ -339,7 +321,6 @@ public void testPromptShouldUseDefaultValueIfNoKeysSent() {
339
321
wait .until (textInElementLocated (By .id ("text" ), "This is a default value" ));
340
322
}
341
323
342
- @ JavascriptEnabled
343
324
@ Test
344
325
public void testPromptShouldHaveNullValueIfDismissed () {
345
326
driver .get (promptPage ("This is a default value" ));
@@ -351,7 +332,6 @@ public void testPromptShouldHaveNullValueIfDismissed() {
351
332
wait .until (textInElementLocated (By .id ("text" ), "null" ));
352
333
}
353
334
354
- @ JavascriptEnabled
355
335
@ Test
356
336
@ NotYetImplemented (value = MARIONETTE , reason = "https://github.com/mozilla/geckodriver/issues/607" )
357
337
public void testHandlesTwoAlertsFromOneInteraction () {
@@ -382,7 +362,6 @@ public void testHandlesTwoAlertsFromOneInteraction() {
382
362
wait .until (textInElementLocated (By .id ("text2" ), "cheddar" ));
383
363
}
384
364
385
- @ JavascriptEnabled
386
365
@ Test
387
366
@ Ignore (CHROME )
388
367
public void testShouldHandleAlertOnPageLoad () {
@@ -401,7 +380,6 @@ public void testShouldHandleAlertOnPageLoad() {
401
380
wait .until (textInElementLocated (By .tagName ("p" ), "Page with onload event handler" ));
402
381
}
403
382
404
- @ JavascriptEnabled
405
383
@ Test
406
384
@ Ignore (CHROME )
407
385
public void testShouldHandleAlertOnPageLoadUsingGet () {
@@ -417,7 +395,6 @@ public void testShouldHandleAlertOnPageLoadUsingGet() {
417
395
wait .until (textInElementLocated (By .tagName ("p" ), "Page with onload event handler" ));
418
396
}
419
397
420
- @ JavascriptEnabled
421
398
@ Test
422
399
@ Ignore (CHROME )
423
400
@ Ignore (FIREFOX )
@@ -450,7 +427,6 @@ public void testShouldNotHandleAlertInAnotherWindow() {
450
427
}
451
428
}
452
429
453
- @ JavascriptEnabled
454
430
@ Test
455
431
@ Ignore (value = CHROME , reason = "Chrome does not trigger alerts on unload" )
456
432
@ NotYetImplemented (HTMLUNIT )
@@ -475,7 +451,6 @@ public void testShouldHandleAlertOnPageUnload() {
475
451
wait .until (textInElementLocated (By .id ("link" ), "open new page" ));
476
452
}
477
453
478
- @ JavascriptEnabled
479
454
@ Test
480
455
public void testShouldHandleAlertOnPageBeforeUnload () {
481
456
String blank = appServer .create (new Page ().withTitle ("Success" ));
@@ -499,7 +474,6 @@ public void testShouldHandleAlertOnPageBeforeUnload() {
499
474
wait .until (titleIs ("Success" ));
500
475
}
501
476
502
- @ JavascriptEnabled
503
477
@ NoDriverAfterTest
504
478
@ Test
505
479
public void testShouldHandleAlertOnPageBeforeUnloadAtQuit () {
@@ -518,7 +492,6 @@ public void testShouldHandleAlertOnPageBeforeUnloadAtQuit() {
518
492
driver .quit ();
519
493
}
520
494
521
- @ JavascriptEnabled
522
495
@ Test
523
496
@ Ignore (value = CHROME , reason = "Chrome does not trigger alerts on unload" )
524
497
@ NotYetImplemented (HTMLUNIT )
@@ -551,7 +524,6 @@ public void testShouldHandleAlertOnWindowClose() {
551
524
}
552
525
}
553
526
554
- @ JavascriptEnabled
555
527
@ Test
556
528
@ Ignore (CHROME )
557
529
@ NotYetImplemented (value = MARIONETTE ,
@@ -568,7 +540,6 @@ public void testIncludesAlertTextInUnhandledAlertException() {
568
540
assertThat (t .getMessage (), containsString ("cheese" ));
569
541
}
570
542
571
- @ JavascriptEnabled
572
543
@ NoDriverAfterTest
573
544
@ Test
574
545
public void testCanQuitWhenAnAlertIsPresent () {
@@ -580,7 +551,6 @@ public void testCanQuitWhenAnAlertIsPresent() {
580
551
driver .quit ();
581
552
}
582
553
583
- @ JavascriptEnabled
584
554
@ Test
585
555
@ Ignore (value = MARIONETTE , issue = "https://github.com/mozilla/geckodriver/issues/620" )
586
556
public void shouldHandleAlertOnFormSubmit () {
0 commit comments