com.ibm.team.fvt.tests.web
Class WebExpandableElement

java.lang.Object
  extended by com.ibm.team.fvt.tests.web.WebPageElement
      extended by com.ibm.team.fvt.tests.web.WebElementWrapper
          extended by com.ibm.team.fvt.tests.web.WebExpandableElement

public class WebExpandableElement
extends WebElementWrapper

Default class to handle expandable web element in a web page.

By default the expansion mechanism of the web element is managed by its aria-expanded attribute. If the wrapped web element does not have this attribute, then a ScenarioFailedError is raised when any expand or collapse action is requested.

This class might be subclasses to override this default mechanism.


Constructor Summary
WebExpandableElement(WebPage page)
           
WebExpandableElement(WebPage page, org.openqa.selenium.By findBy)
           
WebExpandableElement(WebPage page, org.openqa.selenium.By findBy, org.openqa.selenium.By expansionBy)
           
WebExpandableElement(WebPage page, WebBrowserElement node)
           
WebExpandableElement(WebPage page, WebBrowserElement node, org.openqa.selenium.By expansionBy)
           
 
Method Summary
 void collapse()
          Expand the current web element.
 void expand()
          Expand the current web element.
 boolean isExpandable()
          Returns whether the current wrapped web element is expandable or not.
 boolean isExpanded()
          Returns whether the current wrapped web element is expanded or not.
 void setMoveAfterClick(boolean move)
          Tells whether the mouse must be moved to expansion element after having clicked on it to expand or collapse the web element.
 void toggle()
          Expand the current web element.
 
Methods inherited from class com.ibm.team.fvt.tests.web.WebElementWrapper
getText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebExpandableElement

public WebExpandableElement(WebPage page)

WebExpandableElement

public WebExpandableElement(WebPage page,
                            org.openqa.selenium.By findBy)

WebExpandableElement

public WebExpandableElement(WebPage page,
                            org.openqa.selenium.By findBy,
                            org.openqa.selenium.By expansionBy)

WebExpandableElement

public WebExpandableElement(WebPage page,
                            WebBrowserElement node)

WebExpandableElement

public WebExpandableElement(WebPage page,
                            WebBrowserElement node,
                            org.openqa.selenium.By expansionBy)
Method Detail

collapse

public void collapse()
              throws ScenarioFailedError
Expand the current web element.

If the web element is already expanded, then nothing happens.

Throws:
ScenarioFailedError - If the wrapped web element does not have the aria-expanded attribute.

expand

public void expand()
            throws ScenarioFailedError
Expand the current web element.

If the web element is already expanded, then nothing happens.

Throws:
ScenarioFailedError - If the wrapped web element does not have the aria-expanded attribute.

isExpandable

public boolean isExpandable()
                     throws ScenarioFailedError
Returns whether the current wrapped web element is expandable or not.

Returns:
true if the current node is expanda, false>/code> otherwise.
Throws:
ScenarioFailedError - If the wrapped web element does not have the aria-expanded attribute.

isExpanded

public boolean isExpanded()
                   throws ScenarioFailedError
Returns whether the current wrapped web element is expanded or not.

Returns:
true if the current node is expanded, false>/code> otherwise.
Throws:
ScenarioFailedError - If the wrapped web element does not have the aria-expanded attribute.

setMoveAfterClick

public void setMoveAfterClick(boolean move)
Tells whether the mouse must be moved to expansion element after having clicked on it to expand or collapse the web element.

Parameters:
move - true if the cursor must be moved, false otherwise.

toggle

public final void toggle()
                  throws ScenarioFailedError
Expand the current web element.

If the web element is already expanded, then nothing happens.

Throws:
ScenarioFailedError - If the wrapped web element does not have the aria-expanded attribute.