Skip to content

Commit

Permalink
Unignoring alert tests for Edge
Browse files Browse the repository at this point in the history
With the driver implementation released with Windows 10 Insider Build
17728 (RS5), the race condition that prevented the alerts tests from
properly working has been fixed, and the tests now no longer hang
execution. Moreover, this version of the driver for Edge also implements
handling of unhandled user prompts, so these tests are likewise activated
for Edge.
  • Loading branch information
jimevans committed Aug 2, 2018
1 parent c5f3f0d commit c2dd673
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
17 changes: 3 additions & 14 deletions dotnet/test/common/AlertsTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public void ShouldBeAbleToOverrideTheWindowAlertMethod()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
public void ShouldAllowUsersToAcceptAnAlertManually()
{
driver.Url = CreateAlertPage("cheese");
Expand Down Expand Up @@ -52,7 +51,6 @@ public void ShouldThrowArgumentNullExceptionWhenKeysNull()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
public void ShouldAllowUsersToAcceptAnAlertWithNoTextManually()
{
driver.Url = CreateAlertPage("");
Expand Down Expand Up @@ -96,7 +94,6 @@ public void ShouldGetTextOfAlertOpenedInSetTimeout()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
public void ShouldAllowUsersToDismissAnAlertManually()
{
driver.Url = CreateAlertPage("cheese");
Expand All @@ -111,7 +108,6 @@ public void ShouldAllowUsersToDismissAnAlertManually()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void ShouldAllowAUserToAcceptAPrompt()
{
driver.Url = CreatePromptPage(null);
Expand All @@ -126,7 +122,6 @@ public void ShouldAllowAUserToAcceptAPrompt()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void ShouldAllowAUserToDismissAPrompt()
{
driver.Url = CreatePromptPage(null);
Expand All @@ -141,7 +136,6 @@ public void ShouldAllowAUserToDismissAPrompt()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void ShouldAllowAUserToSetTheValueOfAPrompt()
{
driver.Url = CreatePromptPage(null);
Expand All @@ -158,7 +152,6 @@ public void ShouldAllowAUserToSetTheValueOfAPrompt()

[Test]
[IgnoreBrowser(Browser.Chrome, "Chrome does not throw when setting the text of an alert")]
[IgnoreBrowser(Browser.Edge, "Setting value of alert hangs Edge.")]
public void SettingTheValueOfAnAlertThrows()
{
driver.Url = CreateAlertPage("cheese");
Expand All @@ -181,7 +174,6 @@ public void SettingTheValueOfAnAlertThrows()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly get text of alert.")]
public void ShouldAllowTheUserToGetTheTextOfAnAlert()
{
driver.Url = CreateAlertPage("cheese");
Expand All @@ -196,7 +188,6 @@ public void ShouldAllowTheUserToGetTheTextOfAnAlert()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void ShouldAllowTheUserToGetTheTextOfAPrompt()
{
driver.Url = CreatePromptPage(null);
Expand Down Expand Up @@ -309,7 +300,6 @@ public void SwitchingToMissingAlertInAClosedWindowThrows()
}

[Test]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void PromptShouldUseDefaultValueIfNoKeysSent()
{
driver.Url = CreatePromptPage("This is a default value");
Expand Down Expand Up @@ -338,7 +328,6 @@ public void PromptShouldHaveNullValueIfDismissed()

[Test]
[IgnoreBrowser(Browser.Remote)]
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
public void HandlesTwoAlertsFromOneInteraction()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
Expand Down Expand Up @@ -395,7 +384,6 @@ public void ShouldHandleAlertOnPageLoad()

[Test]

[IgnoreBrowser(Browser.Edge, "Alert during onload hangs browser when page loaded via direct navigation.")]
public void ShouldHandleAlertOnPageLoadUsingGet()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
Expand Down Expand Up @@ -459,6 +447,7 @@ public void ShouldNotHandleAlertInAnotherWindow()
[Test]
[IgnoreBrowser(Browser.Firefox, "After version 27, Firefox does not trigger alerts on unload.")]
[IgnoreBrowser(Browser.Chrome, "Chrome does not trigger alerts on unload.")]
[IgnoreBrowser(Browser.Edge, "Edge does not trigger alerts on unload.")]
public void ShouldHandleAlertOnPageUnload()
{
string pageWithOnBeforeUnload = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
Expand Down Expand Up @@ -503,6 +492,7 @@ public void ShouldImplicitlyHandleAlertOnPageBeforeUnload()
[IgnoreBrowser(Browser.IE, "Test as written does not trigger alert; also onbeforeunload alert on close will hang browser")]
[IgnoreBrowser(Browser.Chrome, "Test as written does not trigger alert")]
[IgnoreBrowser(Browser.Firefox, "After version 27, Firefox does not trigger alerts on unload.")]
[IgnoreBrowser(Browser.Edge, "Edge does not trigger alerts on unload.")]
public void ShouldHandleAlertOnWindowClose()
{
string pageWithOnBeforeUnload = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
Expand Down Expand Up @@ -536,7 +526,6 @@ public void ShouldHandleAlertOnWindowClose()

[Test]
[IgnoreBrowser(Browser.Chrome, "Chrome does not supply text in UnhandledAlertException")]
[IgnoreBrowser(Browser.Edge)]
[IgnoreBrowser(Browser.Opera)]
[IgnoreBrowser(Browser.Safari, "Safari driver does not do unhandled alerts")]
public void IncludesAlertTextInUnhandledAlertException()
Expand Down Expand Up @@ -593,7 +582,7 @@ public void ShouldHandleAlertOnFormSubmit()
//------------------------------------------------------------------
[Test]
[IgnoreBrowser(Browser.Safari, "onBeforeUnload dialogs hang Safari")]
[IgnoreBrowser(Browser.Edge, "onBeforeUnload dialogs hang Edge")]
[IgnoreBrowser(Browser.Edge, "Edge driver does not implicitly (or otherwise) handle onBeforeUnload alerts")]
public void ShouldHandleAlertOnPageBeforeUnload()
{
driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("pageWithOnBeforeUnloadMessage.html");
Expand Down
6 changes: 0 additions & 6 deletions dotnet/test/common/UnexpectedAlertBehaviorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ public void QuitDriver()

[Test]
[IgnoreBrowser(Browser.Chrome, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanAcceptUnhandledAlert()
{
Expand All @@ -39,7 +38,6 @@ public void CanAcceptUnhandledAlert()

[Test]
[IgnoreBrowser(Browser.Chrome, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanSilentlyAcceptUnhandledAlert()
{
Expand All @@ -48,7 +46,6 @@ public void CanSilentlyAcceptUnhandledAlert()

[Test]
[IgnoreBrowser(Browser.Chrome, "Unstable Chrome behavior")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanDismissUnhandledAlert()
{
Expand All @@ -57,7 +54,6 @@ public void CanDismissUnhandledAlert()

[Test]
[IgnoreBrowser(Browser.Chrome, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanSilentlyDismissUnhandledAlert()
{
Expand All @@ -66,7 +62,6 @@ public void CanSilentlyDismissUnhandledAlert()

[Test]
[IgnoreBrowser(Browser.Chrome, "Chrome uses IGNORE mode by default")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanDismissUnhandledAlertsByDefault()
{
Expand All @@ -75,7 +70,6 @@ public void CanDismissUnhandledAlertsByDefault()

[Test]
[IgnoreBrowser(Browser.Chrome, "Unstable Chrome behavior")]
[IgnoreBrowser(Browser.Edge, "Legacy behavior, not spec compliant")]
[IgnoreBrowser(Browser.Safari, "Test issue, Safari driver does not support multiple simultaneous instances")]
public void CanIgnoreUnhandledAlert()
{
Expand Down

0 comments on commit c2dd673

Please sign in to comment.