|
10 | 10 | use Magento\FunctionalTestingFramework\Test\Objects\ActionGroupObject;
|
11 | 11 | use Magento\FunctionalTestingFramework\Test\Objects\ActionObject;
|
12 | 12 | use Magento\FunctionalTestingFramework\Util\TestGenerator;
|
| 13 | +use Yandex\Allure\Adapter\Model\Provider; |
13 | 14 | use Yandex\Allure\Adapter\Model\Status;
|
14 | 15 | use Yandex\Allure\Adapter\Model\Step;
|
15 | 16 | use Yandex\Allure\Codeception\AllureCodeception;
|
@@ -250,13 +251,22 @@ public function testError(FailEvent $failEvent)
|
250 | 251 | */
|
251 | 252 | public function testEnd()
|
252 | 253 | {
|
| 254 | + // Peek top of testCaseStorage to check of failure |
| 255 | + $testFailed = $this->getLifecycle()->getTestCaseStorage()->get()->getFailure(); |
253 | 256 | // Pops top of stepStorage, need to add it back in after processing
|
254 | 257 | $rootStep = $this->getLifecycle()->getStepStorage()->pollLast();
|
255 | 258 | $formattedSteps = [];
|
256 | 259 | $actionGroupStepContainer = null;
|
257 | 260 |
|
258 | 261 | $actionGroupStepKey = null;
|
259 | 262 | foreach ($rootStep->getSteps() as $step) {
|
| 263 | + //Remove Attachments if verbose flag is not true AND test did not fail |
| 264 | + if (getenv('VERBOSE_ARTIFACTS') !== true && $testFailed === null) { |
| 265 | + foreach ($step->getAttachments() as $index => $attachment) { |
| 266 | + $step->removeAttachment($index); |
| 267 | + unlink(Provider::getOutputDirectory() . DIRECTORY_SEPARATOR . $attachment->getSource()); |
| 268 | + } |
| 269 | + } |
260 | 270 | $stepKey = str_replace($actionGroupStepKey, '', $step->getName());
|
261 | 271 | if ($stepKey !== '[]' && $stepKey !== null) {
|
262 | 272 | $step->setName($stepKey);
|
|
0 commit comments