Class WebDriverTestContext

  • All Implemented Interfaces:
    TestContext

    public class WebDriverTestContext
    extends java.lang.Object
    implements TestContext
    Gives the context for a test, holds page state, and interacts with the WebDriver.
    • Constructor Summary

      Constructors 
      Constructor Description
      WebDriverTestContext​(org.openqa.selenium.WebDriver driver)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assertPresenceOf​(org.hamcrest.Matcher<java.lang.Integer> cardinalityConstraint, Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)  
      void assertPresenceOf​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)  
      void clickOn​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)  
      void clickOnFirst​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)  
      void goTo​(java.lang.String url)  
      void quit()  
      void type​(java.lang.String input, Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)  
      void waitFor​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder, long timeoutMillis)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebDriverTestContext

        public WebDriverTestContext​(org.openqa.selenium.WebDriver driver)
    • Method Detail

      • goTo

        public void goTo​(java.lang.String url)
        Specified by:
        goTo in interface TestContext
      • assertPresenceOf

        public void assertPresenceOf​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)
        Specified by:
        assertPresenceOf in interface TestContext
      • assertPresenceOf

        public void assertPresenceOf​(org.hamcrest.Matcher<java.lang.Integer> cardinalityConstraint,
                                     Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)
        Specified by:
        assertPresenceOf in interface TestContext
      • type

        public void type​(java.lang.String input,
                         Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)
        Specified by:
        type in interface TestContext
      • clickOn

        public void clickOn​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)
        Specified by:
        clickOn in interface TestContext
      • clickOnFirst

        public void clickOnFirst​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder)
      • waitFor

        public void waitFor​(Finder<org.openqa.selenium.WebElement,​org.openqa.selenium.WebDriver> finder,
                            long timeoutMillis)
        Specified by:
        waitFor in interface TestContext