diff --git a/src/Yandex/Allure/Codeception/AllureCodeception.php b/src/Yandex/Allure/Codeception/AllureCodeception.php index 012f7da..4d57e07 100644 --- a/src/Yandex/Allure/Codeception/AllureCodeception.php +++ b/src/Yandex/Allure/Codeception/AllureCodeception.php @@ -252,7 +252,7 @@ private function buildTestName($test) { $testName .= ' with data set #' . $this->testInvocations[$testFullName]; } } else if($test instanceof Gherkin) { - $testName = $test->getMetadata()->getFeature(); + $testName = $test->getFeatureNode()->getTitle(); } return $testName; } @@ -394,6 +394,11 @@ public function testEnd(TestEvent $testEvent) foreach ($artifacts as $name => $artifact) { Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null)); } + } elseif (version_compare(Codecept::VERSION, '3.0.0') > -1 && $testEvent->getTest() instanceof Gherkin) { + $artifacts = $testEvent->getTest()->getMetadata()->getReports(); + foreach ($artifacts as $name => $artifact) { + Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null)); + } } $this->getLifecycle()->fire(new TestCaseFinishedEvent()); }