|
15 | 15 | </arguments>
|
16 | 16 | <!-- Go to the admin Catalog rule grid and add a new one -->
|
17 | 17 | <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/>
|
18 |
| - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/> |
| 18 | + <waitForPageLoad time="30" stepKey="waitForPageFullyLoaded"/> |
19 | 19 | <click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/>
|
20 |
| - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> |
21 | 20 |
|
22 | 21 | <!-- Fill the form according the attributes of the entity -->
|
| 22 | + <waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitRuleNameFieldAppears"/> |
23 | 23 | <fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/>
|
24 | 24 | <fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/>
|
25 | 25 | <selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/>
|
26 | 26 | <selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/>
|
27 | 27 |
|
28 |
| - <click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/> |
| 28 | + <scrollTo selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" stepKey="scrollToActionsSection"/> |
| 29 | + <conditionalClick selector="{{AdminCatalogPriceRuleSection.actionsTabTitle}}" dependentSelector="{{AdminCatalogPriceRuleSection.actionsTabBody}}" visible="false" stepKey="openActionsTabIfCollapsed"/> |
29 | 30 | <selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/>
|
30 | 31 | <fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/>
|
31 | 32 | <selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/>
|
32 | 33 |
|
33 | 34 | <!-- Scroll to top and either save or save and apply after the action group -->
|
34 | 35 | <scrollToTopOfPage stepKey="scrollToTop"/>
|
35 | 36 | <click selector="{{AdminMainActionsSection.save}}" stepKey="clickSave"/>
|
36 |
| - <waitForPageLoad stepKey="waitForRuleSaved"/> |
37 |
| - <see userInput="You saved the rule." stepKey="verifyRuleSaved"/> |
| 37 | + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitForSuccessMessage"/> |
| 38 | + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="checkSuccessMessage"/> |
38 | 39 | </actionGroup>
|
39 | 40 |
|
40 | 41 | <actionGroup name="RemoveCatalogPriceRule">
|
|
48 | 49 | <fillField selector="{{AdminCatalogPriceRuleGridSection.filterByRuleName}}" userInput="{{ruleName}}" stepKey="filterByRuleName"/>
|
49 | 50 | <click selector="{{AdminDataGridHeaderSection.applyFilters}}" stepKey="clickSearch"/>
|
50 | 51 | <click selector="{{AdminGridTableSection.row('1')}}" stepKey="clickEdit"/>
|
51 |
| - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear1"/> |
52 |
| - |
| 52 | + <waitForPageLoad stepKey="waitForEditRuleFormLoad"/> |
| 53 | + <waitForElementVisible selector="{{AdminMainActionsSection.delete}}" stepKey="waitDeleteButtonAppears"/> |
53 | 54 | <click selector="{{AdminMainActionsSection.delete}}" stepKey="clickToDelete"/>
|
54 | 55 | <waitForElementVisible selector="{{AdminConfirmationModalSection.ok}}" stepKey="waitForElementVisible"/>
|
55 | 56 | <click selector="{{AdminConfirmationModalSection.ok}}" stepKey="clickToConfirm"/>
|
56 | 57 | <waitForPageLoad stepKey="waitForPageLoad"/>
|
57 |
| - <waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear2"/> |
58 | 58 | <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessageAppears"/>
|
59 | 59 | <see selector="{{AdminMessagesSection.success}}" userInput="You deleted the rule." stepKey="checkSuccessMessage"/>
|
60 | 60 | </actionGroup>
|
|
107 | 107 | <executeInSelenium
|
108 | 108 | function="
|
109 | 109 | function ($webdriver) use ($I) {
|
110 |
| - $rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr._clickable[data-role=row]:nth-of-type(1)')); |
| 110 | + $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)')); |
111 | 111 | while(!empty($rows)) {
|
112 | 112 | $rows[0]->click();
|
113 | 113 | $I->waitForPageLoad(30);
|
|
120 | 120 | $I->waitForLoadingMaskToDisappear();
|
121 | 121 | $I->waitForElementVisible('#messages div.message-success', 10);
|
122 | 122 | $I->see('You deleted the rule.', '#messages div.message-success');
|
123 |
| - $rows = $webdriver->findElements(\Facebook\WebDriver\WebDriverBy::cssSelector('table.data-grid tbody tr._clickable[data-role=row]:nth-of-type(1)')); |
| 123 | + $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)')); |
124 | 124 | }
|
125 | 125 | }"
|
126 |
| - stepKey="deleteAllCartPriceRulesOneByOne"/> |
| 126 | + stepKey="deleteAllCatalogPriceRulesOneByOne"/> |
127 | 127 | <waitForElementVisible selector="{{AdminDataGridTableSection.dataGridEmpty}}" stepKey="waitDataGridEmptyMessageAppears"/>
|
128 | 128 | <see selector="{{AdminDataGridTableSection.dataGridEmpty}}" userInput="We couldn't find any records." stepKey="assertDataGridEmptyMessage"/>
|
129 | 129 | </actionGroup>
|
| 130 | + |
| 131 | + <actionGroup name="AdminStartCreateNewCatalogRuleActionGroup"> |
| 132 | + <amOnPage url="{{AdminCatalogPriceRuleGridPage.url}}" stepKey="goToAdminCatalogPriceRuleGridPage"/> |
| 133 | + <waitForPageLoad time="30" stepKey="waitForGridPage"/> |
| 134 | + <click selector="{{AdminMainActionsSection.add}}" stepKey="addNewRule"/> |
| 135 | + <waitForElementVisible selector="{{AdminCatalogPriceRuleSection.ruleName}}" stepKey="waitCreatePageLoaded"/> |
| 136 | + </actionGroup> |
| 137 | + |
| 138 | + <actionGroup name="AdminFillCatalogRuleFormActionGroup"> |
| 139 | + <arguments> |
| 140 | + <argument name="catalogRule" defaultValue="CustomCatalogRule"/> |
| 141 | + </arguments> |
| 142 | + |
| 143 | + <fillField selector="{{AdminCatalogPriceRuleSection.ruleName}}" userInput="{{catalogRule.name}}" stepKey="fillName"/> |
| 144 | + <fillField selector="{{AdminCatalogPriceRuleSection.description}}" userInput="{{catalogRule.description}}" stepKey="fillDescription"/> |
| 145 | + <selectOption selector="{{AdminCatalogPriceRuleSection.websites}}" parameterArray="{{catalogRule.websites}}" stepKey="selectWebsites"/> |
| 146 | + <selectOption selector="{{AdminCatalogPriceRuleSection.customerGroups}}" parameterArray="{{catalogRule.groups}}" stepKey="selectCustomerGroups"/> |
| 147 | + |
| 148 | + <click selector="{{AdminCatalogPriceRuleSection.actionsTab}}" stepKey="openActionDropdown"/> |
| 149 | + <selectOption selector="{{AdminCatalogPriceRuleActionsSection.apply}}" userInput="{{catalogRule.simple_action}}" stepKey="discountType"/> |
| 150 | + <fillField selector="{{AdminCatalogPriceRuleActionsSection.discountAmount}}" userInput="{{catalogRule.discount_amount}}" stepKey="fillDiscountValue"/> |
| 151 | + <selectOption selector="{{AdminCatalogPriceRuleActionsSection.disregardRules}}" userInput="Yes" stepKey="discardSubsequentRules"/> |
| 152 | + </actionGroup> |
| 153 | + |
| 154 | + <actionGroup name="AdminFillCatalogRuleConditionActionGroup"> |
| 155 | + <arguments> |
| 156 | + <argument name="condition" type="string"/> |
| 157 | + <argument name="conditionOperator" type="string" defaultValue="is"/> |
| 158 | + <argument name="conditionValue" type="string"/> |
| 159 | + </arguments> |
| 160 | + |
| 161 | + <conditionalClick selector="{{AdminCatalogPriceRuleSection.conditionsTab}}" dependentSelector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" visible="false" stepKey="openConditionsTab"/> |
| 162 | + <waitForElementVisible selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" stepKey="waitForAddConditionButton"/> |
| 163 | + <click selector="{{AdminCatalogPriceRuleConditionsSection.newCondition}}" stepKey="addNewCondition"/> |
| 164 | + <selectOption selector="{{AdminCatalogPriceRuleConditionsSection.conditionSelect('1')}}" userInput="{{condition}}" stepKey="selectTypeCondition"/> |
| 165 | + <click selector="{{AdminCatalogPriceRuleConditionsSection.condition('is')}}" stepKey="clickOnOperator"/> |
| 166 | + <selectOption selector="{{AdminCatalogPriceRuleConditionsSection.activeOperatorSelect}}" userInput="{{conditionOperator}}" stepKey="selectCondition"/> |
| 167 | + <!-- In case we are choosing already selected value - select is not closed automatically --> |
| 168 | + <conditionalClick selector="{{AdminCatalogPriceRuleConditionsSection.condition('...')}}" dependentSelector="{{AdminCatalogPriceRuleConditionsSection.activeOperatorSelect}}" visible="true" stepKey="closeSelect"/> |
| 169 | + <click selector="{{AdminCatalogPriceRuleConditionsSection.condition('...')}}" stepKey="clickToChooseOption3"/> |
| 170 | + <waitForElementVisible selector="{{AdminCatalogPriceRuleConditionsSection.activeValueInput}}" stepKey="waitForValueInput"/> |
| 171 | + <fillField selector="{{AdminCatalogPriceRuleConditionsSection.activeValueInput}}" userInput="{{conditionValue}}" stepKey="fillConditionValue"/> |
| 172 | + <click selector="{{AdminCatalogPriceRuleConditionsSection.activeConditionApplyButton}}" stepKey="clickApply"/> |
| 173 | + <waitForElementNotVisible selector="{{AdminCatalogPriceRuleConditionsSection.activeConditionApplyButton}}" stepKey="waitForApplyButtonInvisibility"/> |
| 174 | + </actionGroup> |
| 175 | + |
| 176 | + <actionGroup name="AdminSaveAndApplyCatalogPriceRuleActionGroup"> |
| 177 | + <scrollToTopOfPage stepKey="scrollToPageTop"/> |
| 178 | + <click selector="{{AdminCatalogPriceRuleSection.saveAndApply}}" stepKey="saveAndApply"/> |
| 179 | + <waitForElementVisible selector="{{AdminMessagesSection.success}}" stepKey="waitSuccessMessage"/> |
| 180 | + <see selector="{{AdminMessagesSection.success}}" userInput="You saved the rule." stepKey="assertSaveSuccess"/> |
| 181 | + <see selector="{{AdminMessagesSection.success}}" userInput="Updated rules applied." stepKey="assertApplySuccess"/> |
| 182 | + </actionGroup> |
| 183 | + |
130 | 184 | </actionGroups>
|
0 commit comments