Skip to content

Commit fdcda9a

Browse files
committed
MQE-1514: Failure For seeCurrentUrlEquals Action Does Not Show Actual
- Added contents of 1633, changed the calls to use Helper class instead
1 parent a32145d commit fdcda9a

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/Magento/FunctionalTestingFramework/Module/MagentoWebDriver.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
use Codeception\Module\WebDriver;
1010
use Codeception\Test\Descriptor;
1111
use Codeception\TestInterface;
12-
use Yandex\Allure\Adapter\Allure;
12+
use Magento\FunctionalTestingFramework\Allure\AllureHelper;
1313
use Facebook\WebDriver\Interactions\WebDriverActions;
1414
use Codeception\Exception\ModuleConfigException;
1515
use Codeception\Exception\ModuleException;
@@ -19,8 +19,6 @@
1919
use Magento\FunctionalTestingFramework\Util\Protocol\CurlTransport;
2020
use Magento\FunctionalTestingFramework\Util\Protocol\CurlInterface;
2121
use Magento\FunctionalTestingFramework\Util\ConfigSanitizerUtil;
22-
use Yandex\Allure\Adapter\Event\AddAttachmentEvent;
23-
use Yandex\Allure\Adapter\Event\AddParameterEvent;
2422
use Yandex\Allure\Adapter\Support\AttachmentSupport;
2523
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
2624

@@ -203,7 +201,7 @@ public function dontSeeCurrentUrlEquals($url)
203201
{
204202
$actualUrl = $this->webDriver->getCurrentURL();
205203
$comparison = "Expected: $url\nActual: $actualUrl";
206-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
204+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
207205
$this->assertNotEquals($url, $actualUrl);
208206
}
209207

@@ -217,7 +215,7 @@ public function dontSeeCurrentUrlMatches($regex)
217215
{
218216
$actualUrl = $this->webDriver->getCurrentURL();
219217
$comparison = "Expected: $regex\nActual: $actualUrl";
220-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
218+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
221219
$this->assertNotRegExp($regex, $actualUrl);
222220
}
223221

@@ -231,7 +229,7 @@ public function dontSeeInCurrentUrl($needle)
231229
{
232230
$actualUrl = $this->webDriver->getCurrentURL();
233231
$comparison = "Expected: $needle\nActual: $actualUrl";
234-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
232+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
235233
$this->assertNotContains($needle, $actualUrl);
236234
}
237235

@@ -268,7 +266,7 @@ public function seeCurrentUrlEquals($url)
268266
{
269267
$actualUrl = $this->webDriver->getCurrentURL();
270268
$comparison = "Expected: $url\nActual: $actualUrl";
271-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
269+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
272270
$this->assertEquals($url, $actualUrl);
273271
}
274272

@@ -282,7 +280,7 @@ public function seeCurrentUrlMatches($regex)
282280
{
283281
$actualUrl = $this->webDriver->getCurrentURL();
284282
$comparison = "Expected: $regex\nActual: $actualUrl";
285-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
283+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
286284
$this->assertRegExp($regex, $actualUrl);
287285
}
288286

@@ -296,7 +294,7 @@ public function seeInCurrentUrl($needle)
296294
{
297295
$actualUrl = $this->webDriver->getCurrentURL();
298296
$comparison = "Expected: $needle\nActual: $actualUrl";
299-
Allure::lifecycle()->fire(new AddAttachmentEvent($comparison, 'Comparison'));
297+
AllureHelper::addAttachmentToCurrentStep($comparison, 'Comparison');
300298
$this->assertContains($needle, $actualUrl);
301299
}
302300

0 commit comments

Comments
 (0)