Class AbstractWebDriver

java.lang.Object
ch.rswk.util.web.test.AbstractWebDriver
Direct Known Subclasses:
WebDriverTest, WebDriverTest, WebDriverTest

public abstract class AbstractWebDriver extends Object
AbstractWebDriver contains common setup and utility functions for Selenium WebDrvier based testing, using Chrome and Firefox browsers.

See ChromeDriver and GeckoDriver.

  • Field Details

  • Constructor Details

    • AbstractWebDriver

      public AbstractWebDriver()
  • Method Details

    • setupDrivers

      @BeforeAll public static void setupDrivers()
    • forgeChromeRemoteOptions

      protected static org.openqa.selenium.chrome.ChromeOptions forgeChromeRemoteOptions()
    • forgeFirefoxRemoteOptions

      protected static org.openqa.selenium.firefox.FirefoxOptions forgeFirefoxRemoteOptions()
    • newChromeDriver

      protected static org.openqa.selenium.chrome.ChromeDriver newChromeDriver(org.openqa.selenium.chrome.ChromeOptions options)
    • forgeChromeOptions

      protected static org.openqa.selenium.chrome.ChromeOptions forgeChromeOptions()
    • newFirefoxDriver

      protected static org.openqa.selenium.firefox.FirefoxDriver newFirefoxDriver(org.openqa.selenium.firefox.FirefoxOptions options)
    • forgeFirefoxOptions

      protected static org.openqa.selenium.firefox.FirefoxOptions forgeFirefoxOptions()
    • teardownDrivers

      @AfterAll public static void teardownDrivers()
    • qunit

      protected void qunit(int noOfAssertions, String driverName, @Nullable Duration timeout, String url)
    • runAndAssertQunit

      protected static void runAndAssertQunit(org.openqa.selenium.WebDriver driver, int expectedAssertions, Duration timeout, String url)
    • takeQunitFailedScreenshots

      protected static void takeQunitFailedScreenshots(org.openqa.selenium.WebDriver driver, AbstractWebDriver.QunitResult result)
    • runQunit

      protected static AbstractWebDriver.QunitResult runQunit(org.openqa.selenium.WebDriver driver, int expectedAssertions, Duration timeout)
    • runUiTest

      protected void runUiTest(org.openqa.selenium.WebDriver driver, Callable<Void> test, String url, @Nullable org.openqa.selenium.Dimension windowSize)
    • getNukeUrl

      protected static String getNukeUrl(String url)
    • getConfigOverrideQueryParam

      protected static String getConfigOverrideQueryParam(com.fasterxml.jackson.databind.JsonNode config) throws IOException
      Throws:
      IOException
    • newFluentWait

      protected static org.openqa.selenium.support.ui.FluentWait<org.openqa.selenium.WebDriver> newFluentWait(org.openqa.selenium.WebDriver driver, Duration timeout)
    • windowPost

      protected void windowPost(org.openqa.selenium.WebDriver driver, String jsObject)
    • getPostMessageOrigin

      protected String getPostMessageOrigin()
    • clickElement

      protected static void clickElement(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
    • clickVisibleCloseButtons

      protected static void clickVisibleCloseButtons(org.openqa.selenium.WebDriver driver)
    • findSubmitButton

      protected static org.openqa.selenium.WebElement findSubmitButton(org.openqa.selenium.WebDriver driver, String formId)
    • getInputValue

      protected static String getInputValue(org.openqa.selenium.WebDriver driver, String inputId)
    • byAnchorLink

      protected static org.openqa.selenium.By byAnchorLink(String href)
    • newInvalidInputSelector

      protected static org.openqa.selenium.By newInvalidInputSelector(String formId)
    • scrollTo

      protected static void scrollTo(org.openqa.selenium.WebDriver driver, org.openqa.selenium.WebElement element)
    • setScriptTimeout

      protected static void setScriptTimeout(org.openqa.selenium.WebDriver driver, Duration timeout)
    • takeScreenshot

      protected static void takeScreenshot(org.openqa.selenium.WebDriver driver, String name)
    • getScreenshotPath

      protected static Path getScreenshotPath(org.openqa.selenium.WebDriver driver, String name)
    • executeScript

      protected static void executeScript(org.openqa.selenium.WebDriver driver, String js, Object... args)
    • executeScriptAsync

      protected static void executeScriptAsync(org.openqa.selenium.WebDriver driver, String js, Object... args)