|
74 | 74 | <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/>
|
75 | 75 | <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="seeSuccessMessage"/>
|
76 | 76 | </actionGroup>
|
| 77 | + |
| 78 | + <actionGroup name="deleteAllCartPriceRule"> |
| 79 | + <amOnPage url="{{AdminCartPriceRulesPage.url}}" stepKey="amOnCartPriceRuleList"/> |
| 80 | + <!-- It sometimes is loading too long for default 10s --> |
| 81 | + <waitForPageLoad time="60" stepKey="waitForPageFullyLoaded"/> |
| 82 | + <conditionalClick selector="{{AdminDataGridHeaderSection.clearFilters}}" dependentSelector="{{AdminDataGridHeaderSection.clearFilters}}" visible="true" stepKey="clearFilters"/> |
| 83 | + <executeInSelenium |
| 84 | + function=" |
| 85 | + function ($webdriver) use ($I) { |
| 86 | + $rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)')); |
| 87 | + while(!empty($rows)) { |
| 88 | + $rows[0]->click(); |
| 89 | + $I->waitForPageLoad(30); |
| 90 | + $I->click('#delete'); |
| 91 | + $I->waitForPageLoad(30); |
| 92 | + $I->waitForElementVisible('aside.confirm .modal-footer button.action-accept', 10); |
| 93 | + $I->waitForPageLoad(60); |
| 94 | + $I->click('aside.confirm .modal-footer button.action-accept'); |
| 95 | + $I->waitForPageLoad(60); |
| 96 | + $I->waitForLoadingMaskToDisappear(); |
| 97 | + $I->waitForElementVisible('#messages div.message-success', 10); |
| 98 | + $I->see('You deleted the rule.', '#messages div.message-success'); |
| 99 | + $rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr[data-role=row]:not(.data-grid-tr-no-data):nth-of-type(1)')); |
| 100 | + } |
| 101 | + }" |
| 102 | + stepKey="deleteAllCartPriceRulesOneByOne"/> |
| 103 | + <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/> |
| 104 | + <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/> |
| 105 | + </actionGroup> |
77 | 106 | </actionGroups>
|
0 commit comments