Adding more tests for FirefoxDriver construction with a profile
@@ -41,7 +41,6 @@ public void quitDriver() {
}
@Test
- @Ignore(MARIONETTE)
public void shouldUseFirefoxOptions() throws InterruptedException {
DesiredCapabilities caps = new FirefoxOptions()
.addPreference("browser.startup.page", 1)
@@ -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")));
+ }
}
