Skip to content

Commit 5b829a8

Browse files
authored
Merge branch '2.4-develop' into remove_magento_customer_recurring_data
2 parents 2b8599a + 2f06719 commit 5b829a8

11 files changed

+605
-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"/>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminDeleteCategoryUrlRewriteHypenAsRequestPathTest">
11+
<annotations>
12+
<features value="UrlRewrite" />
13+
<stories value="Delete custom URL rewrite"/>
14+
<title value="Delete category URL rewrite, hyphen as request path"/>
15+
<description value="Delete category URL rewrite, hyphen as request path"/>
16+
<testCaseId value="MC-5348" />
17+
<group value="urlRewrite"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
23+
<createData entity="_defaultCategory" stepKey="category"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
</after>
29+
30+
<!--Create the Category Url Rewrite-->
31+
<actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewrite">
32+
<argument name="category" value="$$category.name$$"/>
33+
<argument name="customUrlRewriteValue" value="For Category"/>
34+
<argument name="storeValue" value="Default Store View"/>
35+
<argument name="requestPath" value="-"/>
36+
<argument name="redirectTypeValue" value="No"/>
37+
<argument name="description" value="End To End Test"/>
38+
</actionGroup>
39+
40+
<!--Delete the Category Url Rewrite-->
41+
<actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewrite">
42+
<argument name="requestPath" value="-"/>
43+
</actionGroup>
44+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessage">
45+
<argument name="message" value="You deleted the URL rewrite."/>
46+
</actionGroup>
47+
48+
<!--Verify AssertPageByUrlRewriteIsNotFound-->
49+
<actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontend">
50+
<argument name="requestPath" value="-"/>
51+
</actionGroup>
52+
53+
</test>
54+
</tests>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminDeleteCategoryUrlRewriteWithRequestPathTest">
11+
<annotations>
12+
<features value="UrlRewrite" />
13+
<stories value="Delete custom URL rewrite"/>
14+
<title value="Delete category URL rewrite, with request path"/>
15+
<description value="Delete category URL rewrite, with request path"/>
16+
<testCaseId value="MC-5349" />
17+
<group value="urlRewrite"/>
18+
<group value="mtf_migrated"/>
19+
</annotations>
20+
21+
<before>
22+
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
23+
<createData entity="_defaultCategory" stepKey="category"/>
24+
</before>
25+
<after>
26+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
27+
<actionGroup ref="logout" stepKey="logout"/>
28+
</after>
29+
30+
<!--Create the Category Url Rewrite-->
31+
<actionGroup ref="AdminAddUrlRewrite" stepKey="addUrlRewriteSecondTime">
32+
<argument name="category" value="$$category.name$$"/>
33+
<argument name="customUrlRewriteValue" value="For Category"/>
34+
<argument name="storeValue" value="Default Store View"/>
35+
<argument name="requestPath" value="newrequestpath.html"/>
36+
<argument name="redirectTypeValue" value="No"/>
37+
<argument name="description" value="End To End Test"/>
38+
</actionGroup>
39+
40+
<!--Delete the Category Url Rewrite-->
41+
<actionGroup ref="AdminDeleteUrlRewrite" stepKey="deleteCustomUrlRewriteSecondTime">
42+
<argument name="requestPath" value="newrequestpath.html"/>
43+
</actionGroup>
44+
<actionGroup ref="AssertMessageInAdminPanelActionGroup" stepKey="assertSuccessMessageSecondTime">
45+
<argument name="message" value="You deleted the URL rewrite."/>
46+
</actionGroup>
47+
48+
<!--Verify AssertPageByUrlRewriteIsNotFound-->
49+
<actionGroup ref="AssertPageByUrlRewriteIsNotFound" stepKey="checkUrlOnFrontendSecondTime">
50+
<argument name="requestPath" value="newrequestpath.html"/>
51+
</actionGroup>
52+
53+
</test>
54+
</tests>

