public class AssertionWebDriverSubStepImplementations extends AbstractWebDriverSubStepImplementations
| Constructor and Description |
|---|
AssertionWebDriverSubStepImplementations() |
| Modifier and Type | Method and Description |
|---|---|
void |
assertAttributeInCurrentElement(String attribute,
String expected)
Check that the current element has the specified attribute and value
|
void |
assertCheckBoxIsChecked(String checkedString)
Check that the current element, a checkbox is checked or not
|
void |
assertCurrentElementHasAttributes(String attributeString)
Check that the current element has the specified attributes
|
void |
assertDifferent(String rememberedValueName,
String elementId)
Compare the text of an element (identified by ID) to a value previously
remembered
|
static void |
assertElementIs(org.openqa.selenium.WebElement elem,
String tag)
Utility method to check that an element is of a particular tag
|
static void |
assertElementIs(org.openqa.selenium.WebElement elem,
String tag,
String type)
Utility method to check that an element is of a particular tag and type
|
void |
assertEventuallyContains(String elementId,
String text)
Asserts that an element (identified by ID) eventually gets some specific
text inserted into it (by JavaScript, probably)
|
void |
assertEventuallyNotEmpty(String elementId)
Asserts that an element (identified by ID) eventually gets some text
inserted into it (by JavaScript, probably)
|
void |
assertNotPresent(String text)
Assert that the specified text is not found within the page
|
void |
assertPageTitle(String expectedTitle)
Check that the page title is ....
|
void |
assertRadioButtonIsChecked(String checkedString)
Check that the current element, a radio button, is checked or not
|
void |
assertSame(String rememberedValueName,
String elementId)
Compare the text of an element (identified by ID) to a value previously
remembered - assert they're the same
|
void |
assertTagElementContainsAttribute(String tag,
String attributeName,
String attributeValue)
Check that any of the html tags have the specified attribute name and
value
|
void |
assertTextInCurrentElement(String expected)
Check that the current element has the expected text value
|
void |
assertTextInCurrentElementContains(String expected)
Check that the current element contains the specified text
|
void |
assertValueInCurrentInput(String expected)
Check that the current input field has the expected text value
|
void |
pageSourceContains(String expected)
Simple text search on page source
|
void |
rememberForScenario(String elementId,
String nameToSaveAs)
Grab the text of an element (identified by id) and save it for the
duration of this scenario
|
org.openqa.selenium.WebElement |
waitForElementToContainSomeText(org.openqa.selenium.By by)
Wait for an element to contain some (any) text
|
elementHasExpectedAttributes, getScreenshotBytes, webDriver, webDriverContextpublic AssertionWebDriverSubStepImplementations()
public void assertTextInCurrentElement(String expected)
expected - the expected textpublic void assertValueInCurrentInput(String expected)
expected - the expected valuepublic void assertTextInCurrentElementContains(String expected)
expected - the expected textpublic void assertAttributeInCurrentElement(String attribute, String expected)
attribute - the attribute nameexpected - the expected value of the attributepublic void assertTagElementContainsAttribute(String tag, String attributeName, String attributeValue)
tag - the tagattributeName - the attribute nameattributeValue - the attribute valuepublic void assertPageTitle(String expectedTitle)
expectedTitle - the expected titlepublic void pageSourceContains(String expected)
expected - the text you expect to find in the page source - this can
include quotes.public void assertCheckBoxIsChecked(String checkedString)
checkedString - whether the radio button is checked or notpublic void assertRadioButtonIsChecked(String checkedString)
checkedString - whether the radio button is checked or notpublic void assertCurrentElementHasAttributes(String attributeString)
attributeString - comma separated list of attributes and quoted valuespublic static void assertElementIs(org.openqa.selenium.WebElement elem,
String tag,
String type)
elem - the elementtag - the expected tagtype - the expected type attributepublic static void assertElementIs(org.openqa.selenium.WebElement elem,
String tag)
elem - the element to checktag - the expected tagpublic void rememberForScenario(String elementId, String nameToSaveAs)
elementId - The ID of the HTML elementnameToSaveAs - The variable name to save the text as for later retrievalpublic void assertDifferent(String rememberedValueName, String elementId)
elementId - The ID of the HTML elementrememberedValueName - The variable name to save the text as for later retrievalpublic void assertSame(String rememberedValueName, String elementId)
elementId - The ID of the HTML elementrememberedValueName - The variable name to save the text as for later retrievalpublic void assertEventuallyNotEmpty(String elementId)
elementId - HTML ID of elementpublic void assertEventuallyContains(String elementId, String text)
elementId - HTML ID of elementtext - the expected textpublic void assertNotPresent(String text)
text - the text that shouldn't be presentpublic org.openqa.selenium.WebElement waitForElementToContainSomeText(org.openqa.selenium.By by)
by - WebDriver By object that identifies the elementCopyright © 2016 Substeps. All rights reserved.