|
61 | 61 | <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage3"/> |
62 | 62 | <!-- Step 3: Open Cart Sidebar and verify initial values --> |
63 | 63 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCart"/> |
64 | | - <waitForElementVisible selector="{{StorefrontMinicartSection.productLinkByName($createSimpleProduct.name$)}}" stepKey="verifyAppleProductInMiniCart"/> |
65 | | - <waitForText userInput="$10.00" selector="{{StorefrontMinicartSection.productPriceByName($createSimpleProduct.name$)}}" stepKey="verifyInitialProductPrice"/> |
| 64 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyInitialProductInMiniCart"> |
| 65 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 66 | + <argument name="productPrice" value="$10.00"/> |
| 67 | + <argument name="cartSubtotal" value="$10.00"/> |
| 68 | + <argument name="qty" value="1"/> |
| 69 | + </actionGroup> |
66 | 70 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCart"/> |
67 | 71 | <!-- Step 4: Open new tab for Admin and change product details --> |
68 | 72 | <openNewTab stepKey="openAdminTab"/> |
69 | 73 | <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage"> |
70 | 74 | <argument name="productId" value="$createSimpleProduct.id$"/> |
71 | 75 | </actionGroup> |
72 | 76 | <!-- Change product name and price --> |
73 | | - <fillField selector="{{AdminProductFormSection.productName}}" userInput="Apple-X" stepKey="changeProductName"/> |
74 | | - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="20" stepKey="changeProductPrice"/> |
| 77 | + <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="changeProductName"> |
| 78 | + <argument name="productName" value="Apple-X"/> |
| 79 | + </actionGroup> |
| 80 | + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="changeProductPrice"> |
| 81 | + <argument name="price" value="20"/> |
| 82 | + </actionGroup> |
75 | 83 | <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
76 | 84 | <!-- Step 5: Return to storefront, reload page and verify cached values --> |
77 | 85 | <switchToPreviousTab stepKey="switchToStorefrontTab"/> |
|
81 | 89 | </actionGroup> |
82 | 90 | <actionGroup ref="ReloadPageActionGroup" stepKey="reloadProductPageAfterFirstAdminChange"/> |
83 | 91 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCartAfterProductChange"/> |
84 | | - <waitForElementVisible selector="{{StorefrontMinicartSection.productLinkByName($createSimpleProduct.name$)}}" stepKey="verifyAppleProductInMiniCartAfterChange"/> |
85 | | - <waitForText userInput="$10.00" selector="{{StorefrontMinicartSection.productPriceByName($createSimpleProduct.name$)}}" stepKey="verifyCachedProductPrice"/> |
| 92 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyCachedProductInMiniCart"> |
| 93 | + <argument name="productName" value="$createSimpleProduct.name$"/> |
| 94 | + <argument name="productPrice" value="$10.00"/> |
| 95 | + <argument name="cartSubtotal" value="$10.00"/> |
| 96 | + <argument name="qty" value="1"/> |
| 97 | + </actionGroup> |
86 | 98 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterProductChange"/> |
87 | 99 | <!-- Step 6: Logout and login again to invalidate cache --> |
88 | 100 | <actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/> |
|
91 | 103 | </actionGroup> |
92 | 104 | <!-- Step 7: Verify cart shows updated values after login --> |
93 | 105 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCartAfterLogin"/> |
94 | | - <waitForElementVisible selector="{{StorefrontMinicartSection.productLinkByName('Apple-X')}}" stepKey="verifyAppleProductInMiniCartAfterLogin"/> |
95 | | - <waitForText userInput="$20.00" selector="{{StorefrontMinicartSection.productPriceByName($createSimpleProduct.name$)}}" stepKey="verifyUpdatedProductPriceAfterLogin"/> |
| 106 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyUpdatedProductInMiniCartAfterLogin"> |
| 107 | + <argument name="productName" value="Apple-X"/> |
| 108 | + <argument name="productPrice" value="$20.00"/> |
| 109 | + <argument name="cartSubtotal" value="$20.00"/> |
| 110 | + <argument name="qty" value="1"/> |
| 111 | + </actionGroup> |
96 | 112 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterLogin"/> |
97 | 113 | <!-- Step 8: Reload page several times to ensure caching --> |
98 | 114 | <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPageAfterLogin1"/> |
|
103 | 119 | <argument name="productId" value="$createSimpleProduct.id$"/> |
104 | 120 | </actionGroup> |
105 | 121 | <!-- Change product name and price again --> |
106 | | - <fillField selector="{{AdminProductFormSection.productName}}" userInput="Apple-X-Y" stepKey="changeProductNameAgain"/> |
107 | | - <fillField selector="{{AdminProductFormSection.productPrice}}" userInput="30" stepKey="changeProductPriceAgain"/> |
| 122 | + <actionGroup ref="AdminFillProductNameOnProductFormActionGroup" stepKey="changeProductNameAgain"> |
| 123 | + <argument name="productName" value="Apple-X-Y"/> |
| 124 | + </actionGroup> |
| 125 | + <actionGroup ref="AdminFillProductPriceFieldAndPressEnterOnProductEditPageActionGroup" stepKey="changeProductPriceAgain"> |
| 126 | + <argument name="price" value="30"/> |
| 127 | + </actionGroup> |
108 | 128 | <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAgain"/> |
109 | 129 | <!-- Step 10: Return to storefront and verify cached values --> |
110 | 130 | <switchToPreviousTab stepKey="switchToStorefrontTabAgain"/> |
|
113 | 133 | </actionGroup> |
114 | 134 | <actionGroup ref="ReloadPageActionGroup" stepKey="reloadProductPageAfterSecondAdminChange"/> |
115 | 135 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCartAfterSecondChange"/> |
116 | | - <waitForElementVisible selector="{{StorefrontMinicartSection.productLinkByName('Apple-X')}}" stepKey="verifyAppleProductInMiniCartAfterSecondChange"/> |
117 | | - <waitForText userInput="$20.00" selector="{{StorefrontMinicartSection.productPriceByName('Apple-X')}}" stepKey="verifyCachedProductPriceAfterSecondChange"/> |
| 136 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyCachedProductAfterSecondChange"> |
| 137 | + <argument name="productName" value="Apple-X"/> |
| 138 | + <argument name="productPrice" value="$20.00"/> |
| 139 | + <argument name="cartSubtotal" value="$20.00"/> |
| 140 | + <argument name="qty" value="1"/> |
| 141 | + </actionGroup> |
118 | 142 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterSecondChange"/> |
119 | 143 | <!-- Step 11: Wait for Customer Data Lifetime to expire (6 minutes) --> |
120 | 144 | <wait time="120" stepKey="waitForCustomerDataLifetimeExpiration"/> |
121 | 145 | <!-- Step 12: Reload page and verify updated values --> |
122 | 146 | <actionGroup ref="ReloadPageActionGroup" stepKey="reloadPageAfterWait"/> |
123 | 147 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniCartAfterWait"/> |
124 | | - <waitForElementVisible selector="{{StorefrontMinicartSection.productLinkByName('Apple-X-Y')}}" stepKey="verifyAppleProductInMiniCartAfterWait"/> |
125 | | - <waitForText userInput="$30.00" selector="{{StorefrontMinicartSection.productPriceByName('Apple-X-Y')}}" stepKey="verifyUpdatedProductPriceAfterWait"/> |
| 148 | + <actionGroup ref="AssertStorefrontMiniCartItemsActionGroup" stepKey="verifyFinalUpdatedProductInMiniCart"> |
| 149 | + <argument name="productName" value="Apple-X-Y"/> |
| 150 | + <argument name="productPrice" value="$30.00"/> |
| 151 | + <argument name="cartSubtotal" value="$30.00"/> |
| 152 | + <argument name="qty" value="1"/> |
| 153 | + </actionGroup> |
126 | 154 | <actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeCartSidebarFinal"/> |
127 | 155 | </test> |
128 | 156 | </tests> |
0 commit comments