/** * Returns an array with values for the suite log entry. * * @param false|bool $update (Optional) Values for insert or update statement? * @param bool $error (Optional) Sets instead of the pending value(0) the error status (2) * * @return array */ protected function _getSuiteValuesArray($update = false, $error = false) { if ($update) { return [$this->testSuite->isFailed() ? 2 : 1, date('Y-m-d H:i:s'), $this->suiteTimer->time()]; } return [$this->suiteSettings->getBuildNumber(), $this->suiteSettings->getSuiteName(), $this->suiteSettings->getVersion(), $this->suiteSettings->getBranch(), $error ? 3 : 0, date('Y-m-d H:i:s'), date('Y-m-d H:i:s'), 0.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; }