app/code/Magento/Wishlist/Test/Mftf/ActionGroup/StorefrontCustomerWishlistActionGroup.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,47 @@
135135
<dontSeeElement selector="{{StorefrontCustomerWishlistProductSection.pager}}" stepKey="checkThatPagerIsAbsent"/>
136136
<see selector="{{StorefrontCustomerWishlistProductSection.wishlistEmpty}}" userInput="You have no items in your wish list." stepKey="checkNoItemsMessage"/>
137137
</actionGroup>
138+
139+
<actionGroup name="AssertMoveProductToWishListSuccessMessage">
140+
<annotations>
141+
<description>Moves a product from the cart to the wishlist.</description>
142+
</annotations>
143+
<arguments>
144+
<argument name="productName" type="string"/>
145+
</arguments>
146+
<click selector="{{CheckoutCartProductSection.moveToWishlistByProductName(productName)}}" stepKey="moveToWishlist"/>
147+
<waitForPageLoad stepKey="waitForMove"/>
148+
<see userInput="{{productName}} has been moved to your wish list." selector="{{CheckoutCartMessageSection.successMessage}}" stepKey="assertSuccess"/>
149+
</actionGroup>
150+
151+
<actionGroup name="AssertProductIsPresentInWishList">
152+
<annotations>
153+
<description>Go to storefront customer wishlist page and assert product name and price is present.</description>
154+
</annotations>
155+
<arguments>
156+
<argument name="productName" type="string"/>
157+
<argument name="productPrice" type="string"/>
158+
</arguments>
159+
<amOnPage url="{{StorefrontCustomerWishlistPage.url}}" stepKey="goToWishList"/>
160+
<waitForPageLoad stepKey="waitForWishList"/>
161+
<waitForElement selector="{{StorefrontCustomerWishlistProductSection.ProductTitleByName(productName)}}" time="30" stepKey="assertProductName"/>
162+
<see userInput="{{productPrice}}" selector="{{StorefrontCustomerWishlistProductSection.ProductPriceByName(productName)}}" stepKey="assertProductPrice"/>
163+
</actionGroup>
164+
165+
<actionGroup name="AssertProductDetailsInWishlist">
166+
<annotations>
167+
<description>Assert product name and price in wishlist on hover.</description>
168+
</annotations>
169+
<arguments>
170+
<argument name="productName" type="string"/>
171+
<argument name="label" type="string"/>
172+
<argument name="labelValue" type="string"/>
173+
</arguments>
174+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="moveMouseOverProductInfo"/>
175+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductAddToCartByName(productName)}}" stepKey="seeAddToCart"/>
176+
<seeElement selector="{{StorefrontCustomerWishlistProductSection.ProductImageByName(productName)}}" stepKey="seeImage"/>
177+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsByName(productName)}}" stepKey="moveMouseOverProductDetails"/>
178+
<see userInput="{{label}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsLabelByName(productName)}}" stepKey="seeLabel"/>
179+
<see userInput="{{labelValue}}" selector="{{StorefrontCustomerWishlistProductSection.productSeeDetailsValueByName(productName)}}" stepKey="seeLabelValue"/>
180+
</actionGroup>
138181
</actionGroups>

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,166 @@
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="MC-14211"/>
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+
110+
<magentoCLI command="indexer:reindex" stepKey="reindex"/>
111+
<magentoCLI command="cache:flush" stepKey="flushCache"/>
112+
</before>
113+
<after>
114+
<!-- Delete data -->
115+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
116+
<deleteData createDataKey="createConfigChildProduct1" stepKey="deleteSimpleProduct1"/>
117+
<deleteData createDataKey="createConfigChildProduct2" stepKey="deleteSimpleProduct2"/>
118+
<deleteData createDataKey="createConfigChildProduct3" stepKey="deleteSimpleProduct3"/>
119+
<deleteData createDataKey="createConfigProduct" stepKey="deleteProduct"/>
120+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
121+
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteProductAttribute"/>
122+
<actionGroup ref="logout" stepKey="logout"/>
123+
</after>
124+
125+
<!-- 1. Login as a customer -->
126+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount">
127+
<argument name="Customer" value="$$createCustomer$$"/>
128+
</actionGroup>
129+
130+
<!-- Open Product page -->
131+
<actionGroup ref="OpenProductFromCategoryPageActionGroup" stepKey="openProductFromCategory">
132+
<argument name="category" value="$$createCategory$$"/>
133+
<argument name="product" value="$$createConfigProduct$$"/>
134+
</actionGroup>
135+
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption1"/>
136+
<scrollTo selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" y="-200" stepKey="scroll"/>
137+
138+
<!-- Add product to the cart and Assert add product to cart success message-->
139+
<actionGroup ref="addToCartFromStorefrontProductPage" stepKey="addToCartVirtualProductFromStorefrontProductPage">
140+
<argument name="productName" value="$$createConfigProduct.name$$"/>
141+
</actionGroup>
142+
143+
<!-- Select Mini Cart and select 'View And Edit Cart' -->
144+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="selectViewAndEditCart"/>
145+
146+
<!-- Assert move product to wishlist success message -->
147+
<actionGroup ref="AssertMoveProductToWishListSuccessMessage" stepKey="moveToWishlist">
148+
<argument name="productName" value="$$createConfigProduct.name$$"/>
149+
</actionGroup>
150+
151+
<!-- Assert product is present in wishlist -->
152+
<actionGroup ref="AssertProductIsPresentInWishList" stepKey="assertProductPresent">
153+
<argument name="productName" value="$$createConfigProduct.name$$"/>
154+
<argument name="productPrice" value="$20.00"/>
155+
</actionGroup>
156+
157+
<!-- Assert product details in Wishlist -->
158+
<actionGroup ref="AssertProductDetailsInWishlist" stepKey="assertProductDetails">
159+
<argument name="productName" value="$$createConfigProduct.name$$"/>
160+
<argument name="label" value="$$createConfigProductAttribute.default_value$$"/>
161+
<argument name="labelValue" value="$$getConfigAttributeOption2.label$$"/>
162+
</actionGroup>
163+
164+
<actionGroup ref="AssertShoppingCartIsEmptyActionGroup" stepKey="assertCartIsEmpty"/>
165+
</test>
166+
</tests>

0 commit comments

Comments
 (0)