Skip to content

Commit df9dfda

Browse files
committed
MQE-783: [SPIKE] Investigate allure reporting when tests run in multiple suites
- Updated MagentoAllureAdapter to remove instance varaibles and hardcode the groupKey to 'groups' as this will not change
1 parent d48a35b commit df9dfda

File tree

1 file changed

+5
-35
lines changed

1 file changed

+5
-35
lines changed

src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,15 @@
1919

2020
class MagentoAllureAdapter extends AllureAdapter
2121
{
22-
/**
23-
* Variable name used for extracting group argument to codecept run commaned
24-
*
25-
* @var string
26-
*/
27-
protected $groupKey = "groups";
28-
29-
/**
30-
* Array of group values from test runner command to append to allure suitename
31-
*
32-
* @var array
33-
*/
34-
protected $group;
35-
36-
/**
37-
* Initialize from parent with group value
38-
*
39-
* @param array $ignoredAnnotations
40-
* @return void
41-
*/
42-
43-
// @codingStandardsIgnoreStart
44-
public function _initialize(array $ignoredAnnotations = [])
45-
{
46-
$this->group = $this->getGroup($this->groupKey);
47-
parent::_initialize($ignoredAnnotations);
48-
}
49-
// @codingStandardsIgnoreEnd
50-
5122
/**
5223
* Array of group values passed to test runner command
5324
*
54-
* @param String $groupKey
5525
* @return String
5626
*/
57-
private function getGroup($groupKey)
27+
private function getGroup()
5828
{
59-
if(!($this->options[$groupKey] == Null)){
60-
return $this->options[$groupKey][0];
29+
if ($this->options['groups'] != null) {
30+
return $this->options['groups'][0];
6131
}
6232
return null;
6333
}
@@ -72,9 +42,9 @@ public function suiteBefore(SuiteEvent $suiteEvent)
7242
{
7343
$changeSuiteEvent = $suiteEvent;
7444

75-
if ($this->group != null) {
45+
if ($this->getGroup() != null) {
7646
$suite = $suiteEvent->getSuite();
77-
$suiteName = ($suite->getName()) . "-{$this->group}";
47+
$suiteName = ($suite->getName()) . "-{$this->getGroup()}";
7848

7949
call_user_func(\Closure::bind(
8050
function () use ($suite, $suiteName) {

0 commit comments

Comments
 (0)