|
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 | 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