Skip to content

Commit 41d5ff1

Browse files
authored
ENGCOM-7736: [MFTF] Use action group for adding to cart #28854
2 parents ca42df9 + 7425b28 commit 41d5ff1

15 files changed

+18
-53
lines changed

app/code/Magento/Captcha/Test/Mftf/Test/CaptchaFormsDisplayingTest/CaptchaWithDisabledGuestCheckoutTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@
3434
</after>
3535
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="openProductPage"/>
3636
<waitForPageLoad stepKey="waitForPageLoad"/>
37-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart"/>
38-
<waitForPageLoad stepKey="waitForAddToCart"/>
39-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
37+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
4038
<waitForText userInput="You added $$createSimpleProduct.name$$ to your shopping cart." stepKey="waitForText"/>
4139
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickCart"/>
4240
<click selector="{{StorefrontMinicartSection.goToCheckout}}" stepKey="goToCheckout"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminAddInStockProductToTheCartTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@
7878
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/>
7979
<!--Add Product to the cart-->
8080
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1" stepKey="fillProductQuantity"/>
81-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="clickOnAddToCartButton"/>
82-
<waitForPageLoad stepKey="waitForProductToAddInCart"/>
83-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
81+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
8482
<seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeSuccessSaveMessage"/>
8583
<seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/>
8684
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>

app/code/Magento/Catalog/Test/Mftf/Test/AdminUpdateSimpleProductWithRegularPriceInStockWithCustomOptionsTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,7 @@
148148
<!-- Verify added Product in cart -->
149149
<selectOption selector="{{StorefrontProductPageSection.customOptionDropDown}}" userInput="{{simpleProductCustomizableOption.option_0_title}} +$98.00" stepKey="selectCustomOption"/>
150150
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1" stepKey="fillProductQuantity"/>
151-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="clickOnAddToCartButton"/>
152-
<waitForPageLoad stepKey="waitForProductToAddInCart"/>
153-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
151+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
154152
<seeElement selector="{{StorefrontProductPageSection.successMsg}}" stepKey="seeYouAddedSimpleprod4ToYourShoppingCartSuccessSaveMessage"/>
155153
<seeElement selector="{{StorefrontMinicartSection.quantity(1)}}" stepKey="seeAddedProductQuantityInCart"/>
156154
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="clickOnMiniCart"/>

app/code/Magento/CatalogRule/Test/Mftf/Test/AdminCreateCatalogPriceRuleTest/AdminCreateCatalogPriceRuleByPercentTest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@
6161
<see stepKey="seeNewPrice2" selector="{{StorefrontProductInfoMainSection.updatedPrice}}" userInput="$110.70"/>
6262

6363
<!-- Add the product to cart and check that the price is correct there -->
64-
<click stepKey="addToCart" selector="{{StorefrontProductActionSection.addToCart}}"/>
65-
<waitForPageLoad stepKey="waitForAddedToCart"/>
64+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
6665
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCheckout"/>
6766
<see stepKey="seeNewPriceInCart" selector="{{CheckoutCartSummarySection.subtotal}}" userInput="$110.70"/>
6867
</test>

app/code/Magento/CatalogRule/Test/Mftf/Test/AdminDeleteCatalogPriceRuleEntityTest/AdminDeleteCatalogPriceRuleEntityFromConfigurableProductTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,7 @@
131131

132132
<!-- Assert that the rule isn't present in the Shopping Cart -->
133133
<selectOption selector="{{StorefrontProductInfoMainSection.productAttributeOptionsSelectButton}}" userInput="option1" stepKey="selectOption1"/>
134-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addToCart1"/>
135-
<waitForPageLoad time="30" stepKey="waitForPageLoad4"/>
136-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
134+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
137135
<see selector="{{StorefrontMessagesSection.success}}" userInput="You added $$createConfigProduct1.name$ to your shopping cart." stepKey="seeAddToCartSuccessMessage"/>
138136
<actionGroup ref="StorefrontClickOnMiniCartActionGroup" stepKey="openMiniShoppingCart1"/>
139137
<see selector="{{StorefrontMinicartSection.productPriceByName($$createConfigProduct1.name$$)}}" userInput="$$createConfigProduct1.price$$" stepKey="seeCorrectProductPrice1"/>

