SelectOption
class SelectOption extends AbstractTypifiedElement (View source)
Represents one option in a web page select control. Please use "Select" typified element for manipulations.
Constants
CRITERION_TAG |
|
CRITERION_ATTRS |
|
Properties
private string | $_name | Name of the element. | from AbstractTypifiedElement |
private WebElement | $_wrappedElement | Wrapped element. | from AbstractTypifiedElement |
private IPageFactory | $_pageFactory | Stores instance of used page factory. | from AbstractTypifiedElement |
protected array | $acceptanceCriteria | List of acceptance criteria. | |
protected Select | $select | SELECT element. |
Methods
Creates Element instance based on existing NodeElement instance.
Checks that wrapped element meets the acceptance criteria.
Checks if the tag name(s) of the criterion are matching.
Checks if the attributes of the criterion are matching.
Checks if passed value matching the defined criterion.
Returns page factory, used during object creation.
Checks whether element has attribute with specified name.
Returns specified attribute value.
Selects option if it is not already selected.
Deselects option if it is not already deselected.
Alters option selected state.
Indicates whether checkbox is checked.
Returns value of an option.
Returns text of an option.
Details
__construct(WebElement $wrapped_element, IPageFactory $page_factory)
Specifies wrapped WebElement.
static INodeElementAware
fromNodeElement(NodeElement $node_element, IPageFactory $page_factory)
Creates Element instance based on existing NodeElement instance.
protected void
assertWrappedElement()
Checks that wrapped element meets the acceptance criteria.
protected boolean
isTagNameMatching(array $criterion)
Checks if the tag name(s) of the criterion are matching.
protected boolean
isAttributeMatching(array $criterion)
Checks if the attributes of the criterion are matching.
protected boolean
isValueMatchingCriterionDefinition(string $value, string $criterion)
Checks if passed value matching the defined criterion.
WebElement
getWrappedElement()
Returns wrapped element.
ITypifiedElement
setName(string $name)
Sets a name of an element.
This method is used by initialization mechanism and is not intended to be used directly.
string
getName()
Returns name of the entity.
Session
getSession()
deprecated
deprecated
Returns element session.
protected IPageFactory
getPageFactory()
Returns page factory, used during object creation.
boolean
isVisible()
Checks whether current node is visible on page.
boolean
isValid()
Checks if an element is still valid.
boolean
hasAttribute(string $name)
Checks whether element has attribute with specified name.
mixed|null
getAttribute(string $name)
Returns specified attribute value.
string
getXpath()
Returns XPath for handled element.
string
getTagName()
Returns current node tag name.
Escaper
getXpathEscaper()
Returns the XPath escaper.
protected boolean
isSeleniumDriver()
Checks, that Selenium driver is used.
string
__toString()
Returns string representation of element.
Expectation
shouldReceive(string $name)
at line 45
SelectOption
setSelect(Select $select)
Sets reference to parent SELECT element.
at line 60
SelectOption
select(boolean $multiple = false)
Selects option if it is not already selected.
at line 82
SelectOption
deselect()
Deselects option if it is not already deselected.
at line 105
SelectOption
toggle(boolean|null $select_or_deselect = null)
Alters option selected state.
at line 119
boolean
isSelected()
Indicates whether checkbox is checked.
at line 129
string
getValue()
Returns value of an option.
at line 139
string
getText()
Returns text of an option.