|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.functest.framework.locator.AbstractLocator
public abstract class AbstractLocator
A base class to derive Locator
s from
Nested Class Summary | |
---|---|
protected static interface |
AbstractLocator.LocatorTextOperation
|
Field Summary | |
---|---|
protected Node[] |
nodes
|
protected com.meterware.httpunit.WebResponse |
originalWebResponse
|
protected net.sourceforge.jwebunit.WebTester |
tester
|
Constructor Summary | |
---|---|
protected |
AbstractLocator()
|
protected |
AbstractLocator(net.sourceforge.jwebunit.WebTester tester)
|
Method Summary | |
---|---|
Iterable<LocatorEntry> |
allMatches()
Get all matches of this locator as an iterable collection of locatore entries |
protected Node |
betterNode(Node node)
|
protected static boolean |
containsNode(Locator locator,
Node node)
|
boolean |
exists()
Return true at least one element will be matches by this locator. |
protected Document |
getDOM(net.sourceforge.jwebunit.WebTester tester)
Returns the DOM Document from the WebTester. |
String |
getHTML()
Returns the HTML that a called to Locator.getNodes() represent, including the top level nodes themselves. |
String |
getHTML(Node node)
Returns the HTML of the specified node. |
Node |
getNode()
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. |
protected String |
getNodesTextImpl(Node[] nodes,
AbstractLocator.LocatorTextOperation textOperation)
Called to get all the text or HTML of a set of Node 's. |
protected String |
getNodeTextImpl(Node node,
AbstractLocator.LocatorTextOperation textOperation)
Called to get the test or HTML of an Node |
String |
getRawText()
Returns the combined raw text of the Nodes that getNodes() would return or empty string. |
String |
getRawText(Node node)
Returns the raw text of the specified Node. |
String |
getText()
Returns the combined collapsed text of the Nodes that getNodes() would return or empty string. |
String |
getText(Node node)
Returns the collapsed text of the specified Node. |
protected com.meterware.httpunit.WebResponse |
getWebResponse(net.sourceforge.jwebunit.WebTester tester)
|
boolean |
hasNodes()
This will return true if the Locator found some Node 's. |
Iterator<LocatorEntry> |
iterator()
This will return a Iterator that returns LocatorEntry objects |
protected String |
toStringImpl(String concreteImplementationName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.atlassian.jira.functest.framework.locator.Locator |
---|
getNodes, toString |
Field Detail |
---|
protected net.sourceforge.jwebunit.WebTester tester
protected com.meterware.httpunit.WebResponse originalWebResponse
protected Node[] nodes
Constructor Detail |
---|
protected AbstractLocator()
protected AbstractLocator(net.sourceforge.jwebunit.WebTester tester)
Method Detail |
---|
protected Node betterNode(Node node)
public boolean exists()
Locator
exists
in interface Locator
public Node getNode()
Locator
getNode
in interface Locator
public Iterator<LocatorEntry> iterator()
Locator
Iterator
that returns LocatorEntry
objects
iterator
in interface Locator
Iterator
that returns LocatorEntry
objectspublic Iterable<LocatorEntry> allMatches()
Locator
allMatches
in interface Locator
public boolean hasNodes()
Locator
Node
's. This is really a convenience method
for getNodes().length > 0
hasNodes
in interface Locator
protected Document getDOM(net.sourceforge.jwebunit.WebTester tester)
tester
- the WebTester in play
public String getText()
Locator
getNodes()
would return or empty string.
NOTE : This text is the "COLLAPSED" text of the nodes, that is all the child Text
nodes
smooshed together to removed repeating whitespace.
getText
in interface Locator
public String getText(Node node)
Locator
getNodes()
would return.
NOTE : This text is the "COLLAPSED" text of the node, that is all the child Text
nodes
smooshed together to removed repeating whitespace.
getText
in interface Locator
node
- the node that we previously returned by a call to getNodes()
public String getRawText()
Locator
getNodes()
would return or empty string.
NOTE : This text is the "RAW" text of the nodes, that is all the child Text
nodes
appended together with not whitespace removal at all.
getRawText
in interface Locator
public String getRawText(Node node)
Locator
getNodes()
would return.
NOTE : This text is the "RAW" text of the node, that is all the child Text
nodes
appended together with not whitespace removal at all.
getRawText
in interface Locator
node
- the node that we previously returned by a call to getNodes()
public String getHTML()
Locator
Locator.getNodes()
represent, including the top level nodes themselves.
getHTML
in interface Locator
public String getHTML(Node node)
Locator
getNodes()
would return.
getHTML
in interface Locator
node
- the node that we previously returned by a call to getNodes()
protected String getNodeTextImpl(Node node, AbstractLocator.LocatorTextOperation textOperation)
Node
node
- the NodetextOperation
- the type of text operation
protected String getNodesTextImpl(Node[] nodes, AbstractLocator.LocatorTextOperation textOperation)
Node
's. Makes a call
to AbstractLocator#getNodeHtmlImpl for each node and appends it.
nodes
- the Nodes to get text fortextOperation
- the type of text operation
protected static boolean containsNode(Locator locator, Node node)
protected com.meterware.httpunit.WebResponse getWebResponse(net.sourceforge.jwebunit.WebTester tester)
protected String toStringImpl(String concreteImplementationName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |