Esempio n. 1
0
 /**
  * @param Event $event
  * @return void
  */
 public function process(Event $event)
 {
     if (in_array('persist_before', $event->getTags())) {
         $this->stateObject->setStageName($event->getSubjects()[0]);
     } elseif (in_array('persist_before', $event->getTags())) {
         $this->stateObject->setStageName();
     }
 }
Esempio n. 2
0
 /**
  * Retrieve message context prefix
  *
  * @param Event $event
  * @return string
  */
 public function getMessagePrefix(Event $event)
 {
     return sprintf('%s %s %s %s %s %s %s', date("Y-m-d H:i:sP"), $event->getIdentifier(), $this->state->getAppStateName(), EventState::getTestSuiteName(), EventState::getTestClassName(), EventState::getTestMethodName(), $this->state->getStageName(), $this->state->getPageUrl());
 }
Esempio n. 3
0
 /**
  * @param Event $event
  * @return void
  */
 public function process(Event $event)
 {
     $this->logger->log($this->browser->getScreenshotData(), $this->createDestinationDirectory('screenshots') . '/' . $event->getIdentifier() . self::FILE_EXTENSION);
 }
Esempio n. 4
0
 /**
  * Collect page source artifact to storage
  *
  * @param Event $event
  * @return void
  */
 public function process(Event $event)
 {
     $directory = $this->createDestinationDirectory('page-source');
     $this->logger->log($this->browser->getHtmlSource(), $directory . '/' . $event->getIdentifier());
 }
Esempio n. 5
0
 /**
  * Process current event
  *
  * @param Event $event
  * @return void
  */
 public function process(Event $event)
 {
     foreach ($event->getSubjects() as $message) {
         $this->logger->log($this->getMessagePrefix($event) . ' ' . $message . PHP_EOL, $this->filename);
     }
 }
Esempio n. 6
0
 /**
  * @param Event $event
  * @return void
  */
 public function process(Event $event)
 {
     if (isset($event->getSubjects()[0])) {
         $this->stateObject->setAppStateName($event->getSubjects()[0]);
     }
 }