Block
class Block extends AbstractPart implements IBlock (View source)
All BEM block classes must be descendants of this class.
Properties
private string | $_name | Name of the BEM part. | from AbstractPart |
private NodeElement[] | $_nodes | Elements, associated with this block. | |
private BEMElementLocator | $_locator | Locator. |
Methods
__construct(string $name, array $nodes, IPageFactory $page_factory, BEMElementLocator $locator)
Create instance of BEM block.
Expectation
shouldReceive(string $name)
No description
NodeElement[]
getNodes()
Returns block nodes.
NodeElement[]|null
getElement(string $element_name, string $modificator_name = null, string $modificator_value = null)
Returns first block element.
NodeElement[]
getElements(string $element_name, string $modificator_name = null, string $modificator_value = null)
Returns all block elements.
NodeElement|null
find(string $selector, string|array $locator)
Finds first element with specified selector.
NodeElement[]
findAll(string $selector, string|array $locator)
Finds all elements with specified selector.
mixed
waitFor(integer $timeout, callable $callback)
Waits for an element(-s) to appear and returns it.
Details
at line 48
final
__construct(string $name, array $nodes, IPageFactory $page_factory, BEMElementLocator $locator)
Create instance of BEM block.
in AbstractPart at line 44
string
getName()
Returns element name.
at line 23
Expectation
shouldReceive(string $name)
at line 63
NodeElement[]
getNodes()
Returns block nodes.
at line 77
NodeElement[]|null
getElement(string $element_name, string $modificator_name = null, string $modificator_value = null)
Returns first block element.
at line 93
NodeElement[]
getElements(string $element_name, string $modificator_name = null, string $modificator_value = null)
Returns all block elements.
at line 113
NodeElement|null
find(string $selector, string|array $locator)
Finds first element with specified selector.
at line 128
NodeElement[]
findAll(string $selector, string|array $locator)
Finds all elements with specified selector.
at line 149
mixed
waitFor(integer $timeout, callable $callback)
Waits for an element(-s) to appear and returns it.