com.atlassian.pageobjects.elements
Class WebDriverTimedElement

java.lang.Object
  extended by com.atlassian.pageobjects.elements.WebDriverTimedElement
All Implemented Interfaces:
TimedElement

public class WebDriverTimedElement
extends Object
implements TimedElement

Implementation of TimedElement based on WebDriver


Constructor Summary
WebDriverTimedElement(WebDriverLocatable locatable, TimeoutType defaultTimeout)
          Create a WebDriverTimedElement with the given timeout.
 
Method Summary
 TimedQuery<String> getAttribute(String name)
          Query representing the element's given attribute.
 TimedQuery<org.openqa.selenium.Point> getLocation()
          Timed query representing the location of the element on the page.
 TimedQuery<org.openqa.selenium.Dimension> getSize()
          Timed query representing the dimension of the element.
 TimedQuery<String> getTagName()
          Query representing the element's tag name
 TimedQuery<String> getText()
          Query representing the element's inner text.
 TimedQuery<String> getValue()
          Query representing the element's 'value' attribute
 TimedCondition hasAttribute(String name, String value)
          Query representing whether this element has the given attribute set
 TimedCondition hasClass(String className)
          Query representing whether this element has the given classname set.
 TimedCondition hasText(String text)
          Query representing whether this element's innerText is equal to the provided string.
 TimedCondition hasValue(String value)
          Query representing whether this element's value attribute is equal to the provided string.
 void initialize()
           
 TimedCondition isEnabled()
          Query representing whether this element is enabled on a page.
 TimedCondition isPresent()
          Query representing the existence of this element on a page.
 TimedCondition isSelected()
          Query representing whether this element is selected on a page.
 TimedCondition isVisible()
          Query representing visibility of this element on a page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverTimedElement

public WebDriverTimedElement(WebDriverLocatable locatable,
                             TimeoutType defaultTimeout)
Create a WebDriverTimedElement with the given timeout.

Parameters:
locatable - locatable for the target element
defaultTimeout - default timeout of this element
Method Detail

initialize

public void initialize()

isPresent

public TimedCondition isPresent()
Description copied from interface: TimedElement
Query representing the existence of this element on a page.

Specified by:
isPresent in interface TimedElement
Returns:
TimedQuery that true if element is present on the page, false if element is not visible or timeout expires.

isVisible

public TimedCondition isVisible()
Description copied from interface: TimedElement
Query representing visibility of this element on a page.

Specified by:
isVisible in interface TimedElement
Returns:
TimedQuery that returns true if element is visible on the page, false if element is not visible or timeout expires.

isEnabled

public TimedCondition isEnabled()
Description copied from interface: TimedElement
Query representing whether this element is enabled on a page.

Specified by:
isEnabled in interface TimedElement
Returns:
TimedQuery that returns true if element is enabled on the page, false if element is disabled or timeout expires.

isSelected

public TimedCondition isSelected()
Description copied from interface: TimedElement
Query representing whether this element is selected on a page.

Specified by:
isSelected in interface TimedElement
Returns:
TimedQuery that returns true if element is selected on the page, false if element is not selected or timeout expires.

hasClass

public TimedCondition hasClass(String className)
Description copied from interface: TimedElement
Query representing whether this element has the given classname set.

Specified by:
hasClass in interface TimedElement
Parameters:
className - The name of the class to check
Returns:
TimedQuery that returns true if element has given classname set, false if element does not have the given classname set or timeout expires.

getAttribute

public TimedQuery<String> getAttribute(String name)
Description copied from interface: TimedElement
Query representing the element's given attribute.

Specified by:
getAttribute in interface TimedElement
Parameters:
name - Name of the attribute
Returns:
TimedQuery that returns the value of the given attribute, null if element does not have given attribute or timeout expires.

hasAttribute

public TimedCondition hasAttribute(String name,
                                   String value)
Description copied from interface: TimedElement
Query representing whether this element has the given attribute set

Specified by:
hasAttribute in interface TimedElement
Parameters:
name - Name of the attribute
value - expected attribute value
Returns:
TimedQuery that returns true if element has given attribute set, false if element does not have the given attribute set or timeout expires

getText

public TimedQuery<String> getText()
Description copied from interface: TimedElement
Query representing the element's inner text.

Specified by:
getText in interface TimedElement
Returns:
TimedQuery that returns the inner text of the element, null if element does not have inner text or timeout expires.

hasText

public TimedCondition hasText(String text)
Description copied from interface: TimedElement
Query representing whether this element's innerText is equal to the provided string.

Specified by:
hasText in interface TimedElement
Parameters:
text - The expected innerText string
Returns:
timed condition that returns true if this element has given innerText equal to expected, false otherwise

getTagName

public TimedQuery<String> getTagName()
Description copied from interface: TimedElement
Query representing the element's tag name

Specified by:
getTagName in interface TimedElement
Returns:
TimedQuery that returns the tagname of the element

getValue

public TimedQuery<String> getValue()
Description copied from interface: TimedElement
Query representing the element's 'value' attribute

Specified by:
getValue in interface TimedElement
Returns:
TimedQuery that returns the value of the 'value' attribute, null if element does not have a 'value' attribute or timeout expires.

hasValue

public TimedCondition hasValue(String value)
Description copied from interface: TimedElement
Query representing whether this element's value attribute is equal to the provided string.

Specified by:
hasValue in interface TimedElement
Parameters:
value - The expected value attribute
Returns:
timed condition that returns true if this element has given value attribute equal to expected, false otherwise

getLocation

public TimedQuery<org.openqa.selenium.Point> getLocation()
Description copied from interface: TimedElement
Timed query representing the location of the element on the page.

Specified by:
getLocation in interface TimedElement
Returns:
query for location of the element on the page. Returns null, if the element cannot be located by given timeout

getSize

public TimedQuery<org.openqa.selenium.Dimension> getSize()
Description copied from interface: TimedElement
Timed query representing the dimension of the element.

Specified by:
getSize in interface TimedElement
Returns:
query for dimension of the element on the page. Returns null, if the element cannot be located by given timeout


Copyright © 2014 Atlassian. All rights reserved.