|
133 | 133 | </actionGroup>
|
134 | 134 | </after>
|
135 | 135 | </test>
|
| 136 | + |
| 137 | + <test name="AdminCreateCatalogPriceRuleForCustomerGroupTest"> |
| 138 | + <annotations> |
| 139 | + <features value="CatalogRule"/> |
| 140 | + <stories value="Apply catalog price rule"/> |
| 141 | + <title value="Admin should be able to apply the catalog rule by customer group"/> |
| 142 | + <description value="Admin should be able to apply the catalog rule by customer group"/> |
| 143 | + <severity value="MAJOR"/> |
| 144 | + <testCaseId value="MC-71"/> |
| 145 | + <group value="CatalogRule"/> |
| 146 | + </annotations> |
| 147 | + <before> |
| 148 | + <!-- Create a simple product and a category--> |
| 149 | + <createData entity="ApiCategory" stepKey="createCategory"/> |
| 150 | + <createData entity="ApiSimpleProduct" stepKey="createProduct"> |
| 151 | + <requiredEntity createDataKey="createCategory"/> |
| 152 | + </createData> |
| 153 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 154 | + </before> |
| 155 | + <after> |
| 156 | + <!-- Delete the simple product and category --> |
| 157 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 158 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 159 | + <!-- Delete the catalog rule --> |
| 160 | + <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToRulePage"/> |
| 161 | + <waitForPageLoad stepKey="waitForRulePage"/> |
| 162 | + <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule"> |
| 163 | + <argument name="name" value="{{_defaultCatalogRule.name}}"/> |
| 164 | + <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
| 165 | + </actionGroup> |
| 166 | + <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 167 | + </after> |
| 168 | + |
| 169 | + <!-- Create a catalog rule for the NOT LOGGED IN customer group --> |
| 170 | + <actionGroup ref="newCatalogPriceRuleByUI" stepKey="createNewPriceRule"/> |
| 171 | + <actionGroup ref="selectNotLoggedInCustomerGroup" stepKey="selectNotLoggedInCustomerGroup"/> |
| 172 | + <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> |
| 173 | + <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> |
| 174 | + |
| 175 | + <!-- As a NOT LOGGED IN user, go to the storefront category page and should see the discount --> |
| 176 | + <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory1"/> |
| 177 | + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct1"/> |
| 178 | + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$110.70" stepKey="seeDiscountedPrice1"/> |
| 179 | + |
| 180 | + <!-- Create a user account --> |
| 181 | + <actionGroup ref="SignUpNewUserFromStorefrontActionGroup" stepKey="createAnAccount"> |
| 182 | + <argument name="Customer" value="CustomerEntityOne"/> |
| 183 | + </actionGroup> |
| 184 | + |
| 185 | + <!-- As a logged in user, go to the storefront category page and should NOT see discount --> |
| 186 | + <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory2"/> |
| 187 | + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct2"/> |
| 188 | + <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeDiscountedPrice2"/> |
| 189 | + </test> |
136 | 190 | </tests>
|
0 commit comments