Skip to content

Commit

Permalink
fix attachments (via #59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Artem Eroshenko authored Mar 13, 2020
1 parent cbbc449 commit 9e0e25f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Yandex/Allure/Codeception/AllureCodeception.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit 9e0e25f

Please sign in to comment.