Skip to content

Commit 2be2884

Browse files
committed
Unignoring .NET alerts tests for Edge
The Edge driver shipping with Windows 10 Insider Build 17723 has improvements in alert handling, allowing some tests to be unignored.
1 parent 9f126d3 commit 2be2884

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

dotnet/test/common/AlertsTest.cs

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
namespace OpenQA.Selenium
88
{
99
[TestFixture]
10-
[IgnoreBrowser(Browser.Edge)]
1110
public class AlertsTest : DriverTestFixture
1211
{
1312
[Test]
@@ -21,6 +20,7 @@ public void ShouldBeAbleToOverrideTheWindowAlertMethod()
2120
}
2221

2322
[Test]
23+
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
2424
public void ShouldAllowUsersToAcceptAnAlertManually()
2525
{
2626
driver.Url = CreateAlertPage("cheese");
@@ -52,6 +52,7 @@ public void ShouldThrowArgumentNullExceptionWhenKeysNull()
5252
}
5353

5454
[Test]
55+
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
5556
public void ShouldAllowUsersToAcceptAnAlertWithNoTextManually()
5657
{
5758
driver.Url = CreateAlertPage("");
@@ -68,6 +69,7 @@ public void ShouldAllowUsersToAcceptAnAlertWithNoTextManually()
6869
[Test]
6970
[IgnoreBrowser(Browser.IE, "This is the correct behavior, for the SwitchTo call to throw if it happens before the setTimeout call occurs in the browser and the alert is displayed.")]
7071
[IgnoreBrowser(Browser.Chrome, "This is the correct behavior, for the SwitchTo call to throw if it happens before the setTimeout call occurs in the browser and the alert is displayed.")]
72+
[IgnoreBrowser(Browser.Edge, "This is the correct behavior, for the SwitchTo call to throw if it happens before the setTimeout call occurs in the browser and the alert is displayed.")]
7173
public void ShouldGetTextOfAlertOpenedInSetTimeout()
7274
{
7375
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
@@ -94,6 +96,7 @@ public void ShouldGetTextOfAlertOpenedInSetTimeout()
9496
}
9597

9698
[Test]
99+
[IgnoreBrowser(Browser.Edge, "Issue getting alert text in Edge driver")]
97100
public void ShouldAllowUsersToDismissAnAlertManually()
98101
{
99102
driver.Url = CreateAlertPage("cheese");
@@ -108,6 +111,7 @@ public void ShouldAllowUsersToDismissAnAlertManually()
108111
}
109112

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

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

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

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

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

190198
[Test]
199+
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
191200
public void ShouldAllowTheUserToGetTheTextOfAPrompt()
192201
{
193202
driver.Url = CreatePromptPage(null);
@@ -300,6 +309,7 @@ public void SwitchingToMissingAlertInAClosedWindowThrows()
300309
}
301310

302311
[Test]
312+
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
303313
public void PromptShouldUseDefaultValueIfNoKeysSent()
304314
{
305315
driver.Url = CreatePromptPage("This is a default value");
@@ -327,8 +337,8 @@ public void PromptShouldHaveNullValueIfDismissed()
327337
}
328338

329339
[Test]
330-
[IgnoreBrowser(Browser.Edge, "Hangs browser")]
331340
[IgnoreBrowser(Browser.Remote)]
341+
[IgnoreBrowser(Browser.Edge, "Driver does not properly handle prompt() dialogs.")]
332342
public void HandlesTwoAlertsFromOneInteraction()
333343
{
334344
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
@@ -372,8 +382,6 @@ public void ShouldHandleAlertOnPageLoad()
372382
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
373383
.WithBody(string.Format("<a id='open-page-with-onload-alert' href='{0}'>open new page</a>", pageWithOnLoad)));
374384

375-
driver.Url = alertsPage;
376-
377385
driver.FindElement(By.Id("open-page-with-onload-alert")).Click();
378386

379387
IAlert alert = WaitFor<IAlert>(AlertToBePresent, "No alert found");
@@ -387,6 +395,7 @@ public void ShouldHandleAlertOnPageLoad()
387395

388396
[Test]
389397

398+
[IgnoreBrowser(Browser.Edge, "Alert during onload hangs browser when page loaded via direct navigation.")]
390399
public void ShouldHandleAlertOnPageLoadUsingGet()
391400
{
392401
driver.Url = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage()
@@ -475,6 +484,7 @@ public void ShouldHandleAlertOnPageUnload()
475484
[IgnoreBrowser(Browser.Firefox, "After version 27, Firefox does not trigger alerts on unload.")]
476485
[IgnoreBrowser(Browser.Chrome, "Chrome does not implicitly handle onBeforeUnload alert")]
477486
[IgnoreBrowser(Browser.Safari, "Safari driver does not implicitly (or otherwise) handle onBeforeUnload alerts")]
487+
[IgnoreBrowser(Browser.Edge, "Edge driver does not implicitly (or otherwise) handle onBeforeUnload alerts")]
478488
public void ShouldImplicitlyHandleAlertOnPageBeforeUnload()
479489
{
480490
string blank = EnvironmentManager.Instance.UrlBuilder.CreateInlinePage(new InlinePage().WithTitle("Success"));
@@ -583,6 +593,7 @@ public void ShouldHandleAlertOnFormSubmit()
583593
//------------------------------------------------------------------
584594
[Test]
585595
[IgnoreBrowser(Browser.Safari, "onBeforeUnload dialogs hang Safari")]
596+
[IgnoreBrowser(Browser.Edge, "onBeforeUnload dialogs hang Edge")]
586597
public void ShouldHandleAlertOnPageBeforeUnload()
587598
{
588599
driver.Url = EnvironmentManager.Instance.UrlBuilder.WhereIs("pageWithOnBeforeUnloadMessage.html");

0 commit comments

Comments
 (0)