예제 #1
0
파일: Page.php 프로젝트: qa-tools/qa-tools
 /**
  * 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));
 }
예제 #3
0
 /**
  * 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));
 }
예제 #4
0
 /**
  * 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();
 }
예제 #5
0
 /**
  * Checks, that Selenium driver is used.
  *
  * @return boolean
  */
 protected function isSeleniumDriver()
 {
     return is_a($this->_pageFactory->getSession()->getDriver(), '\\Behat\\Mink\\Driver\\Selenium2Driver');
 }