BEMPropertyDecorator
class BEMPropertyDecorator extends DefaultPropertyDecorator (View source)
Default decorator for use with PageFactory. Will decorate 1) all of the
WebElement fields and 2) List
Properties
protected IElementLocatorFactory | $locatorFactory | Locator factory. | from DefaultPropertyDecorator |
protected IPageFactory | $pageFactory | Page factory. | from DefaultPropertyDecorator |
protected array | $elementToProxyMapping | Mapping between element classes, that factory supports and how to proxy them. | from DefaultPropertyDecorator |
private string | $_blockInterface | BEM block interface. | |
private string | $_elementInterface | BEM element interface. |
Methods
Creates decorator instance.
Returns proxy class, that can be used alongside with element class of a property.
Ensures that 2 given classes has a relation.
No description
Verifies, that annotations are being correctly used.
Details
at line 56
__construct(IElementLocatorFactory $locator_factory, IPageFactory $page_factory)
Creates decorator instance.
IProxy
decorate(Property $property)
This method is called by PageFactory on all properties to decide how to decorate the property.
protected boolean
canDecorate(Property $property)
Checks if a property can be decorated.
at line 72
protected IProxy|null
doDecorate(Property $property, IElementLocator $locator)
Perform actual decoration.
protected string
getProxyClass(Property $property)
Returns proxy class, that can be used alongside with element class of a property.
protected boolean
classMatches(string $class_name, string $descendant_of)
Ensures that 2 given classes has a relation.
at line 33
Expectation
shouldReceive(string $name)
at line 108
private boolean
_isBEMBlock(Property $property)
Checks, that given class is BEM Block or it's descendant.
at line 120
private boolean
_isBEMElement(Property $property)
Checks, that given class is BEM Element or it's descendant.
at line 134
private void
_assertAnnotationUsage(array $annotations, IElementLocator $locator)
Verifies, that annotations are being correctly used.