TucoTuco.Page
This module contains all the functions associated with querying the state of the current page.
You use them in tests like this:
```
assert Page.has_css? "table#fruit tr.first"
```
# About Retries
It is important to use the has_no_x
type functions if there
is Javascript running that could modify the page. You will not get
correct results if you do something like assert !has_css? "h2.foo"
,
instead you should use assert has_no_css "h2.foo"
.
Summary
has_button?(text) | Does the page have a button |
has_checked_field?(text) | Does the page have a checkbox or radio button that is checked? |
has_css?(css, options \\ []) | Does the page have an element matching the specified css selector? |
has_field?(text) | Does the page have a text field or text area with the id, name or label? |
has_link?(text) | Does the page have a link containing the specified text, id or name |
has_no_button?(text) | Does the page not have a button |
has_no_checked_field?(text) | Does the page not have a checkbox or radio button that is checked? |
has_no_css?(css) | |
has_no_field?(text) | Does the page not have a link containing the specified text, id or name |
has_no_link?(text) | Does the page not have a link containing the specified text, id or name |
has_no_select?(text) | Does the page not have a select with the given id, name or label |
has_no_selector?(using, selector) | The page has no elements matching the selector using the specified strategy |
has_no_table?(text) | Does the page not have a table with the given caption or id? |
has_no_text?(text) | Does the page not contain the text specified? |
has_no_unchecked_field?(text) | Does the page not have a checkbox or radio button that is unchecked? |
has_no_xpath?(xpath) | |
has_select?(text) | Does the page have a select with the given id, name or label |
has_selector?(using, selector, options \\ [count: nil]) | Does the page have an element matching the selector, using the strategy specified by the ‘using’ parameter |
has_table?(text) | Does the page have a table with the given caption or id? |
has_text?(text) | Does the page contain the text specified? |
has_unchecked_field?(text) | Does the page have a checkbox or radio button that is unchecked? |
has_xpath?(xpath, options \\ []) | Does the page have an element matching the xpath selector? |
is_element?(element) | |
is_not_element?(element) |
Functions
Does the page have a checkbox or radio button that is checked?
Finds by label or id.
Does the page have an element matching the specified css selector?
Options include:
* :count - Specify exactly the number of occurrences on the page of the selector
that must be found for this to be true.
Does the page have a text field or text area with the id, name or label?
Does the page have a link containing the specified text, id or name.
Does the page not have a button.
Finds by text, id or name.
Does the page not have a checkbox or radio button that is checked?
Finds by label or id.
Does the page not have a link containing the specified text, id or name.
Does the page not have a link containing the specified text, id or name.
Does the page not have a select with the given id, name or label.
The page has no elements matching the selector using the specified strategy.
Does the page not have a table with the given caption or id?
Does the page not have a checkbox or radio button that is unchecked?
Finds by label or id.
Does the page have a select with the given id, name or label.
Does the page have an element matching the selector, using the strategy specified by the ‘using’ parameter.
Using may be one of:
* :class - Search for an element with the given class attribute.
* :class_name - alias for :class
* :css - Search for an element using a CSS selector.
* :id - Find an element with the given id attribute.
* :name - Find an element with the given name attribute.
* :link - Find an link element containing the given text.
* :partial_link - Find a link element containing a superset of the given text.
* :tag - Find a HTML tag of the given type.
* :xpath - Use [XPath](http://www.w3.org/TR/xpath/) to search for an element.
Options include:
* :count - Specify exactly the number of occurrences on the page of the selector
that must be found for this to be true.
Does the page have a checkbox or radio button that is unchecked?
Finds by label or id.
Does the page have an element matching the xpath selector?
Options include:
* :count - Specify exactly the number of occurrences on the page of the selector
that must be found for this to be true.