コード例 #1
0
 /**
  * @param null|string $save_as
  * @return string
  * @throws WebDriverException
  */
 public function takeScreenshot($save_as = null)
 {
     try {
         return $this->driver->takeScreenshot($save_as);
     } catch (WebDriverException $exception) {
         $this->dispatchOnException($exception);
     }
 }
コード例 #2
0
 public function screenshot(WebDriver $webDriver, $case = 'undefined')
 {
     $this->_createScreenShotDirIfNotExists();
     $screenName = date('d|m|y|H|i|s') . '|' . $case . '.png';
     file_put_contents($this->screenshotDir . DIRECTORY_SEPARATOR . $screenName, $webDriver->takeScreenshot());
     $buildNumber = $this->suiteSettings->getBuildNumber();
     $buildNumberPath = $buildNumber !== '' ? $buildNumber . DIRECTORY_SEPARATOR : '';
     $loggingDirectoryName = $this->suiteSettings->getLoggingDirectoryName();
     $loggingDirectoryNamePath = $loggingDirectoryName !== '' ? $loggingDirectoryName . DIRECTORY_SEPARATOR : '';
     return rtrim($buildNumberPath . $loggingDirectoryNamePath, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'screenshots' . DIRECTORY_SEPARATOR . $screenName;
 }
コード例 #3
0
ファイル: Navigator.php プロジェクト: cargomedia/webnavigator
 /**
  * @param string $path
  */
 public function takeScreenshot($path)
 {
     $this->_webDriver->takeScreenshot($path);
 }
コード例 #4
0
ファイル: Client.php プロジェクト: exfriend/skypium
 public function screenshot($name)
 {
     $this->driver->takeScreenshot($this->screenshot_folder . DIRECTORY_SEPARATOR . $name . '.png');
 }