Skip to content

Commit f9bce40

Browse files
authored
fix test names for gherkin tests (via #71)
1 parent 17a34a7 commit f9bce40

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Yandex/Allure/Codeception/AllureCodeception.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ private function buildTestName($test) {
252252
$testName .= ' with data set #' . $this->testInvocations[$testFullName];
253253
}
254254
} else if($test instanceof Gherkin) {
255-
$testName = $test->getMetadata()->getFeature();
255+
$testName = $test->getFeatureNode()->getTitle();
256256
}
257257
return $testName;
258258
}
@@ -394,6 +394,11 @@ public function testEnd(TestEvent $testEvent)
394394
foreach ($artifacts as $name => $artifact) {
395395
Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null));
396396
}
397+
} elseif (version_compare(Codecept::VERSION, '3.0.0') > -1 && $testEvent->getTest() instanceof Gherkin) {
398+
$artifacts = $testEvent->getTest()->getMetadata()->getReports();
399+
foreach ($artifacts as $name => $artifact) {
400+
Allure::lifecycle()->fire(new AddAttachmentEvent($artifact, $name, null));
401+
}
397402
}
398403
$this->getLifecycle()->fire(new TestCaseFinishedEvent());
399404
}

0 commit comments

Comments
 (0)