/** * Initializes html element. * * @param array $selenium_selector Element selector. * @param IPageFactory $page_factory Page factory. */ public function __construct(array $selenium_selector, IPageFactory $page_factory) { parent::__construct($selenium_selector, $page_factory->getSession()); $this->_pageFactory = $page_factory; $this->_pageFactory->initElementContainer($this); $this->_pageFactory->initElements($this, $this->_pageFactory->createDecorator($this)); }
/** * Specifies wrapped WebElement. * * @param WebElement $wrapped_element Element to be wrapped. * @param IPageFactory $page_factory Page factory. */ public function __construct(WebElement $wrapped_element, IPageFactory $page_factory) { parent::__construct($wrapped_element); $this->_pageFactory = $page_factory; $this->_pageFactory->initElementContainer($this); $this->_pageFactory->initElements($this, $page_factory->createDecorator($this)); }
/** * Create instance of BEM block. * * @param string $name Block name. * @param array|NodeElement[] $nodes Nodes associated with this block. * @param IPageFactory $page_factory Page factory. * @param BEMElementLocator $locator Locator. */ public final function __construct($name, array $nodes, IPageFactory $page_factory, BEMElementLocator $locator) { parent::__construct($name); $this->_nodes = $nodes; $this->_locator = $locator; $page_factory->initElements($this, $page_factory->createDecorator($this)); }