Skip to content

Commit

Permalink
Adding support code to .NET bindings Firefox driver for testing Mario…
Browse files Browse the repository at this point in the history
…nette
  • Loading branch information
jimevans committed Oct 8, 2015
1 parent a42fa87 commit 723563b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
11 changes: 11 additions & 0 deletions dotnet/src/webdriver/Firefox/FirefoxDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,17 @@ public override IFileDetector FileDetector
set { }
}

/// <summary>
/// Gets a value indicating whether the Firefox driver instance uses
/// Mozilla's Marionette implementation. This is a temporary property
/// and will be removed when Marionette is available for the release
/// channel of Firefox.
/// </summary>
public bool IsMarionette
{
get { return this.IsSpecificationCompliant; }
}

/// <summary>
/// Gets the FirefoxBinary and its details for subclasses
/// </summary>
Expand Down
18 changes: 18 additions & 0 deletions dotnet/test/common/PageLoadingTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ public void ShouldFollowMetaRedirects()
[Test]
public void ShouldBeAbleToGetAFragmentOnTheCurrentPage()
{
if (TestUtilities.IsMarionette(driver))
{
// Don't run this test on Marionette.
Assert.Ignore("Marionette doesn't see subsequent navigation to a fragment as a new navigation.");
}

driver.Url = xhtmlTestPage;
driver.Url = xhtmlTestPage + "#text";
driver.FindElement(By.Id("id1"));
Expand Down Expand Up @@ -64,6 +70,12 @@ public void ShouldReturnWhenGettingAUrlThatDoesNotResolve()
[IgnoreBrowser(Browser.Safari, "Hangs Safari driver")]
public void ShouldThrowIfUrlIsMalformed()
{
if (TestUtilities.IsMarionette(driver))
{
// Don't run this test on Marionette.
Assert.Ignore("Browser hangs when executed via Marionette");
}

driver.Url = "www.test.com";
}

Expand Down Expand Up @@ -202,6 +214,12 @@ public void ShouldBeAbleToRefreshAPage()
[IgnoreBrowser(Browser.Safari, "Untested user-agent")]
public void ShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCall()
{
if (TestUtilities.IsMarionette(driver))
{
// Don't run this test on Marionette.
Assert.Ignore("Browser hangs when executed via Marionette");
}

driver.Url = documentWrite;

// If this command succeeds, then all is well.
Expand Down
7 changes: 7 additions & 0 deletions dotnet/test/common/TestUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ public static bool IsFirefox(IWebDriver driver)
return GetUserAgent(driver).Contains("Firefox");
}

public static bool IsMarionette(IWebDriver driver)
{
Firefox.FirefoxDriver firefoxDriver = driver as Firefox.FirefoxDriver;

return firefoxDriver != null && firefoxDriver.IsMarionette;
}

public static bool IsInternetExplorer(IWebDriver driver)
{
string userAgent = GetUserAgent(driver);
Expand Down

0 comments on commit 723563b

Please sign in to comment.