/**
  * Create session.
  *
  * @return void
  */
 protected function startSession()
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     $this->session->visit($_SERVER['WEB_FIXTURE_URL'] . '/tests/QATools/QATools/Live/PageObject/index.html');
 }
 /**
  * Create session.
  *
  * @return void
  */
 protected function startSession()
 {
     if (!$this->session->isStarted()) {
         $this->session->start();
     }
     $this->session->visit($_SERVER['WEB_FIXTURE_URL'] . '/tests/aik099/QATools/HtmlElementsLive/Element/index.html');
 }
Example #3
0
 /**
  *
  * @return array
  */
 public function shoot()
 {
     $this->_session = $this->_camera->get_session();
     // Iterate over shots
     foreach ($this->_shots as $shot) {
         /* @var $shot Shot */
         $output = $this->_shoot_shot($shot);
         $this->_log_out("Saving as " . $this->_film->get_root_folder() . $shot->get_destination_file());
         // Save output in folder
         if (empty($output)) {
             $this->_log_out("There was an error capturing this page. Please, check or retry. ");
             continue;
         }
         $saved_result = $this->_film->get_filesystem()->put($shot->get_destination_file(), $output);
         if (!$saved_result) {
             $this->_log_out("There was an error saving the screenshot. Please, check or retry. ");
             continue;
         }
         // It was successful, mark it
         $shot->set_completed(true);
     }
     // If session is open (it should) just close it
     if ($this->_session->isStarted()) {
         $this->_session->stop();
     }
     return $this->_shots;
 }
Example #4
0
 /**
  * Creates Mink session using current session strategy and returns it.
  *
  * @return Session
  */
 public function getSession()
 {
     if ($this->_session && $this->_session->isStarted()) {
         return $this->_session;
     }
     $browser = $this->getBrowser();
     try {
         $this->_session = $this->getSessionStrategy()->session($browser);
         if ($this->getCollectCodeCoverageInformation()) {
             $this->_session->visit($browser->getBaseUrl());
         }
     } catch (DriverException $e) {
         $message = 'The Selenium Server is not active on host %s at port %s';
         $this->markTestSkipped(sprintf($message, $browser->getHost(), $browser->getPort()));
     }
     return $this->_session;
 }
 public function testIsStarted()
 {
     $this->driver->expects($this->once())->method('isStarted')->will($this->returnValue(true));
     $this->assertTrue($this->session->isStarted());
 }