From 109dc5cc651d8d7db0d84403e0da289d95984430 Mon Sep 17 00:00:00 2001 From: Artem Eroshenko Date: Fri, 13 Mar 2020 13:30:57 +0300 Subject: [PATCH] mark step as failed --- src/Yandex/Allure/Codeception/AllureCodeception.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Yandex/Allure/Codeception/AllureCodeception.php b/src/Yandex/Allure/Codeception/AllureCodeception.php index 0edbca5..47ee856 100644 --- a/src/Yandex/Allure/Codeception/AllureCodeception.php +++ b/src/Yandex/Allure/Codeception/AllureCodeception.php @@ -25,6 +25,7 @@ use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; use Yandex\Allure\Adapter\Event\AddParameterEvent; +use Yandex\Allure\Adapter\Event\StepFailedEvent; use Yandex\Allure\Adapter\Event\StepFinishedEvent; use Yandex\Allure\Adapter\Event\StepStartedEvent; use Yandex\Allure\Adapter\Event\TestCaseBrokenEvent; @@ -418,8 +419,11 @@ public function stepBefore(StepEvent $stepEvent) $this->getLifecycle()->fire(new StepStartedEvent($stepName)); } - public function stepAfter() + public function stepAfter(StepEvent $stepEvent) { + if ($stepEvent->getStep()->hasFailed()) { + $this->getLifecycle()->fire(new StepFailedEvent()); + } $this->getLifecycle()->fire(new StepFinishedEvent()); }