|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.selenium.SeleniumAssertions
public class SeleniumAssertions
This provides helper methods for selenium assertions. This mostly means waiting for events to occur (i.e. a dropdown to appear after a certain timeout, etc)
| Constructor Summary | |
|---|---|
SeleniumAssertions(com.thoughtworks.selenium.Selenium client,
SeleniumConfiguration config)
|
|
| Method Summary | |
|---|---|
void |
attributeContainsValue(PageElement element,
String attribute,
String value)
|
void |
attributeContainsValue(String locator,
String attribute,
String value)
Asserts that the element given by the locator has an attribute which contains the required value. |
void |
attributeDoesntContainValue(PageElement element,
String attribute,
String value)
|
void |
attributeDoesntContainValue(String locator,
String attribute,
String value)
Asserts that the element given by the locator has an attribute which does not contain the given value. |
void |
byTimeout(Condition condition)
|
void |
byTimeout(Condition condition,
long maxWaitTime)
|
void |
elementContainsText(PageElement element,
String text)
|
void |
elementContainsText(String locator,
String text)
Asserts that an element contains the given text. |
void |
elementDoesNotContainText(PageElement element,
String text)
|
void |
elementDoesNotContainText(String locator,
String text)
Asserts that an element does not contain the given text. |
void |
elementDoesntHaveText(PageElement element,
String text)
|
void |
elementDoesntHaveText(String locator,
String text)
Asserts that the element specified by the locator does not contain the specified text |
void |
elementHasText(PageElement element,
String text)
|
void |
elementHasText(String locator,
String text)
Asserts that the element specified by the locator contains the specified text |
void |
elementNotPresent(PageElement element)
|
void |
elementNotPresent(String locator)
Asserts that a given element is not present on the current page |
void |
elementNotPresentByTimeout(PageElement element)
|
void |
elementNotPresentByTimeout(PageElement element,
long maxMillis)
|
void |
elementNotPresentByTimeout(String locator)
|
void |
elementNotPresentByTimeout(String locator,
long maxMillis)
This will wait until an element is not present. |
void |
elementNotPresentUntilTimeout(PageElement element)
|
void |
elementNotPresentUntilTimeout(PageElement element,
long maxMillis)
|
void |
elementNotPresentUntilTimeout(String locator)
|
void |
elementNotPresentUntilTimeout(String locator,
long maxMillis)
|
void |
elementNotVisible(PageElement element)
|
void |
elementNotVisible(String locator)
Asserts that a given element is not present and visible. |
void |
elementPresent(PageElement element)
|
void |
elementPresent(String locator)
Asserts that a given element is present |
void |
elementPresentByTimeout(PageElement element)
|
void |
elementPresentByTimeout(PageElement element,
long maxMillis)
|
void |
elementPresentByTimeout(String locator)
|
void |
elementPresentByTimeout(String locator,
long maxMillis)
|
void |
elementPresentUntilTimeout(PageElement element)
|
void |
elementPresentUntilTimeout(PageElement element,
long maxMillis)
|
void |
elementPresentUntilTimeout(String locator)
|
void |
elementPresentUntilTimeout(String locator,
long maxMillis)
|
void |
elementsSameHeight(PageElement element1,
PageElement element2,
int deltaPixels)
|
void |
elementsSameHeight(String locator1,
String locator2,
int deltaPixels)
|
void |
elementsVerticallyAligned(PageElement element1,
PageElement element2,
int deltaPixels)
|
void |
elementsVerticallyAligned(String locator1,
String locator2,
int deltaPixels)
Asserts that two elements (located by selenium syntax) are vertically within deltaPixels of each other. |
void |
elementVisible(PageElement element)
|
void |
elementVisible(String locator)
Asserts that a given element is present and is visible. |
void |
elementVisibleContainsText(PageElement element,
String text)
|
void |
elementVisibleContainsText(String locator,
String text)
Asserts that a given element is visible and also contains the given text. |
void |
formElementEquals(String locator,
String value)
Asserts that a given element has a specified value |
void |
htmlNotPresent(String html)
Asserts that a particular piece of HTML is not present in the HTML source. |
void |
htmlPresent(String html)
Asserts that a particular piece of HTML is present in the HTML source. |
void |
linkNotPresentWithText(String text)
Asserts that no link exists on the page containing the given text |
void |
linkPresentWithText(String text)
Asserts that a link containing the given text appears on the page |
void |
linkVisibleWithText(String text)
Asserts that a link containin the given text is present and visible. |
void |
notVisibleByTimeout(PageElement element)
|
void |
notVisibleByTimeout(PageElement element,
long maxMillis)
|
void |
notVisibleByTimeout(String locator)
|
void |
notVisibleByTimeout(String locator,
long maxMillis)
|
void |
textNotPresent(String text)
|
void |
textNotPresentByTimeout(String text)
|
void |
textNotPresentByTimeout(String text,
long maxMillis)
|
void |
textPresent(String text)
|
void |
textPresentByTimeout(String text)
|
void |
textPresentByTimeout(String text,
long maxMillis)
|
void |
untilTimeout(Condition condition)
|
void |
untilTimeout(Condition condition,
long maxWaitTime)
|
void |
visibleByTimeout(PageElement element)
|
void |
visibleByTimeout(PageElement element,
long maxMillis)
|
void |
visibleByTimeout(String locator)
|
void |
visibleByTimeout(String locator,
long maxMillis)
This will wait until an element is visible. |
void |
windowClosed(String windowName)
|
void |
windowOpen(String windowName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SeleniumAssertions(com.thoughtworks.selenium.Selenium client,
SeleniumConfiguration config)
| Method Detail |
|---|
public void visibleByTimeout(String locator)
public void visibleByTimeout(PageElement element)
public void visibleByTimeout(String locator,
long maxMillis)
locator - the selenium element locatormaxMillis - how long to wait as most in milliseconds
public void visibleByTimeout(PageElement element,
long maxMillis)
public void notVisibleByTimeout(String locator)
public void notVisibleByTimeout(PageElement element)
public void notVisibleByTimeout(String locator,
long maxMillis)
public void notVisibleByTimeout(PageElement element,
long maxMillis)
public void elementPresentByTimeout(String locator)
public void elementPresentByTimeout(PageElement element)
public void elementPresentByTimeout(String locator,
long maxMillis)
public void elementPresentByTimeout(PageElement element,
long maxMillis)
public void elementPresentUntilTimeout(String locator)
public void elementPresentUntilTimeout(PageElement element)
public void elementPresentUntilTimeout(String locator,
long maxMillis)
public void elementPresentUntilTimeout(PageElement element,
long maxMillis)
public void elementNotPresentByTimeout(String locator)
public void elementNotPresentByTimeout(PageElement element)
public void elementNotPresentUntilTimeout(String locator)
public void elementNotPresentUntilTimeout(PageElement element)
public void elementNotPresentUntilTimeout(String locator,
long maxMillis)
public void elementNotPresentUntilTimeout(PageElement element,
long maxMillis)
public void textPresentByTimeout(String text,
long maxMillis)
public void textPresentByTimeout(String text)
public void textNotPresentByTimeout(String text,
long maxMillis)
public void textNotPresentByTimeout(String text)
public void elementNotPresentByTimeout(String locator,
long maxMillis)
locator - the selenium element locatormaxMillis - how long to wait as most in milliseconds
public void elementNotPresentByTimeout(PageElement element,
long maxMillis)
public void byTimeout(Condition condition)
public void byTimeout(Condition condition,
long maxWaitTime)
public void untilTimeout(Condition condition)
public void untilTimeout(Condition condition,
long maxWaitTime)
public void textPresent(String text)
text - Asserts that text is present in the current pagepublic void textNotPresent(String text)
text - Asserts that text is not present in the current page
public void formElementEquals(String locator,
String value)
locator - Locator for element using the standard selenium locator syntaxvalue - The value the element is expected to containpublic void elementPresent(String locator)
locator - Locator for the element that should be present given using the standard selenium locator syntaxpublic void elementPresent(PageElement element)
public void elementNotPresent(String locator)
locator - Locator for the element that should not be present given using the standard selenium locator syntaxpublic void elementNotPresent(PageElement element)
public void elementVisible(String locator)
locator - Locator for the element that should be visible specified in the standard selenium syntaxpublic void elementVisible(PageElement element)
public void elementNotVisible(String locator)
locator - Locator for the element that should not be visible specified in the standard selenium syntaxpublic void elementNotVisible(PageElement element)
public void elementVisibleContainsText(String locator,
String text)
locator - Locator for the element that should be visible specified in the standard selenium syntaxtext - the text that the element should contain
public void elementVisibleContainsText(PageElement element,
String text)
public void htmlPresent(String html)
html - Lower case representation of HTML string that should not be presentpublic void htmlNotPresent(String html)
html - Lower case representation of HTML string that should not be present
public void elementHasText(String locator,
String text)
locator - Locator given in standard selenium syntaxtext - The text that the element designated by the locator should contain
public void elementHasText(PageElement element,
String text)
public void elementDoesntHaveText(String locator,
String text)
locator - Locator given in standard selenium syntaxtext - The text that the element designated by the locator should not contain
public void elementDoesntHaveText(PageElement element,
String text)
public void attributeContainsValue(String locator,
String attribute,
String value)
locator - Locator given in standard selenium syntaxattribute - The element attributevalue - The value expected to be found in the element's attribute
public void attributeContainsValue(PageElement element,
String attribute,
String value)
public void attributeDoesntContainValue(String locator,
String attribute,
String value)
locator - Locator given in standard selenium syntaxattribute - The element attributevalue - The value expected to be found in the element's attribute
public void attributeDoesntContainValue(PageElement element,
String attribute,
String value)
public void linkPresentWithText(String text)
text - The text that a link on the page should containalsopublic void linkNotPresentWithText(String text)
text - The text that no link on the page should containpublic void linkVisibleWithText(String text)
text - The text that a link on the page should contain
public void elementsVerticallyAligned(String locator1,
String locator2,
int deltaPixels)
locator1 - Locator for element 1 given in standard selenium syntaxlocator2 - Locator for element 2 given in standard selenium syntaxdeltaPixels - The maximum allowable distance between the two element
public void elementsVerticallyAligned(PageElement element1,
PageElement element2,
int deltaPixels)
public void elementsSameHeight(String locator1,
String locator2,
int deltaPixels)
public void elementsSameHeight(PageElement element1,
PageElement element2,
int deltaPixels)
public void elementContainsText(String locator,
String text)
public void elementContainsText(PageElement element,
String text)
public void elementDoesNotContainText(String locator,
String text)
public void elementDoesNotContainText(PageElement element,
String text)
public void windowClosed(String windowName)
public void windowOpen(String windowName)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||