AbstractElementContainer
class AbstractElementContainer extends AbstractTypifiedElement implements IElementContainer (View source)
The base class to be used for making blocks of elements on top of a typified element.
To make a class that will represent a block of elements (e.g. web form) create a descendant of this class.
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. | from AbstractTypifiedElement |
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.
Finds all elements with specified selector.
Finds first element with specified selector.
Waits for an element(-s) to appear and returns it.
Details
at line 34
__construct(WebElement $wrapped_element, IPageFactory $page_factory)
Specifies wrapped WebElement.
at line 50
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 65
NodeElement[]
findAll(string $selector, string|array $locator)
Finds all elements with specified selector.
at line 78
NodeElement|null
find(string $selector, string|array $locator)
Finds first element with specified selector.
at line 92
mixed
waitFor(integer $timeout, callable $callback)
Waits for an element(-s) to appear and returns it.