Exemplo n.º 1
0
 /**
  * Adds error messages after an error is occurred.
  *
  * @param string $screenShotUrl Path to the error screen shot.
  * @param string $errorMessage  Error message, which is passed to the FileLogger::log method.
  *
  * @return $this Same instance for chained method calls.
  */
 protected function addErrorMessages($screenShotUrl, $errorMessage)
 {
     $this->testSuite->addErrorMessage('Branch: ' . $this->testSuite->getSuiteSettings()->getBranch());
     $this->testSuite->addErrorMessage('Build number: ' . $this->testSuite->getSuiteSettings()->getBuildNumber());
     $this->testSuite->addErrorMessage('Suite name: ' . $this->testSuite->getSuiteSettings()->getSuiteName());
     $this->testSuite->addErrorMessage('Case: ' . $this->_getCaseName());
     $this->testSuite->addErrorMessage('Test method: ' . $this->_invokedBy(null, 4));
     $this->testSuite->addErrorMessage('Failure url: ' . $this->testSuite->getWebDriver()->getCurrentURL());
     $this->testSuite->addErrorMessage('');
     $this->testSuite->addErrorMessage("Error Message: \n" . $errorMessage);
     $this->testSuite->addErrorMessage('Error time: ' . date('d.m.Y H:i:s'));
     $this->testSuite->addErrorMessage('Screenshot: ' . $this->testSuite->getSuiteSettings()->getScreenShotDirectory() . DIRECTORY_SEPARATOR . $screenShotUrl);
     $this->testSuite->addErrorMessage('Logfile: [Functionality not developed]');
     $this->testSuite->addErrorMessage('');
     return $this;
 }
 /**
  * Returns an array with web driver elements by the given xPath value.
  *
  * @param string           $xPath   xPath value.
  * @param WebDriverElement $element Expected value of searching type.
  *
  * @deprecated Will be remove in future version! Algorithms are unstable and may procedure errors.
  * @return WebDriverElement[]|WebDriverLocatable[]|RemoteWebElement[] Expected web driver element.
  */
 public function arrayByXpath($xPath, WebDriverElement $element = null)
 {
     $by = lcfirst(substr(explode('::', __METHOD__)[1], 7));
     return $element ? $this->_arrayBy($by, $xPath, $element) : $this->_arrayBy($by, $xPath, $this->testSuite->getWebDriver());
 }