Skip to content

Commit

Permalink
fix test names for gherkin tests (via #71)
Browse files Browse the repository at this point in the history
  • Loading branch information
DolgushinG authored Jun 3, 2021
1 parent 17a34a7 commit f9bce40
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Yandex/Allure/Codeception/AllureCodeception.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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());
}
Expand Down

0 comments on commit f9bce40

Please sign in to comment.