Skip to content

Commit 5506e85

Browse files
committed
Merge branch '287' of https://github.com/MilaLesechko/magento-functional-tests-migration into mila-287-from-2.4
2 parents d95cea6 + 8c70e7b commit 5506e85

7 files changed

+454
-1
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutCartProductSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
selector="//table[@id='shopping-cart-table']//tbody//tr[contains(@class,'item-actions')]//a[contains(@class,'action-delete')]"/>
3434
<element name="removeProductByName" type="text" selector="//*[contains(text(), '{{productName}}')]/ancestor::tbody//a[@class='action action-delete']" parameterized="true" timeout="30"/>
3535
<element name="productName" type="text" selector="//tbody[@class='cart item']//strong[@class='product-item-name']"/>
36+
<element name="moveToWishlistByProductName" type="button" selector="//a[contains(text(), '{{productName}}')]/ancestor::tbody/tr//a[contains(@class, 'towishlist')]" parameterized="true"/>
3637
<element name="nthItemOption" type="block" selector=".item:nth-of-type({{numElement}}) .item-options" parameterized="true"/>
3738
<element name="nthEditButton" type="block" selector=".item:nth-of-type({{numElement}}) .action-edit" parameterized="true"/>
3839
<element name="nthBundleOptionName" type="text" selector=".product-item-details .item-options:nth-of-type({{numOption}}) dt" parameterized="true"/>

