Skip to content

Commit c5c4938

Browse files
Manjusha.SManjusha.S
authored andcommitted
ACQE-4375 : Fix for png and html files not shown in allure report
1 parent f1fef97 commit c5c4938

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030
use Yandex\Allure\Adapter\Support\AttachmentSupport;
3131
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
3232
use Magento\FunctionalTestingFramework\DataGenerator\Handlers\PersistedObjectHandler;
33+
use Yandex\Allure\Adapter\Allure as YandexAllure;
34+
use Yandex\Allure\Adapter\Event\AddAttachmentEvent;
3335

3436
/**
3537
* MagentoWebDriver module provides common Magento web actions through Selenium WebDriver.
@@ -910,10 +912,8 @@ public function _failed(TestInterface $test, $fail)
910912
if ($this->current_test === null) {
911913
throw new \RuntimeException("Suite condition failure: \n" . $fail->getMessage());
912914
}
913-
914-
$this->addAttachment($this->pngReport, $test->getMetadata()->getName() . '.png', 'image/png');
915-
$this->addAttachment($this->htmlReport, $test->getMetadata()->getName() . '.html', 'text/html');
916-
915+
YandexAllure::lifecycle()->fire(new AddAttachmentEvent($this->pngReport, $test->getMetadata()->getName() . '.png', 'image/png'));
916+
YandexAllure::lifecycle()->fire(new AddAttachmentEvent($this->htmlReport, $test->getMetadata()->getName() . '.html', 'text/html'));
917917
$this->debug("Failure due to : {$fail->getMessage()}");
918918
$this->debug("Screenshot saved to {$this->pngReport}");
919919
$this->debug("Html saved to {$this->htmlReport}");

0 commit comments

Comments
 (0)