9
9
10
10
namespace OpenQA . Selenium
11
11
{
12
+ [ IgnoreBrowser ( Browser . Edge ) ]
12
13
[ TestFixture ]
13
14
public class AlertsTest : DriverTestFixture
14
15
{
@@ -269,7 +270,6 @@ public void ShouldAllowTheUserToGetTheTextOfAPrompt()
269
270
[ IgnoreBrowser ( Browser . Remote ) ]
270
271
[ IgnoreBrowser ( Browser . Safari ) ]
271
272
[ IgnoreBrowser ( Browser . WindowsPhone , "Alert handling not yet implemented on Windows Phone" ) ]
272
- [ ExpectedException ( typeof ( NoAlertPresentException ) ) ]
273
273
public void AlertShouldNotAllowAdditionalCommandsIfDimissed ( )
274
274
{
275
275
driver . Url = alertsPage ;
@@ -278,7 +278,8 @@ public void AlertShouldNotAllowAdditionalCommandsIfDimissed()
278
278
279
279
IAlert alert = WaitFor < IAlert > ( AlertToBePresent , "No alert found" ) ;
280
280
alert . Dismiss ( ) ;
281
- string text = alert . Text ;
281
+ string text ;
282
+ Assert . Throws < NoAlertPresentException > ( ( ) => text = alert . Text ) ;
282
283
}
283
284
284
285
[ Test ]
@@ -334,12 +335,11 @@ public void ShouldAllowUsersToAcceptAnAlertInANestedFrame()
334
335
[ IgnoreBrowser ( Browser . Remote ) ]
335
336
[ IgnoreBrowser ( Browser . Safari ) ]
336
337
[ IgnoreBrowser ( Browser . WindowsPhone , "Alert handling not yet implemented on Windows Phone" ) ]
337
- [ ExpectedException ( typeof ( NoAlertPresentException ) ) ]
338
338
public void SwitchingToMissingAlertThrows ( )
339
339
{
340
340
driver . Url = alertsPage ;
341
341
342
- AlertToBePresent ( ) ;
342
+ Assert . Throws < NoAlertPresentException > ( ( ) => AlertToBePresent ( ) ) ;
343
343
}
344
344
345
345
[ Test ]
@@ -622,7 +622,7 @@ public void IncludesAlertTextInUnhandledAlertException()
622
622
}
623
623
624
624
[ Test ]
625
- [ NeedsFreshDriver ( AfterTest = true ) ]
625
+ [ NeedsFreshDriver ( IsCreatedAfterTest = true ) ]
626
626
[ IgnoreBrowser ( Browser . Opera ) ]
627
627
[ IgnoreBrowser ( Browser . PhantomJS , "Alert commands not yet implemented in GhostDriver" ) ]
628
628
[ IgnoreBrowser ( Browser . Safari ) ]
@@ -661,7 +661,7 @@ public void ShouldHandleOnBeforeUnloadAlert()
661
661
[ IgnoreBrowser ( Browser . PhantomJS , "Alert commands not yet implemented in GhostDriver" ) ]
662
662
[ IgnoreBrowser ( Browser . Safari ) ]
663
663
[ IgnoreBrowser ( Browser . WindowsPhone , "Alert handling not yet implemented on Windows Phone" ) ]
664
- [ NeedsFreshDriver ( AfterTest = true ) ]
664
+ [ NeedsFreshDriver ( IsCreatedAfterTest = true ) ]
665
665
public void ShouldHandleOnBeforeUnloadAlertAtClose ( )
666
666
{
667
667
driver . Url = EnvironmentManager . Instance . UrlBuilder . WhereIs ( "pageWithOnBeforeUnloadMessage.html" ) ;
0 commit comments