com.atlassian.selenium
Class SeleniumChecks

java.lang.Object
  extended by com.atlassian.selenium.SeleniumChecks

public class SeleniumChecks
extends Object


Constructor Summary
SeleniumChecks(com.thoughtworks.selenium.Selenium client, SeleniumConfiguration config)
           
 
Method Summary
 boolean attributeContainsValue(PageElement element, String attribute, String value)
           
 boolean attributeContainsValue(String locator, String attribute, String value)
          Asserts that the element given by the locator has an attribute which contains the required value.
 boolean attributeDoesntContainValue(PageElement element, String attribute, String value)
           
 boolean 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.
 boolean byTimeout(Condition condition)
           
 boolean byTimeout(Condition condition, long maxWaitTime)
           
 boolean elementContainsText(PageElement element, String text)
           
 boolean elementContainsText(String locator, String text)
          Asserts that an element contains the given text.
 boolean elementDoesNotContainText(PageElement element, String text)
           
 boolean elementDoesNotContainText(String locator, String text)
          Asserts that an element does not contain the given text.
 boolean elementDoesntHaveText(PageElement element, String text)
           
 boolean elementDoesntHaveText(String locator, String text)
          Asserts that the element specified by the locator does not contain the specified text
 boolean elementHasText(PageElement element, String text)
           
 boolean elementHasText(String locator, String text)
          Asserts that the element specified by the locator contains the specified text
 boolean elementNotPresent(PageElement element)
           
 boolean elementNotPresent(String locator)
          Asserts that a given element is not present on the current page
 boolean elementNotPresentByTimeout(PageElement element)
           
 boolean elementNotPresentByTimeout(PageElement element, long maxMillis)
           
 boolean elementNotPresentByTimeout(String locator)
           
 boolean elementNotPresentByTimeout(String locator, long maxMillis)
          This will wait until an element is not present.
 boolean elementNotPresentUntilTimeout(PageElement element)
           
 boolean elementNotPresentUntilTimeout(PageElement element, long maxMillis)
           
 boolean elementNotPresentUntilTimeout(String locator)
           
 boolean elementNotPresentUntilTimeout(String locator, long maxMillis)
           
 boolean elementNotVisible(PageElement element)
           
 boolean elementNotVisible(String locator)
          Asserts that a given element is not present and visible.
 boolean elementPresent(PageElement element)
           
 boolean elementPresent(String locator)
          Asserts that a given element is present
 boolean elementPresentByTimeout(PageElement element)
           
 boolean elementPresentByTimeout(PageElement element, long maxMillis)
           
 boolean elementPresentByTimeout(String locator)
           
 boolean elementPresentByTimeout(String locator, long maxMillis)
           
 boolean elementPresentUntilTimeout(PageElement element)
           
 boolean elementPresentUntilTimeout(PageElement element, long maxMillis)
           
 boolean elementPresentUntilTimeout(String locator)
           
 boolean elementPresentUntilTimeout(String locator, long maxMillis)
           
 boolean elementsSameHeight(PageElement element1, PageElement element2, int deltaPixels)
           
 boolean elementsSameHeight(String locator1, String locator2, int deltaPixels)
           
 boolean elementsVerticallyAligned(PageElement element1, PageElement element2, int deltaPixels)
           
 boolean elementsVerticallyAligned(String locator1, String locator2, int deltaPixels)
          Asserts that two elements (located by selenium syntax) are vertically within deltaPixels of each other.
 boolean elementVisible(PageElement element)
           
 boolean elementVisible(String locator)
          Asserts that a given element is present and is visible.
 boolean elementVisibleContainsText(PageElement element, String text)
           
 boolean elementVisibleContainsText(String locator, String text)
          Asserts that a given element is visible and also contains the given text.
 boolean formElementEquals(String locator, String value)
          Asserts that a given element has a specified value
 boolean htmlNotPresent(String html)
          Asserts that a particular piece of HTML is not present in the HTML source.
 boolean htmlPresent(String html)
          Asserts that a particular piece of HTML is present in the HTML source.
 boolean linkNotPresentWithText(String text)
          Asserts that no link exists on the page containing the given text
 boolean linkPresentWithText(String text)
          Asserts that a link containing the given text appears on the page
 boolean linkVisibleWithText(String text)
          Asserts that a link containin the given text is present and visible.
 boolean notVisibleByTimeout(PageElement element)
           
 boolean notVisibleByTimeout(PageElement element, long maxMillis)
           
 boolean notVisibleByTimeout(String locator)
           
 boolean notVisibleByTimeout(String locator, long maxMillis)
           
 boolean textNotPresent(String text)
           
 boolean textNotPresentByTimeout(String text)
           
 boolean textNotPresentByTimeout(String text, long maxMillis)
           
 boolean textPresent(String text)
           
 boolean textPresentByTimeout(String text)
           
 boolean textPresentByTimeout(String text, long maxMillis)
           
 boolean untilTimeout(Condition condition)
           
 boolean untilTimeout(Condition condition, long maxWaitTime)
           
 boolean visibleByTimeout(PageElement element)
           
 boolean visibleByTimeout(PageElement element, long maxMillis)
           
 boolean visibleByTimeout(String locator)
           
 boolean visibleByTimeout(String locator, long maxMillis)
          This will wait until an element is visible.
 boolean windowClosed(String windowName)
           
 boolean windowOpen(String windowName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeleniumChecks

public SeleniumChecks(com.thoughtworks.selenium.Selenium client,
                      SeleniumConfiguration config)
Method Detail

visibleByTimeout

public boolean visibleByTimeout(String locator)

visibleByTimeout

public boolean visibleByTimeout(PageElement element)

visibleByTimeout

public boolean visibleByTimeout(String locator,
                                long maxMillis)
This will wait until an element is visible. If it doesnt become visible in maxMillis return false

Parameters:
locator - the selenium element locator
maxMillis - how long to wait as most in milliseconds

visibleByTimeout

public boolean visibleByTimeout(PageElement element,
                                long maxMillis)

notVisibleByTimeout

public boolean notVisibleByTimeout(String locator)

notVisibleByTimeout

public boolean notVisibleByTimeout(PageElement element)

notVisibleByTimeout

public boolean notVisibleByTimeout(String locator,
                                   long maxMillis)

notVisibleByTimeout

public boolean notVisibleByTimeout(PageElement element,
                                   long maxMillis)

elementPresentByTimeout

public boolean elementPresentByTimeout(String locator)

elementPresentByTimeout

public boolean elementPresentByTimeout(PageElement element)

elementPresentByTimeout

public boolean elementPresentByTimeout(String locator,
                                       long maxMillis)

elementPresentByTimeout

public boolean elementPresentByTimeout(PageElement element,
                                       long maxMillis)

elementPresentUntilTimeout

public boolean elementPresentUntilTimeout(String locator)

elementPresentUntilTimeout

public boolean elementPresentUntilTimeout(PageElement element)

elementPresentUntilTimeout

public boolean elementPresentUntilTimeout(String locator,
                                          long maxMillis)

elementPresentUntilTimeout

public boolean elementPresentUntilTimeout(PageElement element,
                                          long maxMillis)

elementNotPresentByTimeout

public boolean elementNotPresentByTimeout(String locator)

elementNotPresentByTimeout

public boolean elementNotPresentByTimeout(PageElement element)

elementNotPresentUntilTimeout

public boolean elementNotPresentUntilTimeout(String locator)

elementNotPresentUntilTimeout

public boolean elementNotPresentUntilTimeout(PageElement element)

elementNotPresentUntilTimeout

public boolean elementNotPresentUntilTimeout(String locator,
                                             long maxMillis)

elementNotPresentUntilTimeout

public boolean elementNotPresentUntilTimeout(PageElement element,
                                             long maxMillis)

textPresentByTimeout

public boolean textPresentByTimeout(String text,
                                    long maxMillis)

textPresentByTimeout

public boolean textPresentByTimeout(String text)

textNotPresentByTimeout

public boolean textNotPresentByTimeout(String text,
                                       long maxMillis)

textNotPresentByTimeout

public boolean textNotPresentByTimeout(String text)

elementNotPresentByTimeout

public boolean elementNotPresentByTimeout(String locator,
                                          long maxMillis)
This will wait until an element is not present. If it doesnt become not present in maxMillis

Parameters:
locator - the selenium element locator
maxMillis - how long to wait as most in milliseconds

elementNotPresentByTimeout

public boolean elementNotPresentByTimeout(PageElement element,
                                          long maxMillis)

byTimeout

public boolean byTimeout(Condition condition)

byTimeout

public boolean byTimeout(Condition condition,
                         long maxWaitTime)

untilTimeout

public boolean untilTimeout(Condition condition)

untilTimeout

public boolean untilTimeout(Condition condition,
                            long maxWaitTime)

textPresent

public boolean textPresent(String text)
Parameters:
text - Asserts that text is present in the current page

textNotPresent

public boolean textNotPresent(String text)
Parameters:
text - Asserts that text is not present in the current page

formElementEquals

public boolean formElementEquals(String locator,
                                 String value)
Asserts that a given element has a specified value

Parameters:
locator - Locator for element using the standard selenium locator syntax
value - The value the element is expected to contain

elementPresent

public boolean elementPresent(String locator)
Asserts that a given element is present

Parameters:
locator - Locator for the element that should be present given using the standard selenium locator syntax

elementPresent

public boolean elementPresent(PageElement element)

elementNotPresent

public boolean elementNotPresent(String locator)
Asserts that a given element is not present on the current page

Parameters:
locator - Locator for the element that should not be present given using the standard selenium locator syntax

elementNotPresent

public boolean elementNotPresent(PageElement element)

elementVisible

public boolean elementVisible(String locator)
Asserts that a given element is present and is visible. Under some browsers just calling the seleinium.isVisible method on an element that doesn't exist causes selenium to throw an exception.

Parameters:
locator - Locator for the element that should be visible specified in the standard selenium syntax

elementVisible

public boolean elementVisible(PageElement element)

elementNotVisible

public boolean elementNotVisible(String locator)
Asserts that a given element is not present and visible. Calling selenium's native selenium.isVisible method on an element that doesn't exist causes selenium to throw an exception

Parameters:
locator - Locator for the element that should not be visible specified in the standard selenium syntax

elementNotVisible

public boolean elementNotVisible(PageElement element)

elementVisibleContainsText

public boolean elementVisibleContainsText(String locator,
                                          String text)
Asserts that a given element is visible and also contains the given text.

Parameters:
locator - Locator for the element that should be visible specified in the standard selenium syntax
text - the text that the element should contain

elementVisibleContainsText

public boolean elementVisibleContainsText(PageElement element,
                                          String text)

htmlPresent

public boolean htmlPresent(String html)
Asserts that a particular piece of HTML is present in the HTML source. It is recommended that the elementPresent, elementHasText or some other method be used because browsers idiosyncratically add white space to the HTML source

Parameters:
html - Lower case representation of HTML string that should not be present

htmlNotPresent

public boolean htmlNotPresent(String html)
Asserts that a particular piece of HTML is not present in the HTML source. It is recommended that the elementNotPresent, elementDoesntHaveText or some other method be used because browsers idiosyncratically add white space to the HTML source

Parameters:
html - Lower case representation of HTML string that should not be present

elementHasText

public boolean elementHasText(String locator,
                              String text)
Asserts that the element specified by the locator contains the specified text

Parameters:
locator - Locator given in standard selenium syntax
text - The text that the element designated by the locator should contain

elementHasText

public boolean elementHasText(PageElement element,
                              String text)

elementDoesntHaveText

public boolean elementDoesntHaveText(String locator,
                                     String text)
Asserts that the element specified by the locator does not contain the specified text

Parameters:
locator - Locator given in standard selenium syntax
text - The text that the element designated by the locator should not contain

elementDoesntHaveText

public boolean elementDoesntHaveText(PageElement element,
                                     String text)

attributeContainsValue

public boolean attributeContainsValue(String locator,
                                      String attribute,
                                      String value)
Asserts that the element given by the locator has an attribute which contains the required value.

Parameters:
locator - Locator given in standard selenium syntax
attribute - The element attribute
value - The value expected to be found in the element's attribute

attributeContainsValue

public boolean attributeContainsValue(PageElement element,
                                      String attribute,
                                      String value)

attributeDoesntContainValue

public boolean 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.

Parameters:
locator - Locator given in standard selenium syntax
attribute - The element attribute
value - The value expected to be found in the element's attribute

attributeDoesntContainValue

public boolean attributeDoesntContainValue(PageElement element,
                                           String attribute,
                                           String value)

linkPresentWithText

public boolean linkPresentWithText(String text)
Asserts that a link containing the given text appears on the page

Parameters:
text - The text that a link on the page should contain
See Also:
also

linkNotPresentWithText

public boolean linkNotPresentWithText(String text)
Asserts that no link exists on the page containing the given text

Parameters:
text - The text that no link on the page should contain

linkVisibleWithText

public boolean linkVisibleWithText(String text)
Asserts that a link containin the given text is present and visible.

Parameters:
text - The text that a link on the page should contain

elementsVerticallyAligned

public boolean elementsVerticallyAligned(String locator1,
                                         String locator2,
                                         int deltaPixels)
Asserts that two elements (located by selenium syntax) are vertically within deltaPixels of each other.

Parameters:
locator1 - Locator for element 1 given in standard selenium syntax
locator2 - Locator for element 2 given in standard selenium syntax
deltaPixels - The maximum allowable distance between the two element

elementsVerticallyAligned

public boolean elementsVerticallyAligned(PageElement element1,
                                         PageElement element2,
                                         int deltaPixels)

elementsSameHeight

public boolean elementsSameHeight(String locator1,
                                  String locator2,
                                  int deltaPixels)

elementsSameHeight

public boolean elementsSameHeight(PageElement element1,
                                  PageElement element2,
                                  int deltaPixels)

elementContainsText

public boolean elementContainsText(String locator,
                                   String text)
Asserts that an element contains the given text.


elementContainsText

public boolean elementContainsText(PageElement element,
                                   String text)

elementDoesNotContainText

public boolean elementDoesNotContainText(String locator,
                                         String text)
Asserts that an element does not contain the given text.


elementDoesNotContainText

public boolean elementDoesNotContainText(PageElement element,
                                         String text)

windowClosed

public boolean windowClosed(String windowName)

windowOpen

public boolean windowOpen(String windowName)


Copyright © 2014 Atlassian. All rights reserved.