Skip to content

Commit

Permalink
Updating .NET ExecutingAsyncJavascriptTest to create new driver after…
Browse files Browse the repository at this point in the history
… test

When using the OSS protocol dialect, ChromeDriver does not handle unexpected
alerts encountered when executing async JavaScript. If the alerts tests
are enabled, many remaining tests fail because the alert is left active.
The tests are still enabled, because when ChromeDriver uses the W3C protocol
dialect, the alerts are properly handled. The addition of the attribute on
the test class is to ensure that when running with the legacy OSS protocol
dialect, that those cascading failures are eliminated. The attribute can
be removed once ChromeDriver fully supports the W3C dialect and has made that
dialect the default.s
  • Loading branch information
jimevans committed Mar 27, 2019
1 parent 0ff801a commit 57555ac
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions dotnet/test/common/ExecutingAsyncJavascriptTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@

namespace OpenQA.Selenium
{
// TODO: Remove NeedsFreshDriver attribute when ChromeDriver moves
// to default of using W3C protocol dialect
[TestFixture]
[NeedsFreshDriver(IsCreatedAfterTest = true)]
public class ExecutingAsyncJavascriptTest : DriverTestFixture
{
private IJavaScriptExecutor executor;
Expand Down Expand Up @@ -274,6 +277,7 @@ public void ShouldBeAbleToMakeXMLHttpRequestsAndWaitForTheResponse()
}

[Test]
// [IgnoreBrowser(Browser.Chrome, "Driver does not handle async alerts in OSS protocol dialect mode")]
[IgnoreBrowser(Browser.Safari, "Does not alerts thrown during async JavaScript; driver hangs until alert dismissed")]
[IgnoreBrowser(Browser.Opera, "Does not handle async alerts")]
public void ThrowsIfScriptTriggersAlert()
Expand All @@ -288,6 +292,7 @@ public void ThrowsIfScriptTriggersAlert()
}

[Test]
//[IgnoreBrowser(Browser.Chrome, "Driver does not handle async alerts in OSS protocol dialect mode")]
[IgnoreBrowser(Browser.Safari, "Does not alerts thrown during async JavaScript; driver hangs until alert dismissed")]
[IgnoreBrowser(Browser.Opera, "Does not handle async alerts")]
public void ThrowsIfAlertHappensDuringScript()
Expand All @@ -302,6 +307,7 @@ public void ThrowsIfAlertHappensDuringScript()
}

[Test]
//[IgnoreBrowser(Browser.Chrome, "Driver does not handle async alerts in OSS protocol dialect mode")]
[IgnoreBrowser(Browser.Safari, "Does not alerts thrown during async JavaScript; driver hangs until alert dismissed")]
[IgnoreBrowser(Browser.Opera, "Does not handle async alerts")]
public void ThrowsIfScriptTriggersAlertWhichTimesOut()
Expand All @@ -317,6 +323,7 @@ public void ThrowsIfScriptTriggersAlertWhichTimesOut()
}

[Test]
//[IgnoreBrowser(Browser.Chrome, "Driver does not handle async alerts in OSS protocol dialect mode")]
[IgnoreBrowser(Browser.Safari, "Does not alerts thrown during async JavaScript; driver hangs until alert dismissed")]
[IgnoreBrowser(Browser.Opera, "Does not handle async alerts")]
public void ThrowsIfAlertHappensDuringScriptWhichTimesOut()
Expand Down

0 comments on commit 57555ac

Please sign in to comment.