Skip to content

Commit c6697d9

Browse files
authored
Merge pull request #323 from magento/MQE-1439
MQE-1439: Invalid XML character in AdminDateFormatOnAttributePageTest causes Allure report parse error
2 parents 6d0cde4 + 8c450b7 commit c6697d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ private function sanitizeGroupName($group)
104104
}
105105

106106
/**
107-
* Override of parent method, only different to prevent replacing of . to •
107+
* Override of parent method:
108+
* prevent replacing of . to •
109+
* strips control characters
108110
*
109111
* @param StepEvent $stepEvent
110112
* @return void
113+
* @throws \Yandex\Allure\Adapter\AllureException
111114
*/
112115
public function stepBefore(StepEvent $stepEvent)
113116
{
@@ -129,6 +132,9 @@ public function stepBefore(StepEvent $stepEvent)
129132

130133
$stepName = $stepAction . ' ' . $stepArgs;
131134

135+
// Strip control characters so that report generation does not fail
136+
$stepName = preg_replace('/[[:cntrl:]]/', '', $stepName);
137+
132138
$this->emptyStep = false;
133139
$this->getLifecycle()->fire(new StepStartedEvent($stepName));
134140
}

0 commit comments

Comments
 (0)