Skip to content

Commit 4b01d69

Browse files
committed
Merge remote-tracking branch 'origin/imported-magento-magento2-32120' into 2.4-develop-pr126
2 parents fd71fae + db35ad9 commit 4b01d69

File tree

5 files changed

+197
-0
lines changed

5 files changed

+197
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
<actionGroup name="AssertStorefrontProductDropDownOptionValueActionGroup">
12+
<annotations>
13+
<description>Validates that the provided Product Option is selected under the provided Drop-down Attribute.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="attributeLabel" type="string" defaultValue="{{ProductAttributeFrontendLabel.label}}"/>
17+
<argument name="optionLabel" type="string" defaultValue="{{productAttributeOption1.label}}"/>
18+
</arguments>
19+
20+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" stepKey="waitForAttributeVisible" />
21+
<seeOptionIsSelected selector="{{StorefrontProductInfoMainSection.attributeSelectByAttributeID(attributeLabel)}}" userInput="{{optionLabel}}" stepKey="assertAttributeOption"/>
22+
</actionGroup>
23+
</actionGroups>

app/code/Magento/Swatches/view/frontend/layout/wishlist_index_configure_type_configurable.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
<arguments>
1616
<argument name="configurable_view_model"
1717
xsi:type="object">Magento\Swatches\ViewModel\Product\Renderer\Configurable</argument>
18+
<argument name="cache_lifetime" xsi:type="boolean">false</argument>
1819
</arguments>
1920
</block>
2021
</referenceBlock>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<actionGroup name="StorefrontCustomerUpdateWishlistItemActionGroup">
12+
<annotations>
13+
<description>Navigates to the 'Update Wishlist Item' page by the provided Product name.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="productName" type="string" defaultValue="{{_defaultProduct.name}}"/>
17+
</arguments>
18+
19+
<waitForElementVisible selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="waitForProductInfo"/>
20+
<scrollTo selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="scrollToProduct"/>
21+
<moveMouseOver selector="{{StorefrontCustomerWishlistProductSection.ProductInfoByName(productName)}}" stepKey="mouseOverOnProduct"/>
22+
<click selector="{{StorefrontCustomerWishlistProductSection.editProduct}}" stepKey="clickEditButton"/>
23+
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="waitForProductPageLoad"/>
24+
</actionGroup>
25+
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
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="editProduct" type="button" selector=".products-grid a.action.edit" timeout="30"/>
2829
<element name="productSeeDetailsByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]" parameterized="true"/>
2930
<element name="productSeeDetailsLabelByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dt[@class='label']" parameterized="true"/>
3031
<element name="productSeeDetailsValueByName" type="block" selector="//a[contains(text(), '{{productName}}')]/ancestor::div/div[contains(@class, 'product-item-tooltip')]//dd[@class='values']" parameterized="true"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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="StorefrontUpdateConfigurableProductAttributeOptionFromWishlistTest">
12+
<annotations>
13+
<features value="Wishlist"/>
14+
<stories value="Update from Wishlist"/>
15+
<title value="Update Configurable Product Option from Wishlist"/>
16+
<description value="Verify that Configurable Product Option has correct value after navigating to Wishlist Item editing page"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MC-40881"/>
19+
<useCaseId value="MC-40651"/>
20+
<group value="catalog"/>
21+
<group value="configurableProduct"/>
22+
<group value="wishlist"/>
23+
</annotations>
24+
<before>
25+
<!-- Create Customer -->
26+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
27+
28+
<!-- Create Product Attribute with two Options -->
29+
<createData entity="productDropDownAttribute" stepKey="createConfigurableProductAttribute"/>
30+
<createData entity="productAttributeOption1" stepKey="createAttributeFirstOption">
31+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
32+
</createData>
33+
<createData entity="productAttributeOption2" stepKey="createAttributeSecondOption">
34+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
35+
</createData>
36+
37+
<!-- Add attribute to Default Attribute Set -->
38+
<createData entity="AddToDefaultSet" stepKey="addAttributeToDefaultSet">
39+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
40+
</createData>
41+
42+
<!-- Get Options of created Attribute -->
43+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigurableAttributeFirstOption">
44+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
45+
</getData>
46+
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigurableAttributeSecondOption">
47+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
48+
</getData>
49+
50+
<!-- Create Configurable Product -->
51+
<createData entity="ApiConfigurableProductWithOutCategory" stepKey="createConfigurableProduct"/>
52+
53+
<!-- Create first Simple Product and assign Attribute with Option to it -->
54+
<createData entity="ApiSimpleOne" stepKey="createFirstChildProduct">
55+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
56+
<requiredEntity createDataKey="getConfigurableAttributeFirstOption"/>
57+
</createData>
58+
59+
<!-- Create second Simple Product and assign Attribute with Option to it -->
60+
<createData entity="ApiSimpleOne" stepKey="createSecondChildProduct">
61+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
62+
<requiredEntity createDataKey="getConfigurableAttributeSecondOption"/>
63+
</createData>
64+
65+
<!-- Create Configurable Product Options -->
66+
<createData entity="ConfigurableProductTwoOptions" stepKey="createConfigurableProductOptions">
67+
<requiredEntity createDataKey="createConfigurableProduct"/>
68+
<requiredEntity createDataKey="createConfigurableProductAttribute"/>
69+
<requiredEntity createDataKey="getConfigurableAttributeFirstOption"/>
70+
<requiredEntity createDataKey="getConfigurableAttributeSecondOption"/>
71+
</createData>
72+
73+
<!-- Assign Simple Products to Configurable Product -->
74+
<createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductFirstChild">
75+
<requiredEntity createDataKey="createConfigurableProduct"/>
76+
<requiredEntity createDataKey="createFirstChildProduct"/>
77+
</createData>
78+
<createData entity="ConfigurableProductAddChild" stepKey="addConfigurableProductSecondChild">
79+
<requiredEntity createDataKey="createConfigurableProduct"/>
80+
<requiredEntity createDataKey="createSecondChildProduct"/>
81+
</createData>
82+
83+
<!-- Reindex invalidated indices after Product Attribute has been created/deleted -->
84+
<magentoCron groups="index" stepKey="reindexInvalidatedIndices"/>
85+
</before>
86+
<after>
87+
<!-- Delete Configurable Product data -->
88+
<deleteData createDataKey="createFirstChildProduct" stepKey="deleteFirstChildProduct"/>
89+
<deleteData createDataKey="createSecondChildProduct" stepKey="deleteSecondChildProduct"/>
90+
<deleteData createDataKey="createConfigurableProduct" stepKey="deleteConfigurableProduct"/>
91+
<deleteData createDataKey="createConfigurableProductAttribute" stepKey="deleteProductAttribute"/>
92+
93+
<!-- Logout from Customer account -->
94+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="logoutFromStorefront"/>
95+
96+
<!-- Delete Customer -->
97+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
98+
99+
<!-- Reindex invalidated indices after Product Attribute has been created/deleted -->
100+
<magentoCron groups="index" stepKey="reindexInvalidatedIndicesAfterDelete"/>
101+
</after>
102+
103+
<!-- Login as Customer -->
104+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
105+
<argument name="Customer" value="$createCustomer$"/>
106+
</actionGroup>
107+
108+
<!-- Open Product details page -->
109+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
110+
<argument name="productUrl" value="$createConfigurableProduct.custom_attributes[url_key]$"/>
111+
</actionGroup>
112+
113+
<!-- Select first Drop-down Attribute Option and click 'Add to Wish List' button -->
114+
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOption">
115+
<argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/>
116+
<argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/>
117+
</actionGroup>
118+
<actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist">
119+
<argument name="productVar" value="$createConfigurableProduct$"/>
120+
</actionGroup>
121+
122+
<!-- Click 'Edit Item' button from Wishlist page and assert first Option in Drop-down Attribute -->
123+
<actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItem">
124+
<argument name="productName" value="$createConfigurableProduct.name$"/>
125+
</actionGroup>
126+
<actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeFirstOption">
127+
<argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/>
128+
<argument name="optionLabel" value="$getConfigurableAttributeFirstOption.label$"/>
129+
</actionGroup>
130+
131+
<!-- Select second Drop-down Option and click 'Update Wish List' button -->
132+
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectSecondOption">
133+
<argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/>
134+
<argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/>
135+
</actionGroup>
136+
<click selector="{{StorefrontProductInfoMainSection.productAddToWishlist}}" stepKey="clickUpdateWishlist"/>
137+
138+
<!-- Click 'Edit Item' button again and assert second Option in Drop-down Attribute -->
139+
<actionGroup ref="StorefrontCustomerUpdateWishlistItemActionGroup" stepKey="clickEditWishlistItemAgain">
140+
<argument name="productName" value="$createConfigurableProduct.name$"/>
141+
</actionGroup>
142+
<actionGroup ref="AssertStorefrontProductDropDownOptionValueActionGroup" stepKey="assertAttributeSecondOption">
143+
<argument name="attributeLabel" value="$createConfigurableProductAttribute.default_frontend_label$"/>
144+
<argument name="optionLabel" value="$getConfigurableAttributeSecondOption.label$"/>
145+
</actionGroup>
146+
</test>
147+
</tests>

0 commit comments

Comments
 (0)