app/code/Magento/Customer/Test/Mftf/Test/StorefrontCheckTaxAddingValidVATIdTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@
8383
<see userInput="$$createProduct.name$$" selector="{{StorefrontProductInfoMainSection.productName}}" stepKey="assertFirstProductNameTitle"/>
8484

8585
<!--Add a product to the cart-->
86-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
87-
<waitForPageLoad stepKey="waitForAddProductToCart"/>
88-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
86+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
8987
<!--Proceed to checkout-->
9088
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="GoToCheckoutFromMinicartActionGroup"/>
9189
<!-- Click next button to open payment section -->

app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleEmptyFromDateTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@
8383
<!-- Spot check the storefront -->
8484
<amOnPage url="$$product.custom_attributes[url_key]$$.html" stepKey="goToProductPage"/>
8585
<waitForPageLoad stepKey="waitForProductPageLoad"/>
86-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
87-
<waitForPageLoad stepKey="waitForAddToCart"/>
88-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
86+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
8987
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage"/>
9088
<actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyCoupon">
9189
<argument name="coupon" value="_defaultCoupon"/>

app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForCouponCodeTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@
7575
<!-- Spot check the storefront -->
7676
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToProductPage"/>
7777
<waitForPageLoad stepKey="waitForProductPageLoad"/>
78-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
79-
<waitForPageLoad stepKey="waitForAddToCart"/>
80-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
78+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
8179
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage"/>
8280
<actionGroup ref="StorefrontApplyCouponActionGroup" stepKey="applyCoupon">
8381
<argument name="coupon" value="_defaultCoupon"/>

app/code/Magento/SalesRule/Test/Mftf/Test/AdminCreateCartPriceRuleForGeneratedCouponTest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,7 @@
7979
<!-- Spot check the storefront -->
8080
<amOnPage url="{{_defaultProduct.urlKey}}.html" stepKey="goToProductPage"/>
8181
<waitForPageLoad stepKey="waitForProductPageLoad"/>
82-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart"/>
83-
<waitForPageLoad stepKey="waitForAddToCart"/>
84-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
82+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
8583
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="goToCartPage"/>
8684
<conditionalClick selector="{{StorefrontSalesRuleCartCouponSection.couponHeader}}" dependentSelector="{{StorefrontSalesRuleCartCouponSection.discountBlockActive}}" visible="false" stepKey="clickCouponHeader"/>
8785
<waitForElementVisible selector="{{StorefrontSalesRuleCartCouponSection.couponField}}" stepKey="waitForCouponField" />

app/code/Magento/SalesRule/Test/Mftf/Test/CartPriceRuleForConfigurableProductTest.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,11 @@
126126
<!-- Add the first product to the cart -->
127127
<amOnPage url="$$createConfigChildProduct1.sku$$.html" stepKey="goToProductPage1"/>
128128
<waitForPageLoad stepKey="waitForProductPageLoad1"/>
129-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart1"/>
130-
<waitForPageLoad stepKey="waitForAddToCart1"/>
131-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage"/>
129+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage"/>
132130
<!-- Add the second product to the cart -->
133131
<amOnPage url="$$createConfigChildProduct2.sku$$.html" stepKey="goToProductPage2"/>
134132
<waitForPageLoad stepKey="waitForProductPageLoad2"/>
135-
<click selector="{{StorefrontProductActionSection.addToCart}}" stepKey="addProductToCart2"/>
136-
<waitForPageLoad stepKey="waitForAddToCart2"/>
137-
<waitForElementVisible selector="{{StorefrontMessagesSection.success}}" stepKey="waitForSuccessMessage2"/>
133+
<actionGroup ref="StorefrontClickAddToCartOnProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage2"/>
138134

139135
<!--View and edit cart-->
140136
<actionGroup ref="ClickViewAndEditCartFromMiniCartActionGroup" stepKey="clickViewAndEditCartFromMiniCart"/>

0 commit comments

Comments
 (0)