|
17 | 17 | <testCaseId value="MC-71"/> |
18 | 18 | <group value="CatalogRule"/> |
19 | 19 | </annotations> |
| 20 | + |
20 | 21 | <before> |
21 | 22 | <!-- Create a simple product and a category--> |
22 | 23 | <createData entity="ApiCategory" stepKey="createCategory"/> |
|
25 | 26 | </createData> |
26 | 27 |
|
27 | 28 | <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 29 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> |
| 30 | + <!-- Perform reindex and flush cache --> |
| 31 | + <actionGroup ref="AdminReindexAndFlushCache" stepKey="reindexAndFlushCache"/> |
28 | 32 | </before> |
| 33 | + |
29 | 34 | <after> |
30 | 35 | <!-- Delete the simple product and category --> |
31 | 36 | <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
32 | 37 | <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
33 | | - <!-- Delete the catalog rule --> |
34 | | - <amOnPage url="{{CatalogRulePage.url}}" stepKey="goToRulePage"/> |
35 | | - <waitForPageLoad stepKey="waitForRulePage"/> |
36 | | - <actionGroup ref="deleteEntitySecondaryGrid" stepKey="deletePriceRule"> |
37 | | - <argument name="name" value="{{_defaultCatalogRule.name}}"/> |
38 | | - <argument name="searchInput" value="{{AdminSecondaryGridSection.catalogRuleIdentifierSearch}}"/> |
39 | | - </actionGroup> |
40 | | - <amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/> |
| 38 | + <actionGroup ref="AdminCatalogPriceRuleDeleteAllActionGroup" stepKey="deleteAllCatalogPriceRule"/> |
| 39 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/> |
| 40 | + <magentoCron groups="index" stepKey="reindexInvalidatedIndices"/> |
41 | 41 | </after> |
42 | 42 |
|
43 | 43 | <!-- Create a catalog rule for the NOT LOGGED IN customer group --> |
44 | | - <actionGroup ref="NewCatalogPriceRuleByUIActionGroup" stepKey="createNewPriceRule"/> |
45 | | - <actionGroup ref="SelectNotLoggedInCustomerGroupActionGroup" stepKey="selectNotLoggedInCustomerGroup"/> |
46 | | - <click selector="{{AdminNewCatalogPriceRule.saveAndApply}}" stepKey="saveAndApply"/> |
47 | | - <see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the rule." stepKey="assertSuccess"/> |
48 | | - |
49 | | - <!-- Perform reindex and flush cache --> |
50 | | - <magentoCLI command="indexer:reindex" stepKey="reindex"/> |
51 | | - <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 44 | + <actionGroup ref="AdminOpenNewCatalogPriceRuleFormPageActionGroup" stepKey="createNewPriceRule"/> |
| 45 | + <actionGroup ref="AdminCatalogPriceRuleFillMainInfoActionGroup" stepKey="fillMainInfoForPriceRule"> |
| 46 | + <argument name="groups" value="'NOT LOGGED IN'"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminCatalogPriceRuleFillActionsActionGroup" stepKey="fillActionsPriceRule"/> |
| 49 | + <actionGroup ref="AdminCatalogPriceRuleSaveAndApplyActionGroup" stepKey="saveAndApplyFPriceRule"/> |
52 | 50 |
|
53 | 51 | <!-- As a NOT LOGGED IN user, go to the storefront category page and should see the discount --> |
54 | | - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory1"/> |
| 52 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory1"> |
| 53 | + <argument name="category" value="$createCategory$"/> |
| 54 | + </actionGroup> |
55 | 55 | <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct1"/> |
56 | 56 | <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$110.70" stepKey="seeDiscountedPrice1"/> |
57 | 57 |
|
|
67 | 67 | </actionGroup> |
68 | 68 |
|
69 | 69 | <!-- As a logged in user, go to the storefront category page and should NOT see discount --> |
70 | | - <amOnPage url="$$createCategory.name$$.html" stepKey="goToCategory2"/> |
| 70 | + <actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="goToCategory2"> |
| 71 | + <argument name="category" value="$createCategory$"/> |
| 72 | + </actionGroup> |
71 | 73 | <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$$createProduct.name$$" stepKey="seeProduct2"/> |
72 | 74 | <see selector="{{StorefrontCategoryProductSection.ProductInfoByNumber('1')}}" userInput="$123.00" stepKey="seeDiscountedPrice2"/> |
73 | 75 | </test> |
|
0 commit comments