Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 7b11576

Browse files
Reinhold FürederNaktibalda
Reinhold Füreder
authored andcommitted
Fix #4413 HTML Report wrong steps/substeps nesting
Previously using/calling the same meta step more than once (e.g. calling the same PageObject method twice), led to rendering all the steps from the meta step nested below the first meta step execution/node again and again, instead of several meta step executions/nodes (with each having just all steps from the meta step once).
1 parent 04a825f commit 7b11576

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/ResultPrinter/HTML.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,21 @@ public function endTest(\PHPUnit\Framework\Test $test, float $time) : void
9696
}
9797

9898
$stepsBuffer = '';
99-
$subStepsBuffer = '';
10099
$subStepsRendered = [];
101100

102101
foreach ($steps as $step) {
103102
if ($step->getMetaStep()) {
104-
$subStepsRendered[$step->getMetaStep()->getAction()][] = $this->renderStep($step);
103+
$key = $step->getMetaStep()->getLine() . $step->getMetaStep()->getAction();
104+
$subStepsRendered[$key][] = $this->renderStep($step);
105105
}
106106
}
107107

108108
foreach ($steps as $step) {
109109
if ($step->getMetaStep()) {
110-
if (! empty($subStepsRendered[$step->getMetaStep()->getAction()])) {
111-
$subStepsBuffer = implode('', $subStepsRendered[$step->getMetaStep()->getAction()]);
112-
unset($subStepsRendered[$step->getMetaStep()->getAction()]);
113-
110+
$key = $step->getMetaStep()->getLine() . $step->getMetaStep()->getAction();
111+
if (! empty($subStepsRendered[$key])) {
112+
$subStepsBuffer = implode('', $subStepsRendered[$key]);
113+
unset($subStepsRendered[$key]);
114114
$stepsBuffer .= $this->renderSubsteps($step->getMetaStep(), $subStepsBuffer);
115115
}
116116
} else {

0 commit comments

Comments
 (0)