Skip to content

Commit 65cd589

Browse files
committed
ACQE-8327: Cart Sidebar synchronization with Customer Data Lifetime through customer login/logout
- Added Ags for commented lines
1 parent e1f71d3 commit 65cd589

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

app/code/Magento/Checkout/Test/Mftf/Test/StorefrontCartSidebarSynchronizationWithCustomerLoginTest.xml

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,25 @@
6161
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPage3"/>
6262
<!-- Step 3: Open Cart Sidebar and verify initial values -->
6363
<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>
6670
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCart"/>
6771
<!-- Step 4: Open new tab for Admin and change product details -->
6872
<openNewTab stepKey="openAdminTab"/>
6973
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
7074
<argument name="productId" value="$createSimpleProduct.id$"/>
7175
</actionGroup>
7276
<!-- 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>
7583
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
7684
<!-- Step 5: Return to storefront, reload page and verify cached values -->
7785
<switchToPreviousTab stepKey="switchToStorefrontTab"/>
@@ -81,8 +89,12 @@
8189
</actionGroup>
8290
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadProductPageAfterFirstAdminChange"/>
8391
<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>
8698
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterProductChange"/>
8799
<!-- Step 6: Logout and login again to invalidate cache -->
88100
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutCustomer"/>
@@ -91,8 +103,12 @@
91103
</actionGroup>
92104
<!-- Step 7: Verify cart shows updated values after login -->
93105
<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>
96112
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterLogin"/>
97113
<!-- Step 8: Reload page several times to ensure caching -->
98114
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPageAfterLogin1"/>
@@ -103,8 +119,12 @@
103119
<argument name="productId" value="$createSimpleProduct.id$"/>
104120
</actionGroup>
105121
<!-- 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>
108128
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductAgain"/>
109129
<!-- Step 10: Return to storefront and verify cached values -->
110130
<switchToPreviousTab stepKey="switchToStorefrontTabAgain"/>
@@ -113,16 +133,24 @@
113133
</actionGroup>
114134
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadProductPageAfterSecondAdminChange"/>
115135
<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>
118142
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeMiniCartAfterSecondChange"/>
119143
<!-- Step 11: Wait for Customer Data Lifetime to expire (6 minutes) -->
120144
<wait time="120" stepKey="waitForCustomerDataLifetimeExpiration"/>
121145
<!-- Step 12: Reload page and verify updated values -->
122146
<actionGroup ref="ReloadPageActionGroup" stepKey="reloadPageAfterWait"/>
123147
<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>
126154
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="closeCartSidebarFinal"/>
127155
</test>
128156
</tests>

0 commit comments

Comments
 (0)