/** * Opens this page in browser. * * @param array $params Page parameters. * * @return self * @throws PageException When page url not specified. */ public function open(array $params = array()) { $url = $this->getAbsoluteUrl($params); if (!$url) { throw new PageException('Page url not specified', PageException::TYPE_EMPTY_URL); } $this->pageFactory->getSession()->visit($url); return $this; }
/** * 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)); }
/** * Initialize the page. * * @param IPageFactory $page_factory Page factory. */ public function __construct(IPageFactory $page_factory) { parent::__construct($page_factory->getSession()); $this->pageFactory = $page_factory; $this->pageFactory->initPage($this)->initElements($this, $this->pageFactory->createDecorator($this)); }
/** * Returns element session. * * @return Session * @deprecated Accessing the session from the element is deprecated as of 1.2 and will be impossible in 2.0. */ public function getSession() { @trigger_error(sprintf('The method %s is deprecated as of 1.2 and will be removed in 2.0', __METHOD__), E_USER_DEPRECATED); return $this->_pageFactory->getSession(); }
/** * Checks, that Selenium driver is used. * * @return boolean */ protected function isSeleniumDriver() { return is_a($this->_pageFactory->getSession()->getDriver(), '\\Behat\\Mink\\Driver\\Selenium2Driver'); }