public abstract class HamcrestWebDriverTestCase
extends junit.framework.TestCase
| Constructor and Description |
|---|
HamcrestWebDriverTestCase() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertNotSelected(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected void |
assertPresenceOf(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected void |
assertPresenceOf(org.hamcrest.Matcher<Integer> cardinalityConstraint,
Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected void |
assertSelected(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected void |
clickOn(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected abstract org.openqa.selenium.WebDriver |
createDriver() |
String |
getCurrentUrl()
Returns the current URL
|
String |
getPageSource()
Returns the current page source
|
String |
getTitle()
Returns the current page title
|
protected org.openqa.selenium.WebDriver |
getWebDriver() |
protected void |
goTo(String url)
Cause the browser to navigate to the given URL
|
protected Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> |
into(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> input)
Syntactic sugar to use with
HamcrestWebDriverTestCase,
e.g. |
protected void |
setUp() |
protected void |
tearDown() |
protected void |
type(String text,
Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> inputFinder)
Type characters into an element of the page, typically an input field
|
protected void |
waitFor(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder) |
protected void |
waitFor(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder,
long timeout) |
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, toStringprotected abstract org.openqa.selenium.WebDriver createDriver()
protected void setUp()
throws Exception
setUp in class junit.framework.TestCaseExceptionprotected void tearDown()
throws Exception
tearDown in class junit.framework.TestCaseExceptionprotected org.openqa.selenium.WebDriver getWebDriver()
protected void clickOn(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
protected void assertPresenceOf(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
protected void assertPresenceOf(org.hamcrest.Matcher<Integer> cardinalityConstraint, Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
protected void waitFor(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
protected void waitFor(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder, long timeout)
protected void goTo(String url)
url - protected void type(String text, Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> inputFinder)
text - - characters to typeinputFinder - - specification for the page elementprotected Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> into(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> input)
HamcrestWebDriverTestCase,
e.g. type("cheese", into(textbox())); The into() method simply returns its argument.public String getPageSource()
public String getTitle()
public String getCurrentUrl()
protected void assertSelected(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
protected void assertNotSelected(Finder<org.openqa.selenium.WebElement,org.openqa.selenium.WebDriver> finder)
Copyright © 2015. All rights reserved.