Skip to content

Commit

Permalink
Adding more tests for FirefoxDriver construction with a profile
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Jan 7, 2017
1 parent 9428b32 commit b5d04d8
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion java/client/test/org/openqa/selenium/firefox/MarionetteTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void quitDriver() {
}

@Test
@Ignore(MARIONETTE)
public void shouldUseFirefoxOptions() throws InterruptedException {
DesiredCapabilities caps = new FirefoxOptions()
.addPreference("browser.startup.page", 1)
Expand All @@ -54,4 +53,36 @@ public void shouldUseFirefoxOptions() throws InterruptedException {
input -> "XHTML Test Page".equals(
((JavascriptExecutor) driver).executeScript("return document.title")));
}

@Test
public void canSetProfileInFirefoxOptions() throws InterruptedException {
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.startup.page", 1);
profile.setPreference("browser.startup.homepage", pages.xhtmlTestPage);

DesiredCapabilities caps = new FirefoxOptions().setProfile(profile)
.addTo(DesiredCapabilities.firefox());

driver = new FirefoxDriver(caps);

wait.until(
input -> "XHTML Test Page".equals(
((JavascriptExecutor) driver).executeScript("return document.title")));
}

@Test
public void canSetProfileInCapabilities() throws InterruptedException {
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("browser.startup.page", 1);
profile.setPreference("browser.startup.homepage", pages.xhtmlTestPage);

DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability(FirefoxDriver.PROFILE, profile);

driver = new FirefoxDriver(caps);

wait.until(
input -> "XHTML Test Page".equals(
((JavascriptExecutor) driver).executeScript("return document.title")));
}
}

0 comments on commit b5d04d8

Please sign in to comment.