|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectnet.thucydides.core.pages.PageObject
public abstract class PageObject
A base class representing a WebDriver page object.
| Nested Class Summary | |
|---|---|
class |
PageObject.FieldEntry
|
| Constructor Summary | |
|---|---|
protected |
PageObject()
|
|
PageObject(org.openqa.selenium.WebDriver driver)
|
|
PageObject(org.openqa.selenium.WebDriver driver,
int ajaxTimeout)
|
protected |
PageObject(org.openqa.selenium.WebDriver driver,
com.google.common.base.Predicate<PageObject> callback)
|
| Method Summary | ||
|---|---|---|
WebElementFacade |
$(String xpathOrCssSelector)
|
|
WebElementFacade |
$(org.openqa.selenium.WebElement webElement)
|
|
void |
addJQuerySupport()
|
|
void |
blurActiveElement()
|
|
void |
callWhenPageOpensMethods()
Override this method |
|
void |
clickOn(org.openqa.selenium.WebElement webElement)
|
|
boolean |
compatibleWithUrl(String currentUrl)
Does this page object work for this URL? When matching a URL, we check with and without trailing slashes |
|
boolean |
containsAllText(String... textValues)
Check that the specified text appears somewhere in the page. |
|
boolean |
containsText(String textValue)
|
|
boolean |
containsTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
Deprecated. use element(webElement).containsText(textValue) |
|
WebElementFacade |
element(org.openqa.selenium.By bySelector)
Provides a fluent API for querying web elements. |
|
WebElementFacade |
element(String xpathOrCssSelector)
Provides a fluent API for querying web elements. |
|
WebElementFacade |
element(org.openqa.selenium.WebElement webElement)
Provides a fluent API for querying web elements. |
|
PageObject.FieldEntry |
enter(String value)
Clear a field and enter a value into it. |
|
Object |
evaluateJavascript(String script)
|
|
Object |
evaluateJavascript(String script,
Object... params)
|
|
WebElementFacade |
find(org.openqa.selenium.By selector)
|
|
List<WebElementFacade> |
findAll(org.openqa.selenium.By bySelector)
|
|
List<WebElementFacade> |
findAll(String xpathOrCssSelector)
|
|
WebElementFacade |
findBy(String xpathOrCssSelector)
|
|
protected ThucydidesFluentAdapter |
fluent()
|
|
org.openqa.selenium.Alert |
getAlert()
|
|
protected SystemClock |
getClock()
|
|
org.openqa.selenium.WebDriver |
getDriver()
|
|
protected JavascriptExecutorFacade |
getJavascriptExecutorFacade()
|
|
protected net.thucydides.core.pages.RenderedPageObjectView |
getRenderedView()
|
|
String |
getSelectedLabelFrom(org.openqa.selenium.WebElement dropdown)
|
|
Set<String> |
getSelectedOptionLabelsFrom(org.openqa.selenium.WebElement dropdown)
|
|
Set<String> |
getSelectedOptionValuesFrom(org.openqa.selenium.WebElement dropdown)
|
|
String |
getSelectedValueFrom(org.openqa.selenium.WebElement dropdown)
|
|
String |
getTitle()
|
|
boolean |
hasFocus(org.openqa.selenium.WebElement webElement)
Deprecated. Use element(webElement).hasFocus() instead |
|
Boolean |
isElementVisible(org.openqa.selenium.By byCriteria)
Returns true if at least one matching element is found on the page and is visible. |
|
static boolean |
isXPath(String xpathExpression)
|
|
protected boolean |
matchesAnyUrl()
|
|
void |
open()
Open the webdriver browser to the base URL, determined by the DefaultUrl annotation if present. |
|
void |
open(String... parameterValues)
Open the webdriver browser using a paramaterized URL. |
|
void |
open(String urlTemplateName,
String[] parameterValues)
|
|
void |
openAt(String startingUrl)
|
|
void |
openUnchecked()
Opens page without checking URL patterns. |
|
void |
openUnchecked(String... parameterValues)
Opens page without checking URL patterns. |
|
void |
openUnchecked(String urlTemplateName,
String[] parameterValues)
Opens page without checking URL patterns. |
|
void |
selectFromDropdown(org.openqa.selenium.WebElement dropdown,
String visibleLabel)
|
|
void |
selectMultipleItemsFromDropdown(org.openqa.selenium.WebElement dropdown,
String... selectedLabels)
|
|
void |
setCheckbox(org.openqa.selenium.WebElement field,
boolean value)
|
|
void |
setDefaultBaseUrl(String defaultBaseUrl)
|
|
protected void |
setDriver(org.openqa.selenium.WebDriver driver)
|
|
protected void |
setDriver(org.openqa.selenium.WebDriver driver,
int timeout)
|
|
void |
setPages(Pages pages)
|
|
void |
setPageUrls(PageUrls pageUrls)
Only for testing purposes. |
|
void |
setWaitForTimeout(long waitForTimeoutInMilliseconds)
|
|
void |
shouldBeDisplayed()
Use the @At annotation (if present) to check that a page object is displaying the correct page. |
|
void |
shouldBeVisible(org.openqa.selenium.By byCriteria)
|
|
void |
shouldBeVisible(org.openqa.selenium.WebElement field)
Fail the test if this element is not displayed (rendered) on the screen. |
|
void |
shouldContainAllText(String... textValues)
Check that all of the specified texts appears somewhere in the page. |
|
void |
shouldContainText(String textValue)
Check that the specified text appears somewhere in the page. |
|
void |
shouldContainTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
Deprecated. |
|
void |
shouldNotBeVisible(org.openqa.selenium.By byCriteria)
|
|
void |
shouldNotBeVisible(org.openqa.selenium.WebElement field)
|
|
void |
shouldNotContainTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
Deprecated. |
|
|
switchToPage(Class<T> pageObjectClass)
|
|
List<org.openqa.selenium.WebElement> |
thenReturnElementList(org.openqa.selenium.By byListCriteria)
|
|
void |
typeInto(org.openqa.selenium.WebElement field,
String value)
Clear a field and enter a value into it. |
|
String |
updateUrlWithBaseUrlIfDefined(String startingUrl)
|
|
FileToUpload |
upload(String filename)
|
|
protected void |
waitABit(long timeInMilliseconds)
|
|
PageObject |
waitFor(org.openqa.selenium.support.ui.ExpectedCondition expectedCondition)
|
|
StepDelayer.WaitForBuilder |
waitFor(int duration)
|
|
PageObject |
waitFor(String xpathOrCssSelector)
|
|
PageObject |
waitForAbsenceOf(String xpathOrCssSelector)
|
|
PageObject |
waitForAllTextToAppear(String... expectedTexts)
Waits for all of a number of text blocks to appear on the screen. |
|
PageObject |
waitForAnyRenderedElementOf(org.openqa.selenium.By... expectedElements)
|
|
PageObject |
waitForAnyTextToAppear(String... expectedText)
Waits for any of a number of text blocks to appear anywhere on the screen. |
|
PageObject |
waitForAnyTextToAppear(org.openqa.selenium.WebElement element,
String... expectedText)
|
|
ThucydidesFluentWait<org.openqa.selenium.WebDriver> |
waitForCondition()
|
|
PageObject |
waitForPresenceOf(String xpathOrCssSelector)
|
|
PageObject |
waitForRenderedElements(org.openqa.selenium.By byElementCriteria)
|
|
PageObject |
waitForRenderedElementsToBePresent(org.openqa.selenium.By byElementCriteria)
|
|
PageObject |
waitForRenderedElementsToDisappear(org.openqa.selenium.By byElementCriteria)
|
|
PageObject |
waitForTextToAppear(String expectedText)
Waits for a given text to appear anywhere on the page. |
|
PageObject |
waitForTextToAppear(org.openqa.selenium.WebElement element,
String expectedText)
Waits for a given text to appear anywhere on the page. |
|
PageObject |
waitForTextToDisappear(String expectedText)
|
|
PageObject |
waitForTextToDisappear(String expectedText,
long timeout)
Waits for a given text to not be anywhere on the page. |
|
PageObject |
waitForTextToDisappear(org.openqa.selenium.WebElement element,
String expectedText)
Waits for a given text to appear anywhere on the page. |
|
long |
waitForTimeoutInMilliseconds()
|
|
PageObject |
waitForTitleToAppear(String expectedTitle)
|
|
PageObject |
waitForTitleToDisappear(String expectedTitle)
|
|
ThucydidesFluentWait<org.openqa.selenium.WebDriver> |
waitForWithRefresh()
|
|
org.openqa.selenium.interactions.Actions |
withAction()
|
|
static String[] |
withParameters(String... parameterValues)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PageObject()
protected PageObject(org.openqa.selenium.WebDriver driver,
com.google.common.base.Predicate<PageObject> callback)
public PageObject(org.openqa.selenium.WebDriver driver,
int ajaxTimeout)
public PageObject(org.openqa.selenium.WebDriver driver)
| Method Detail |
|---|
protected void setDriver(org.openqa.selenium.WebDriver driver,
int timeout)
protected void setDriver(org.openqa.selenium.WebDriver driver)
public void setPages(Pages pages)
public <T extends PageObject> T switchToPage(Class<T> pageObjectClass)
public FileToUpload upload(String filename)
public void setPageUrls(PageUrls pageUrls)
public void setWaitForTimeout(long waitForTimeoutInMilliseconds)
protected net.thucydides.core.pages.RenderedPageObjectView getRenderedView()
protected SystemClock getClock()
public org.openqa.selenium.WebDriver getDriver()
public String getTitle()
protected boolean matchesAnyUrl()
public final boolean compatibleWithUrl(String currentUrl)
public PageObject waitForRenderedElements(org.openqa.selenium.By byElementCriteria)
public PageObject waitFor(String xpathOrCssSelector)
public PageObject waitFor(org.openqa.selenium.support.ui.ExpectedCondition expectedCondition)
public PageObject waitForRenderedElementsToBePresent(org.openqa.selenium.By byElementCriteria)
public PageObject waitForPresenceOf(String xpathOrCssSelector)
public PageObject waitForRenderedElementsToDisappear(org.openqa.selenium.By byElementCriteria)
public PageObject waitForAbsenceOf(String xpathOrCssSelector)
public PageObject waitForTextToAppear(String expectedText)
public PageObject waitForTitleToAppear(String expectedTitle)
public PageObject waitForTitleToDisappear(String expectedTitle)
public PageObject waitForTextToAppear(org.openqa.selenium.WebElement element,
String expectedText)
public PageObject waitForTextToDisappear(org.openqa.selenium.WebElement element,
String expectedText)
public PageObject waitForTextToDisappear(String expectedText)
public PageObject waitForTextToDisappear(String expectedText,
long timeout)
public PageObject waitForAnyTextToAppear(String... expectedText)
public PageObject waitForAnyTextToAppear(org.openqa.selenium.WebElement element,
String... expectedText)
public PageObject waitForAllTextToAppear(String... expectedTexts)
public PageObject waitForAnyRenderedElementOf(org.openqa.selenium.By... expectedElements)
protected void waitABit(long timeInMilliseconds)
public StepDelayer.WaitForBuilder waitFor(int duration)
public List<org.openqa.selenium.WebElement> thenReturnElementList(org.openqa.selenium.By byListCriteria)
public void shouldContainText(String textValue)
public void shouldContainAllText(String... textValues)
@Deprecated
public boolean containsTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
@Deprecated
public void shouldContainTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
@Deprecated
public void shouldNotContainTextInElement(org.openqa.selenium.WebElement webElement,
String textValue)
public void typeInto(org.openqa.selenium.WebElement field,
String value)
public PageObject.FieldEntry enter(String value)
public void selectFromDropdown(org.openqa.selenium.WebElement dropdown,
String visibleLabel)
public void selectMultipleItemsFromDropdown(org.openqa.selenium.WebElement dropdown,
String... selectedLabels)
public Set<String> getSelectedOptionLabelsFrom(org.openqa.selenium.WebElement dropdown)
public Set<String> getSelectedOptionValuesFrom(org.openqa.selenium.WebElement dropdown)
public String getSelectedValueFrom(org.openqa.selenium.WebElement dropdown)
public String getSelectedLabelFrom(org.openqa.selenium.WebElement dropdown)
public void setCheckbox(org.openqa.selenium.WebElement field,
boolean value)
public boolean containsText(String textValue)
public boolean containsAllText(String... textValues)
public void shouldBeVisible(org.openqa.selenium.WebElement field)
public void shouldBeVisible(org.openqa.selenium.By byCriteria)
public void shouldNotBeVisible(org.openqa.selenium.WebElement field)
public void shouldNotBeVisible(org.openqa.selenium.By byCriteria)
public long waitForTimeoutInMilliseconds()
public String updateUrlWithBaseUrlIfDefined(String startingUrl)
public final void open(String... parameterValues)
public final void openUnchecked(String... parameterValues)
#open(String...)) otherwise.
public final void open(String urlTemplateName,
String[] parameterValues)
public final void openUnchecked(String urlTemplateName,
String[] parameterValues)
open(String, String[]) otherwise.
public final void open()
public final void openUnchecked()
open() otherwise.
public void shouldBeDisplayed()
public final void openAt(String startingUrl)
public void callWhenPageOpensMethods()
public static String[] withParameters(String... parameterValues)
public void clickOn(org.openqa.selenium.WebElement webElement)
public Boolean isElementVisible(org.openqa.selenium.By byCriteria)
public void setDefaultBaseUrl(String defaultBaseUrl)
public boolean hasFocus(org.openqa.selenium.WebElement webElement)
public void blurActiveElement()
protected JavascriptExecutorFacade getJavascriptExecutorFacade()
public WebElementFacade element(org.openqa.selenium.WebElement webElement)
public WebElementFacade $(org.openqa.selenium.WebElement webElement)
public WebElementFacade $(String xpathOrCssSelector)
public WebElementFacade element(org.openqa.selenium.By bySelector)
public WebElementFacade find(org.openqa.selenium.By selector)
public List<WebElementFacade> findAll(org.openqa.selenium.By bySelector)
public WebElementFacade element(String xpathOrCssSelector)
public WebElementFacade findBy(String xpathOrCssSelector)
public List<WebElementFacade> findAll(String xpathOrCssSelector)
public static boolean isXPath(String xpathExpression)
public Object evaluateJavascript(String script)
public Object evaluateJavascript(String script,
Object... params)
public void addJQuerySupport()
public ThucydidesFluentWait<org.openqa.selenium.WebDriver> waitForWithRefresh()
public ThucydidesFluentWait<org.openqa.selenium.WebDriver> waitForCondition()
public org.openqa.selenium.Alert getAlert()
public org.openqa.selenium.interactions.Actions withAction()
protected ThucydidesFluentAdapter fluent()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||