From b608324c6d813e771892aa8119b07d183f029286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reinhold=20F=C3=BCreder?= Date: Tue, 17 Sep 2019 17:33:08 +0200 Subject: [PATCH] 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). --- src/ResultPrinter/HTML.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ResultPrinter/HTML.php b/src/ResultPrinter/HTML.php index 95eb536..d7d7579 100644 --- a/src/ResultPrinter/HTML.php +++ b/src/ResultPrinter/HTML.php @@ -96,21 +96,21 @@ public function endTest(\PHPUnit\Framework\Test $test, $time) } $stepsBuffer = ''; - $subStepsBuffer = ''; $subStepsRendered = []; foreach ($steps as $step) { if ($step->getMetaStep()) { - $subStepsRendered[$step->getMetaStep()->getAction()][] = $this->renderStep($step); + $key = $step->getMetaStep()->getLine() . $step->getMetaStep()->getAction(); + $subStepsRendered[$key][] = $this->renderStep($step); } } foreach ($steps as $step) { if ($step->getMetaStep()) { - if (! empty($subStepsRendered[$step->getMetaStep()->getAction()])) { - $subStepsBuffer = implode('', $subStepsRendered[$step->getMetaStep()->getAction()]); - unset($subStepsRendered[$step->getMetaStep()->getAction()]); - + $key = $step->getMetaStep()->getLine() . $step->getMetaStep()->getAction(); + if (! empty($subStepsRendered[$key])) { + $subStepsBuffer = implode('', $subStepsRendered[$key]); + unset($subStepsRendered[$key]); $stepsBuffer .= $this->renderSubsteps($step->getMetaStep(), $subStepsBuffer); } } else {