/** * @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(); } }
/** * 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()); }
/** * @param Event $event * @return void */ public function process(Event $event) { $this->logger->log($this->browser->getScreenshotData(), $this->createDestinationDirectory('screenshots') . '/' . $event->getIdentifier() . self::FILE_EXTENSION); }
/** * 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()); }
/** * 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); } }
/** * @param Event $event * @return void */ public function process(Event $event) { if (isset($event->getSubjects()[0])) { $this->stateObject->setAppStateName($event->getSubjects()[0]); } }