Skip to content

Commit 8bb00a2

Browse files
authored
Merge branch 'develop' into MQE-876
2 parents 1062018 + 320dc63 commit 8bb00a2

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?php
2+
/**
3+
* Copyright © Magento, Inc. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
namespace Magento\FunctionalTestingFramework\Allure\Adapter;
7+
8+
use Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType;
9+
use Yandex\Allure\Adapter\AllureAdapter;
10+
use Codeception\Event\SuiteEvent;
11+
12+
/**
13+
* Class MagentoAllureAdapter
14+
*
15+
* Extends AllureAdapter to provide further information for allure reports
16+
*
17+
* @package Magento\FunctionalTestingFramework\Allure
18+
*/
19+
20+
class MagentoAllureAdapter extends AllureAdapter
21+
{
22+
/**
23+
* Array of group values passed to test runner command
24+
*
25+
* @return String
26+
*/
27+
private function getGroup()
28+
{
29+
if ($this->options['groups'] != null) {
30+
return $this->options['groups'][0];
31+
}
32+
return null;
33+
}
34+
35+
/**
36+
* Override of parent method to set suitename as suitename and group name concatenated
37+
*
38+
* @param SuiteEvent $suiteEvent
39+
* @return void
40+
*/
41+
public function suiteBefore(SuiteEvent $suiteEvent)
42+
{
43+
$changeSuiteEvent = $suiteEvent;
44+
45+
if ($this->getGroup() != null) {
46+
$suite = $suiteEvent->getSuite();
47+
$suiteName = ($suite->getName()) . "\\" . $this->getGroup();
48+
49+
call_user_func(\Closure::bind(
50+
function () use ($suite, $suiteName) {
51+
$suite->name = $suiteName;
52+
},
53+
null,
54+
$suite
55+
));
56+
57+
//change suiteEvent
58+
$changeSuiteEvent = new SuiteEvent(
59+
$suiteEvent->getSuite(),
60+
$suiteEvent->getResult(),
61+
$suiteEvent->getSettings()
62+
);
63+
}
64+
// call parent function
65+
parent::suiteBefore($changeSuiteEvent);
66+
}
67+
}

0 commit comments

Comments
 (0)