com.atlassian.jira.functest.framework.locator.Locator |
![]() |
A Locator
is responsible for "locating" DOM org.w3c.dom.Node's on a web page and also
getting the text of those org.w3c.dom.Node's.
You use a Locator to "narrow" down the areas of a web page you want to make assertions on. So it may be a specified
element with an id or a set of elements with specific class. Locator
's also abstract how the text is returned
for page elements. So it may include markup text or it may not, that is up to the specialised type of Locator
Locator
's should implement toString()
in a way that is meaning full when test cases fail and you want to know in what context.
NOTE : Locator
's are one shot objects. A call to getNodes() should return the same Nodes every time it is called. Even if the underlying
data source has changed (for example the WebTester page has changed) the Locator MUST return the same data.
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get all matches of this locator as an iterable collection of locator entries
| |||||||||||
Return true at least one element will be matches by this locator.
| |||||||||||
Returns the HTML that a called to
getNodes() represent, including the top level nodes themselves. | |||||||||||
Returns the HTML of the specified node.
| |||||||||||
This convenience methods is the the equivalent of getNodes()[0] except when the number of nodes
found is zero, in which case it should return null.
| |||||||||||
A
Locator may return 0 nodes, 1 node or multiple nodes. | |||||||||||
Returns the raw text of the specified Node.
| |||||||||||
Returns the combined raw text of the Nodes that
getNodes() would return or empty string. | |||||||||||
Returns the collapsed text of the specified Node.
| |||||||||||
Returns the combined collapsed text of the Nodes that
getNodes() would return or empty string. | |||||||||||
This will return true if the Locator found some org.w3c.dom.Node's.
| |||||||||||
This will return a
Iterator that returns LocatorEntry objects | |||||||||||
A meaningful "debugging" representation of this Locator to help when test fail.
|
Get all matches of this locator as an iterable collection of locator entries
Return true at least one element will be matches by this locator.
Returns the HTML that a called to getNodes()
represent, including the top level nodes themselves.
Returns the HTML of the specified node. The node MUST be one of the nodes that a call to getNodes()
would return.
node | the node that we previously returned by a call to getNodes() |
---|
This convenience methods is the the equivalent of getNodes()[0] except when the number of nodes found is zero, in which case it should return null.
A Locator
may return 0 nodes, 1 node or multiple nodes.
Returns the raw text of the specified Node. The node MUST be one of the nodes that a call to getNodes()
would return.
NOTE : This text is the "RAW" text of the node, that is all the child org.w3c.dom.Text nodes appended together with not whitespace removal at all.
node | the node that we previously returned by a call to getNodes() |
---|
IllegalArgumentException | if the node is not one that would be returned by a call to getNodes() |
---|
Returns the combined raw text of the Nodes that getNodes()
would return or empty string.
NOTE : This text is the "RAW" text of the nodes, that is all the child org.w3c.dom.Text nodes appended together with not whitespace removal at all.
RuntimeException | if something goes wrong |
---|
Returns the collapsed text of the specified Node. The node MUST be one of the nodes that a call to getNodes()
would return.
NOTE : This text is the "COLLAPSED" text of the node, that is all the child org.w3c.dom.Text nodes smooshed together to removed repeating whitespace.
node | the node that we previously returned by a call to getNodes() |
---|
IllegalArgumentException | if the node is not one that would be returned by a call to getNodes() |
---|
Returns the combined collapsed text of the Nodes that getNodes()
would return or empty string.
NOTE : This text is the "COLLAPSED" text of the nodes, that is all the child org.w3c.dom.Text nodes smooshed together to removed repeating whitespace.
RuntimeException | if something goes wrong |
---|
This will return true if the Locator found some org.w3c.dom.Node's. This is really a convenience method for getNodes().length > 0
This will return a Iterator
that returns LocatorEntry
objects
Iterator
that returns LocatorEntry
objects
A meaningful "debugging" representation of this Locator to help when test fail.