app/code/Magento/Wishlist/Test/Mftf/Section/StorefrontCustomerWishlistProductSection.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@
2525
<element name="pager" type="block" selector=".toolbar .pager"/>
2626
<element name="wishlistEmpty" type="block" selector=".form-wishlist-items .message.info.empty"/>
2727
<element name="removeProduct" type="button" selector=".products-grid a.btn-remove" timeout="30"/>
28+
<element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/>
29+
<element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/>
30+
<element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/>
2831
</section>
2932
</sections>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontMoveConfigurableProductFromShoppingCartToWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Move Configurable Product from Shopping Cart to Wishlist"/>
15+
<description value="Move Configurable Product from Shopping Cart to Wishlist"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-29545"/>
18+
<group value="wishlist"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<!-- Create an attribute with three options to be used in the first child product -->
26+
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
27+
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
28+
<requiredEntity createDataKey="createConfigProductAttribute"/>
29+
</createData>
30+
<createData entity="productAttributeOption2" stepKey="createConfigProductAttributeOption2">
31+
<requiredEntity createDataKey="createConfigProductAttribute"/>
32+
</createData>
33+
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
34+
<requiredEntity createDataKey="createConfigProductAttribute"/>
35+
</createData>
36+
37+
<!-- Add the attribute just created to default attribute set -->
38+
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
39+
<requiredEntity createDataKey="createConfigProductAttribute"/>
40+
</createData>
41+
42+
<!-- Get the first option of the attribute created -->
43+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
44+
<requiredEntity createDataKey="createConfigProductAttribute"/>
45+
</getData>
46+
47+
<!-- Get the second option of the attribute created -->
48+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
49+
<requiredEntity createDataKey="createConfigProductAttribute"/>
50+
</getData>
51+
52+
<!-- Get the third option of the attribute created -->
53+
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
54+
<requiredEntity createDataKey="createConfigProductAttribute"/>
55+
</getData>
56+
57+
<!-- Create Configurable product -->
58+
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
59+
<requiredEntity createDataKey="createCategory"/>
60+
</createData>
61+
62+
<!-- Create a simple product and give it the attribute with the first option -->
63+
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
64+
<requiredEntity createDataKey="createConfigProductAttribute"/>
65+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
66+
<field key="price">10.00</field>
67+
</createData>
68+
69+
<!--Create a simple product and give it the attribute with the second option -->
70+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
71+
<requiredEntity createDataKey="createConfigProductAttribute"/>
72+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
73+
<field key="price">20.00</field>
74+
</createData>
75+
76+
<!--Create a simple product and give it the attribute with the Third option -->
77+
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
78+
<requiredEntity createDataKey="createConfigProductAttribute"/>
79+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
80+
<field key="price">30.00</field>
81+
</createData>
82+
83+
<!-- Create the configurable product -->
84+
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
85+
<requiredEntity createDataKey="createConfigProduct"/>
86+
<requiredEntity createDataKey="createConfigProductAttribute"/>
87+
<requiredEntity createDataKey="getConfigAttributeOption1"/>
88+
<requiredEntity createDataKey="getConfigAttributeOption2"/>
89+
<requiredEntity createDataKey="getConfigAttributeOption3"/>
90+
</createData>
91+
92+
<!-- Add the first simple product to the configurable product -->
93+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
94+
<requiredEntity createDataKey="createConfigProduct"/>
95+
<requiredEntity createDataKey="createConfigChildProduct1"/>
96+
</createData>
97+
98+
<!-- Add the second simple product to the configurable product -->
99+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
100+
<requiredEntity createDataKey="createConfigProduct"/>
101+
<requiredEntity createDataKey="createConfigChildProduct2"/>
102+
</createData>
103+
104+
<!-- Add the third simple product to the configurable product -->
105+
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
106+
<requiredEntity createDataKey="createConfigProduct"/>
107+
<requiredEntity createDataKey="createConfigChildProduct3"/>
108+
</createData>
109+
</before>
110+
<after>
111+
<!-- Delete data -->
112+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
113+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/>
114+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/>
115+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/>
116+
<deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/>
117+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
118+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
119+
<actionGroup ref="logout" stepKey="logout"/>
120+
</after>
121+
122+
<!-- 1. Login as a customer -->
123+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
124+
<argument name="Customer" value="$$createCustomer$$"/>
125+
</actionGroup>
126+
127+
<!-- Open Product page -->
128+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
129+
<argument name="category" value="$$createCategory$$"/>
130+
<argument name="product" value="$$createConfigProduct$$"/>
131+
</actionGroup>
132+
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption1"/>
133+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/>
134+
135+
<!-- Add product to the cart and Assert add product to cart success message-->
136+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage">
137+
<argument name="productName" value="$$createConfigProduct.name$$"/>
138+
</actionGroup>
139+
140+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
141+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>
142+
143+
<!-- Assert move product to wishlist success message -->
144+
<click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createConfigProduct.name$$)}}" stepKey="moveToWishlist"/>
145+
<waitForPageLoad stepKey="waitForPageLoad"/>
146+
<see userInput="$$createConfigProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/>
147+
148+
<!-- Assert product is present in wishlist -->
149+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/>
150+
<waitForPageLoad stepKey="waitForWishlistPage"/>
151+
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createConfigProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/>
152+
<see userInput="$20.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/>
153+
154+
<!-- Assert product details in Wishlist -->
155+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createConfigProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/>
156+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/>
157+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createConfigProduct.name$$)}}" stepKey="AssertWishlistProductImage"/>
158+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createConfigProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/>
159+
<see userInput="$$createConfigProductAttribute.default_value$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createConfigProduct.name$$)}}" stepKey="seeAttribute"/>
160+
<see userInput="$$getConfigAttributeOption2.label$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createConfigProduct.name$$)}}" stepKey="seeOption"/>
161+
162+
<actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/>
163+
</test>
164+
</tests>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontMoveDynamicBundleProductFromShoppingCartToWishlistTest">
12+
<annotations>
13+
<stories value="Wishlist"/>
14+
<title value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/>
15+
<description value="Move Dynamic Bundle Product from Shopping Cart to Wishlist"/>
16+
<severity value="CRITICAL"/>
17+
<testCaseId value="MAGETWO-29545"/>
18+
<group value="wishlist"/>
19+
<group value="mtf_migrated"/>
20+
</annotations>
21+
<before>
22+
<!-- Create Data -->
23+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
24+
<createData entity="_defaultCategory" stepKey="createCategory"/>
25+
<createData entity="SimpleProduct2" stepKey="simpleProduct1">
26+
<field key="price">100.00</field>
27+
</createData>
28+
<createData entity="SimpleProduct2" stepKey="simpleProduct2">
29+
<field key="price">20.00</field>
30+
</createData>
31+
<!--Create Bundle product-->
32+
<createData entity="ApiBundleProductPriceViewRange" stepKey="createBundleProduct">
33+
<requiredEntity createDataKey="createCategory"/>
34+
</createData>
35+
<createData entity="DropDownBundleOption" stepKey="createBundleOption1_1">
36+
<requiredEntity createDataKey="createBundleProduct"/>
37+
</createData>
38+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct">
39+
<requiredEntity createDataKey="createBundleProduct"/>
40+
<requiredEntity createDataKey="createBundleOption1_1"/>
41+
<requiredEntity createDataKey="simpleProduct1"/>
42+
</createData>
43+
<createData entity="ApiBundleLink" stepKey="linkOptionToProduct2">
44+
<requiredEntity createDataKey="createBundleProduct"/>
45+
<requiredEntity createDataKey="createBundleOption1_1"/>
46+
<requiredEntity createDataKey="simpleProduct2"/>
47+
</createData>
48+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin"/>
49+
<actionGroup ref="goToProductPageViaID" stepKey="goToProduct">
50+
<argument name="productId" value="$$createBundleProduct.id$$"/>
51+
</actionGroup>
52+
<scrollTo selector="{{AdminProductFormBundleSection.contentDropDown}}" stepKey="scrollToBundleSection"/>
53+
<selectOption userInput="Separately" selector="{{AdminProductFormBundleSection.shipmentType}}" stepKey="selectSeparately"/>
54+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
55+
<magentoCLI stepKey="reindex" command="indexer:reindex"/>
56+
<magentoCLI stepKey="flushCache" command="cache:flush"/>
57+
</before>
58+
<after>
59+
<!-- Delete data -->
60+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
61+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
62+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
63+
<deleteData createDataKey="simpleProduct1" stepKey="deleteProduct1"/>
64+
<deleteData createDataKey="simpleProduct2" stepKey="deleteProduct2"/>
65+
<actionGroup ref="logout" stepKey="logout"/>
66+
</after>
67+
68+
<!-- 1. Login as a customer -->
69+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
70+
<argument name="Customer" value="$$createCustomer$$"/>
71+
</actionGroup>
72+
73+
<!-- Open Product page -->
74+
<actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductFromCategory">
75+
<argument name="productUrlKey" value="$$createBundleProduct.custom_attributes[url_key]$$"/>
76+
</actionGroup>
77+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="clickCustomizeButton"/>
78+
<selectOption selector="{{StorefrontBundledSection.dropDownOptionOneProducts($$createBundleOption1_1.title$$)}}" userInput="$$simpleProduct1.sku$$ +$100.00" stepKey="selectOption0Product0"/>
79+
<fillField selector="{{StorefrontBundledSection.dropDownOptionOneQuantity($$createBundleOption1_1.title$$)}}" userInput="1" stepKey="fillQuantity00"/>
80+
81+
<!-- Add product to the cart and Assert add product to cart success message-->
82+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage">
83+
<argument name="productName" value="$$createBundleProduct.name$$"/>
84+
</actionGroup>
85+
86+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
87+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>
88+
89+
<!-- Assert move product to wishlist success message -->
90+
<click selector="{{CheckoutCartProductSection.moveToWishlistByProductName($$createBundleProduct.name$$)}}" stepKey="moveToWishlist"/>
91+
<waitForPageLoad stepKey="waitForPageLoad"/>
92+
<see userInput="$$createBundleProduct.name$$ has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertMoveProductToWishlistSuccessMessage"/>
93+
94+
<!-- Assert product is present in wishlist -->
95+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishlistPage"/>
96+
<waitForPageLoad stepKey="waitForWishlistPage"/>
97+
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName($$createBundleProduct.name$$)}}" time="30" stepKey="assertWishlistProductName"/>
98+
<see userInput="$100.00" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductPrice"/>
99+
100+
<!-- Assert product details in Wishlist -->
101+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName($$createBundleProduct.name$$)}}" stepKey="wishlistMoveMouseOverProduct"/>
102+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistAddToCart"/>
103+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName($$createBundleProduct.name$$)}}" stepKey="AssertWishlistProductImage"/>
104+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName($$createBundleProduct.name$$)}}" stepKey="seeDetailsMoveMouseOverProduct"/>
105+
<see userInput="$$createBundleOption1_1.title$$" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName($$createBundleProduct.name$$)}}" stepKey="seeBundleOption"/>
106+
<see userInput="$$simpleProduct1.sku$$ $100.00" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName($$createBundleProduct.name$$)}}" stepKey="seeProduct"/>
107+
108+
<actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/>
109+
</test>
110+
</tests>

0 commit comments

Comments
 (0)