/** * 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]; }
/** * Sends an mail with the error messages. * * The receiver and the sender is set in the suite settings. * * @return $this|TestSuite Same instance for chained method calls. */ private function _sendErrorMail() { $from = $this->suiteSettings->getSendMailFrom(); $to = $this->suiteSettings->getSendMailTo(); $reply = $this->suiteSettings->getSendMailReplyTo(); if ($to === '' || $reply === '' || $from === '') { $this->output('Invalid E-Mail credentials, not possible to send the error mail'); return $this; } $subject = '[SeleniumTest] Test fehlgeschlagen, Branch: ' . $this->suiteSettings->getBranch(); $header = 'From: ' . $from . "\r\n" . 'Reply-To: ' . $reply . "\r\n" . 'Content-Type: text/plain; charset=UTF-8"'; mail($to, $subject, $this->errorMessages, $header); $this->output('Error E-Mail send!'); $this->errorMailSend = true; return $this; }