Skip to content

Commit

Permalink
add method info labels to cest tests (via #52)
Browse files Browse the repository at this point in the history
  • Loading branch information
baev authored Feb 5, 2020
1 parent 0f2605e commit 67eddab
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"source": "https://github.com/allure-framework/allure-codeception"
},
"require": {
"php": ">=5.4.0",
"php": ">=5.6",
"codeception/codeception": "^2.3|^3.0",
"allure-framework/allure-php-api": "~1.1.0",
"allure-framework/allure-php-api": "~1.1.7",
"symfony/filesystem": ">=2.6",
"symfony/finder": ">=2.6"
},
Expand Down
5 changes: 5 additions & 0 deletions src/Yandex/Allure/Codeception/AllureCodeception.php
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ public function testStart(TestEvent $testEvent)
$testName = $this->buildTestName($test);
$event = new TestCaseStartedEvent($this->uuid, $testName);
if ($test instanceof Cest) {
$methodName = $test->getName();
$className = get_class($test->getTestClass());
$event->setLabels(array_merge($event->getLabels(), [
new Label("testMethod", $methodName),
new Label("testClass", $className)
]));
$annotations = [];
if (class_exists($className, false)) {
$annotations = array_merge($annotations, Annotation\AnnotationProvider::getClassAnnotations($className));
Expand Down

0 comments on commit 67eddab

Please sign in to comment.