From 5ddb1b5d65c672303f8cbad41ea4ca0b537361a6 Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Wed, 5 Feb 2020 19:42:28 +0300 Subject: [PATCH 1/2] add method info labels to cest tests --- composer.json | 2 +- src/Yandex/Allure/Codeception/AllureCodeception.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d4ef8bb..f3353c9 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "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", "symfony/filesystem": ">=2.6", diff --git a/src/Yandex/Allure/Codeception/AllureCodeception.php b/src/Yandex/Allure/Codeception/AllureCodeception.php index 51a23a2..4a8adc4 100644 --- a/src/Yandex/Allure/Codeception/AllureCodeception.php +++ b/src/Yandex/Allure/Codeception/AllureCodeception.php @@ -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)); From 2f48c40c40a905380cb4c4f2fc7b846a25e4bd3d Mon Sep 17 00:00:00 2001 From: Dmitry Baev Date: Wed, 5 Feb 2020 19:52:58 +0300 Subject: [PATCH 2/2] update php api version --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f3353c9..81c73d7 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "require": { "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" },