-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8229 from magento-arcticfoxes/B2B-2606
B2B-2606: Graphql Parser called at least 3 times per request
- Loading branch information
Showing
19 changed files
with
266 additions
and
71 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
...ento/CheckoutAgreements/Test/Mftf/ActionGroup/AdminDeleteAllTermConditionsActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminDeleteAllTermConditionsActionGroup"> | ||
<annotations> | ||
<description>Deletes all rows one by one on the 'Terms and Conditions' page.</description> | ||
</annotations> | ||
<waitForElementVisible selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="waitForResetFilter"/> | ||
<click selector="{{AdminLegacyDataGridFilterSection.clear}}" stepKey="clickResetFilter"/> | ||
<waitForPageLoad stepKey="waitForGridReset"/> | ||
<helper class="Magento\CheckoutAgreements\Test\Mftf\Helper\CheckoutAgreementsHelpers" method="deleteAllTermConditionRows" stepKey="deleteAllTermConditionRows"> | ||
<argument name="rowsToDelete">{{AdminTermGridSection.allTermRows}}</argument> | ||
<argument name="deleteButton">{{AdminMainActionsSection.delete}}</argument> | ||
<argument name="modalAcceptButton">{{AdminConfirmationModalSection.ok}}</argument> | ||
<argument name="successMessage">You deleted the condition.</argument> | ||
<argument name="successMessageContainer">{{AdminMessagesSection.success}}</argument> | ||
</helper> | ||
<waitForPageLoad stepKey="waitForGridLoad"/> | ||
<waitForText userInput="We couldn't find any records." selector="{{AdminTermGridSection.emptyGrid}}" stepKey="waitForEmptyGrid"/> | ||
</actionGroup> | ||
</actionGroups> |
61 changes: 61 additions & 0 deletions
61
app/code/Magento/CheckoutAgreements/Test/Mftf/Helper/CheckoutAgreementsHelpers.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\CheckoutAgreements\Test\Mftf\Helper; | ||
|
||
use Facebook\WebDriver\WebDriverBy; | ||
use Magento\FunctionalTestingFramework\Helper\Helper; | ||
use Magento\FunctionalTestingFramework\Module\MagentoWebDriver; | ||
use Exception; | ||
|
||
/** | ||
* Class for MFTF helpers for CheckoutAgreements module. | ||
*/ | ||
class CheckoutAgreementsHelpers extends Helper | ||
{ | ||
/** | ||
* Delete all term conditions one by one from the Terms & Conditions grid page. | ||
* | ||
* @param string $rowsToDelete | ||
* @param string $deleteButton | ||
* @param string $modalAcceptButton | ||
* @param string $successMessage | ||
* @param string $successMessageContainer | ||
* | ||
* @return void | ||
*/ | ||
public function deleteAllTermConditionRows( | ||
string $rowsToDelete, | ||
string $deleteButton, | ||
string $modalAcceptButton, | ||
string $successMessage, | ||
string $successMessageContainer | ||
): void { | ||
try { | ||
/** @var MagentoWebDriver $magentoWebDriver */ | ||
$magentoWebDriver = $this->getModule("\\" . MagentoWebDriver::class); | ||
$webDriver = $magentoWebDriver->webDriver; | ||
|
||
$magentoWebDriver->waitForPageLoad(30); | ||
$rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); | ||
while (!empty($rows)) { | ||
$rows[0]->click(); | ||
$magentoWebDriver->waitForPageLoad(30); | ||
$magentoWebDriver->waitForElementVisible($deleteButton, 10); | ||
$magentoWebDriver->click($deleteButton); | ||
$magentoWebDriver->waitForPageLoad(30); | ||
$magentoWebDriver->waitForElementVisible($modalAcceptButton, 10); | ||
$magentoWebDriver->click($modalAcceptButton); | ||
$magentoWebDriver->waitForPageLoad(60); | ||
$magentoWebDriver->waitForText($successMessage, 10, $successMessageContainer); | ||
$rows = $webDriver->findElements(WebDriverBy::xpath($rowsToDelete)); | ||
} | ||
} catch (Exception $exception) { | ||
$this->fail($exception->getMessage()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.