net.thucydides.core.pages
Interface WebElementState

Package class diagram package WebElementState
All Known Subinterfaces:
WebElementFacade
All Known Implementing Classes:
WebElementFacadeImpl

public interface WebElementState

This interface is a way of presenting state information about a web element without exposing (too much) of the WebDriver API.


Method Summary
 boolean containsOnlyText(String value)
          Does this element exactly match given text?
 boolean containsSelectOption(String value)
          Does this dropdown contain the specified value.
 boolean containsText(String value)
          Does this element contain a given text?
 String getSelectedValue()
           
 String getSelectedVisibleTextValue()
           
 String getTextValue()
           
 boolean hasFocus()
          Does this element currently have the focus.
 boolean isCurrentlyEnabled()
           
 boolean isCurrentlyVisible()
          Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all.
 boolean isEnabled()
           
 boolean isPresent()
           
 boolean isSelected()
           
 boolean isVisible()
          Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all.
 void shouldBeCurrentlyVisible()
          Checks whether a web element is visible.
 void shouldBeEnabled()
           
 void shouldBePresent()
           
 void shouldBeVisible()
          Checks whether a web element is visible.
 void shouldContainOnlyText(String textValue)
          Check that an element exactly matches a text value
 void shouldContainSelectedOption(String textValue)
           
 void shouldContainText(String textValue)
          Check that an element contains a text value
 void shouldNotBeCurrentlyVisible()
          Checks whether a web element is not visible straight away.
 void shouldNotBeEnabled()
           
 void shouldNotBePresent()
           
 void shouldNotBeVisible()
          Checks whether a web element is not visible.
 void shouldNotContainText(String textValue)
          Check that an element does not contain a text value
 

Method Detail

isVisible

boolean isVisible()
Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all. If the element is not visible, the method will wait a bit to see if it appears later on.


isCurrentlyVisible

boolean isCurrentlyVisible()
Is this web element present and visible on the screen This method will not throw an exception if the element is not on the screen at all. The method will fail immediately if the element is not visible on the screen. There is a little black magic going on here - the web element class will detect if it is being called by a method called "isCurrently*" and, if so, fail immediately without waiting as it would normally do.


isCurrentlyEnabled

boolean isCurrentlyEnabled()

shouldBeVisible

void shouldBeVisible()
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.


shouldBeCurrentlyVisible

void shouldBeCurrentlyVisible()
Checks whether a web element is visible. Throws an AssertionError if the element is not rendered.


shouldNotBeVisible

void shouldNotBeVisible()
Checks whether a web element is not visible. Throws an AssertionError if the element is not rendered.


shouldNotBeCurrentlyVisible

void shouldNotBeCurrentlyVisible()
Checks whether a web element is not visible straight away. Throws an AssertionError if the element is not rendered.


hasFocus

boolean hasFocus()
Does this element currently have the focus.


containsText

boolean containsText(String value)
Does this element contain a given text?


containsOnlyText

boolean containsOnlyText(String value)
Does this element exactly match given text?


containsSelectOption

boolean containsSelectOption(String value)
Does this dropdown contain the specified value.


shouldContainText

void shouldContainText(String textValue)
Check that an element contains a text value

Parameters:
textValue -

shouldContainOnlyText

void shouldContainOnlyText(String textValue)
Check that an element exactly matches a text value

Parameters:
textValue -

shouldContainSelectedOption

void shouldContainSelectedOption(String textValue)

shouldNotContainText

void shouldNotContainText(String textValue)
Check that an element does not contain a text value

Parameters:
textValue -

shouldBeEnabled

void shouldBeEnabled()

isEnabled

boolean isEnabled()

shouldNotBeEnabled

void shouldNotBeEnabled()

getSelectedVisibleTextValue

String getSelectedVisibleTextValue()

getSelectedValue

String getSelectedValue()

isPresent

boolean isPresent()

shouldBePresent

void shouldBePresent()

shouldNotBePresent

void shouldNotBePresent()

isSelected

boolean isSelected()

getTextValue

String getTextValue()


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.