Skip to content

Commit ae2fc5e

Browse files
committed
ACQE-4973 | Group test under packages
1 parent 7e96e5c commit ae2fc5e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

src/Magento/FunctionalTestingFramework/Extension/TestContextExtension.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,24 +160,24 @@ function (TestResult $testResult) {
160160
}
161161
);
162162

163-
$group = null;
163+
$groupName = null;
164164
if ($this->options['groups'] !== null) {
165165
$group = $this->options['groups'][0];
166-
}
167-
if ($group !== null) {
168166
$groupName = $this->sanitizeGroupName($group);
169-
$lifecycle->updateTest(
170-
function (TestResult $testResult) use ($groupName) {
171-
$labels = $testResult->getLabels();
172-
foreach ($labels as $label) {
173-
if ($label->getName() == "parentSuite") {
174-
$label->setValue(sprintf('%s\%s', $label->getValue(), $groupName));
175-
break;
176-
}
167+
}
168+
$lifecycle->updateTest(
169+
function (TestResult $testResult) use ($groupName, $cest) {
170+
$labels = $testResult->getLabels();
171+
foreach ($labels as $label) {
172+
if ($groupName !== null && $label->getName() === "parentSuite") {
173+
$label->setValue(sprintf('%s\%s', $label->getValue(), $groupName));
174+
}
175+
if ($label->getName() === "package") {
176+
$label->setValue($cest->getReportFields()['class']);
177177
}
178178
}
179-
);
180-
}
179+
}
180+
);
181181
}
182182

183183
/**

0 commit comments

Comments
 (0)