diff --git a/src/Yandex/Allure/Codeception/AllureCodeception.php b/src/Yandex/Allure/Codeception/AllureCodeception.php index 47ee856..6823111 100644 --- a/src/Yandex/Allure/Codeception/AllureCodeception.php +++ b/src/Yandex/Allure/Codeception/AllureCodeception.php @@ -24,6 +24,7 @@ use Yandex\Allure\Adapter\Annotation\Issues; use Yandex\Allure\Adapter\Annotation\Stories; use Yandex\Allure\Adapter\Annotation\Title; +use Yandex\Allure\Adapter\Event\AddAttachmentEvent; use Yandex\Allure\Adapter\Event\AddParameterEvent; use Yandex\Allure\Adapter\Event\StepFailedEvent; use Yandex\Allure\Adapter\Event\StepFinishedEvent; @@ -390,9 +391,8 @@ public function testEnd(TestEvent $testEvent) // attachments supported since Codeception 3.0 if (version_compare(Codecept::VERSION, '3.0.0') > -1 && $testEvent->getTest() instanceof Cest) { $artifacts = $testEvent->getTest()->getMetadata()->getReports(); - $testCaseStorage = $this->getLifecycle()->getTestCaseStorage()->get(); foreach ($artifacts as $name => $artifact) { - $testCaseStorage->addAttachment(new Attachment($name, $artifact, null)); + Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null)); } } $this->getLifecycle()->fire(new TestCaseFinishedEvent());