Skip to content

Commit 710d692

Browse files
committed
REFACTOR: Extract Action Groups to separate files (MFTF best practices)
1 parent 7ccd640 commit 710d692

File tree

3 files changed

+29
-19
lines changed

3 files changed

+29
-19
lines changed
Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
1111
<!-- Check configurable product in wishlist -->
12-
<actionGroup name="StorefrontCustomerCheckConfigurableProductInWishlist">
12+
<actionGroup name="StorefrontCustomerCheckConfigurableProductInWishlistActionGroup">
1313
<annotations>
1414
<description>Validates that the provided Configurable Product and Product Option is present in the Storefront Wish List.</description>
1515
</annotations>
@@ -24,20 +24,4 @@
2424
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistAddToCart"/>
2525
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistProductImage"/>
2626
</actionGroup>
27-
28-
<!-- Check configurable product in wishlist sidebar -->
29-
<actionGroup name="StorefrontCustomerCheckConfigurableProductInWishlistSidebar">
30-
<annotations>
31-
<description>Validates that the provided Configurable Product and Product Option is present in the Storefront Wish List sidebar.</description>
32-
</annotations>
33-
<arguments>
34-
<argument name="productVar"/>
35-
<argument name="optionProductVar"/>
36-
</arguments>
37-
38-
<waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/>
39-
<see userInput="${{optionProductVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/>
40-
<seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/>
41-
<seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/>
42-
</actionGroup>
4327
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<!-- Check configurable product in wishlist sidebar -->
12+
<actionGroup name="StorefrontCustomerCheckConfigurableProductInWishlistSidebarActionGroup">
13+
<annotations>
14+
<description>Validates that the provided Configurable Product and Product Option is present in the Storefront Wish List sidebar.</description>
15+
</annotations>
16+
<arguments>
17+
<argument name="productVar"/>
18+
<argument name="optionProductVar"/>
19+
</arguments>
20+
21+
<waitForElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductTitleByName(productVar.name)}}" time="30" stepKey="assertWishlistSidebarProductName"/>
22+
<see userInput="${{optionProductVar.price}}.00" selector="{{StorefrontCustomerWishlistSidebarSection.ProductPriceByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductPrice"/>
23+
<seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductAddToCartByName(productVar.name)}}" stepKey="AssertWishlistSidebarAddToCart"/>
24+
<seeElement selector="{{StorefrontCustomerWishlistSidebarSection.ProductImageByName(productVar.name)}}" stepKey="AssertWishlistSidebarProductImage"/>
25+
</actionGroup>
26+
</actionGroups>

dev/tests/acceptance/tests/functional/Magento/FunctionalTest/ConfigurableProductWishlist/Test/EndToEndB2CLoggedInUserTest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" after="wishlistClickConfigurableProduct" stepKey="wishlistAddConfigurableProductToWishlist">
1818
<argument name="productVar" value="$$createConfigProduct$$"/>
1919
</actionGroup>
20-
<actionGroup ref="StorefrontCustomerCheckConfigurableProductInWishlist" after="wishlistAddConfigurableProductToWishlist" stepKey="wishlistCheckConfigurableProductInWishlist">
20+
<actionGroup ref="StorefrontCustomerCheckConfigurableProductInWishlistActionGroup" after="wishlistAddConfigurableProductToWishlist" stepKey="wishlistCheckConfigurableProductInWishlist">
2121
<argument name="productVar" value="$$createConfigProduct$$"/>
2222
<argument name="optionProductVar" value="$$createConfigChildProduct1$$"/>
2323
</actionGroup>
24-
<actionGroup ref="StorefrontCustomerCheckConfigurableProductInWishlistSidebar" after="wishlistCheckConfigurableProductInWishlist" stepKey="wishlistCheckConfigurableProductInWishlistSidebar">
24+
<actionGroup ref="StorefrontCustomerCheckConfigurableProductInWishlistSidebarActionGroup" after="wishlistCheckConfigurableProductInWishlist" stepKey="wishlistCheckConfigurableProductInWishlistSidebar">
2525
<argument name="productVar" value="$$createConfigProduct$$"/>
2626
<argument name="optionProductVar" value="$$createConfigChildProduct1$$"/>
2727
</actionGroup>

0 commit comments

Comments
 (0)