Skip to content

Commit 723563b

Browse files
committed
Adding support code to .NET bindings Firefox driver for testing Marionette
1 parent a42fa87 commit 723563b

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

dotnet/src/webdriver/Firefox/FirefoxDriver.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,17 @@ public override IFileDetector FileDetector
220220
set { }
221221
}
222222

223+
/// <summary>
224+
/// Gets a value indicating whether the Firefox driver instance uses
225+
/// Mozilla's Marionette implementation. This is a temporary property
226+
/// and will be removed when Marionette is available for the release
227+
/// channel of Firefox.
228+
/// </summary>
229+
public bool IsMarionette
230+
{
231+
get { return this.IsSpecificationCompliant; }
232+
}
233+
223234
/// <summary>
224235
/// Gets the FirefoxBinary and its details for subclasses
225236
/// </summary>

dotnet/test/common/PageLoadingTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public void ShouldFollowMetaRedirects()
3535
[Test]
3636
public void ShouldBeAbleToGetAFragmentOnTheCurrentPage()
3737
{
38+
if (TestUtilities.IsMarionette(driver))
39+
{
40+
// Don't run this test on Marionette.
41+
Assert.Ignore("Marionette doesn't see subsequent navigation to a fragment as a new navigation.");
42+
}
43+
3844
driver.Url = xhtmlTestPage;
3945
driver.Url = xhtmlTestPage + "#text";
4046
driver.FindElement(By.Id("id1"));
@@ -64,6 +70,12 @@ public void ShouldReturnWhenGettingAUrlThatDoesNotResolve()
6470
[IgnoreBrowser(Browser.Safari, "Hangs Safari driver")]
6571
public void ShouldThrowIfUrlIsMalformed()
6672
{
73+
if (TestUtilities.IsMarionette(driver))
74+
{
75+
// Don't run this test on Marionette.
76+
Assert.Ignore("Browser hangs when executed via Marionette");
77+
}
78+
6779
driver.Url = "www.test.com";
6880
}
6981

@@ -202,6 +214,12 @@ public void ShouldBeAbleToRefreshAPage()
202214
[IgnoreBrowser(Browser.Safari, "Untested user-agent")]
203215
public void ShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCall()
204216
{
217+
if (TestUtilities.IsMarionette(driver))
218+
{
219+
// Don't run this test on Marionette.
220+
Assert.Ignore("Browser hangs when executed via Marionette");
221+
}
222+
205223
driver.Url = documentWrite;
206224

207225
// If this command succeeds, then all is well.

dotnet/test/common/TestUtilities.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ public static bool IsFirefox(IWebDriver driver)
3939
return GetUserAgent(driver).Contains("Firefox");
4040
}
4141

42+
public static bool IsMarionette(IWebDriver driver)
43+
{
44+
Firefox.FirefoxDriver firefoxDriver = driver as Firefox.FirefoxDriver;
45+
46+
return firefoxDriver != null && firefoxDriver.IsMarionette;
47+
}
48+
4249
public static bool IsInternetExplorer(IWebDriver driver)
4350
{
4451
string userAgent = GetUserAgent(driver);

0 commit comments

Comments
 (0)