Simplifying checks
package org.openqa.selenium.firefox;
import static org.openqa.selenium.testing.Driver.FIREFOX;
-import static org.openqa.selenium.testing.Driver.MARIONETTE;
import org.junit.After;
import org.junit.Test;
-import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.testing.Ignore;
@@ -49,9 +47,7 @@ public void shouldUseFirefoxOptions() throws InterruptedException {
driver = new FirefoxDriver(caps);
- wait.until(
- input -> "XHTML Test Page".equals(
- ((JavascriptExecutor) driver).executeScript("return document.title")));
+ wait.until($ -> "XHTML Test Page".equals(driver.getTitle()));
}
@Test
@@ -65,9 +61,7 @@ public void canSetProfileInFirefoxOptions() throws InterruptedException {
driver = new FirefoxDriver(caps);
- wait.until(
- input -> "XHTML Test Page".equals(
- ((JavascriptExecutor) driver).executeScript("return document.title")));
+ wait.until($ -> "XHTML Test Page".equals(driver.getTitle()));
}
@Test
@@ -81,8 +75,6 @@ public void canSetProfileInCapabilities() throws InterruptedException {
driver = new FirefoxDriver(caps);
- wait.until(
- input -> "XHTML Test Page".equals(
- ((JavascriptExecutor) driver).executeScript("return document.title")));
+ wait.until($ -> "XHTML Test Page".equals(driver.getTitle()));
}
}
