Skip to content

Commit 40b85ab

Browse files
authored
MQE-922: Periods in Allure report execution test body appear as •
- MagentoAllureAdapter now overrides the stepBefore event, fixes replacing of `.`
1 parent 9adb681 commit 40b85ab

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

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

+26
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
use Magento\FunctionalTestingFramework\Data\Argument\Interpreter\NullType;
99
use Magento\FunctionalTestingFramework\Suite\Handlers\SuiteObjectHandler;
1010
use Yandex\Allure\Adapter\AllureAdapter;
11+
use Yandex\Allure\Adapter\Event\StepStartedEvent;
1112
use Codeception\Event\SuiteEvent;
13+
use Codeception\Event\StepEvent;
1214

1315
/**
1416
* Class MagentoAllureAdapter
@@ -91,4 +93,28 @@ private function sanitizeGroupName($group)
9193
$originalName = in_array($originalName, $suiteNames) ? $originalName : $group;
9294
return $originalName;
9395
}
96+
97+
/**
98+
* Override of parent method, only different to prevent replacing of . to •
99+
*
100+
* @param StepEvent $stepEvent
101+
* @return void
102+
*/
103+
public function stepBefore(StepEvent $stepEvent)
104+
{
105+
//Hard set to 200; we don't expose this config in MFTF
106+
$argumentsLength = 200;
107+
$stepAction = $stepEvent->getStep()->getHumanizedActionWithoutArguments();
108+
$stepArgs = $stepEvent->getStep()->getArgumentsAsString($argumentsLength);
109+
110+
if (!trim($stepAction)) {
111+
$stepAction = $stepEvent->getStep()->getMetaStep()->getHumanizedActionWithoutArguments();
112+
$stepArgs = $stepEvent->getStep()->getMetaStep()->getArgumentsAsString($argumentsLength);
113+
}
114+
115+
$stepName = $stepAction . ' ' . $stepArgs;
116+
117+
$this->emptyStep = false;
118+
$this->getLifecycle()->fire(new StepStartedEvent($stepName));
119+
}
94120
}

0 commit comments

Comments
 (0)