Skip to content

Commit cb5fe98

Browse files
committed
ACP2E-891: Edit cart line item configurable product failed to Pre-select Production Option in 2.4.4
- Added the test coverage.
1 parent b5130de commit cb5fe98

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed
Lines changed: 23 additions & 0 deletions
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="OpenSwatchMenuAndChooseColorByIndexActionGroup">
12+
<annotations>
13+
<description>Open the Swatch Menu and choose color based on the provided Index.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="index" type="string" defaultValue="0"/>
17+
</arguments>
18+
19+
<!-- I had to use executeJS to perform the click to get around the use of CSS ::before and ::after -->
20+
<executeJS function="jQuery('#swatch-visual-options-panel > table > tbody > tr:nth-child({{index}}) > td.swatches-visual-col.col-default input').click()" stepKey="clickSwatch"/>
21+
<click selector="{{AdminManageSwatchSection.nthChooseColor(index)}}" stepKey="clickChooseColor2"/>
22+
</actionGroup>
23+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
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="StorefrontValidateConfigurableProductSwatchOptionToBePreSelectFromCartEditPageTest" extends="StorefrontConfigurableProductSwatchMinimumPriceProductPageTest">
11+
<annotations>
12+
<features value="Swatches"/>
13+
<stories value="Edit cart line item configurable product failed to Pre-select Production Option in 2.4.4"/>
14+
<title value="Validate configurable product swatch option to be pre-select when user edit from cart edit page."/>
15+
<description value="Validate configurable product swatch option to be pre-select when user edit from cart edit page."/>
16+
<severity value="AVERAGE"/>
17+
<testCaseId value=""/>
18+
<useCaseId value="ACP2E-891"/>
19+
<group value="Swatches"/>
20+
</annotations>
21+
<remove keyForRemoval="amOnConfigurableProductPage"/>
22+
<remove keyForRemoval="waitForConfigurableProductPage"/>
23+
<remove keyForRemoval="assertProductPrice"/>
24+
<remove keyForRemoval="assertMinimumPriceForBlackOption"/>
25+
<remove keyForRemoval="assertMinimumPriceForWhiteOption"/>
26+
<remove keyForRemoval="assertMinimumPriceForBlueOption"/>
27+
28+
<!-- Go to the edit page for the "color" attribute -->
29+
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
30+
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductColorAttribute.attribute_code}}" stepKey="fillFilter"/>
31+
<click selector="{{AdminProductAttributeGridSection.Search}}" stepKey="clickSearch"/>
32+
<click selector="{{AdminProductAttributeGridSection.AttributeCode(ProductColorAttribute.attribute_code)}}" stepKey="clickRowToEdit"/>
33+
34+
<!-- Change to visual swatches -->
35+
<selectOption selector="{{AdminNewAttributePanel.inputType}}" userInput="swatch_visual" stepKey="selectVisualSwatch"/>
36+
37+
<!-- Set swatch #1 using the color picker -->
38+
<actionGroup ref="OpenSwatchMenuAndChooseColorByIndexActionGroup" stepKey="clickSwatchAndChooseColor1">
39+
<argument name="index" value="1"/>
40+
</actionGroup>
41+
<actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex1">
42+
<argument name="nthColorPicker" value="1"/>
43+
<argument name="hexColor" value="0a0a0a"/>
44+
</actionGroup>
45+
<!-- Set swatch #2 using the color picker -->
46+
<actionGroup ref="OpenSwatchMenuAndChooseColorByIndexActionGroup" stepKey="clickSwatchAndChooseColor2">
47+
<argument name="index" value="2"/>
48+
</actionGroup>
49+
<actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex2">
50+
<argument name="nthColorPicker" value="2"/>
51+
<argument name="hexColor" value="ededf0"/>
52+
</actionGroup>
53+
<!-- Set swatch #3 using the color picker -->
54+
<actionGroup ref="OpenSwatchMenuAndChooseColorByIndexActionGroup" stepKey="clickSwatchAndChooseColor3">
55+
<argument name="index" value="3"/>
56+
</actionGroup>
57+
<actionGroup ref="SetColorPickerByHexActionGroup" stepKey="fillHex3">
58+
<argument name="nthColorPicker" value="3"/>
59+
<argument name="hexColor" value="1138c2"/>
60+
</actionGroup>
61+
<waitForPageLoad stepKey="waitToClickSave"/>
62+
63+
<!-- Save -->
64+
<click selector="{{AttributePropertiesSection.SaveAndEdit}}" stepKey="clickSaveAndEdit1"/>
65+
<waitForElementVisible selector="{{AdminProductMessagesSection.successMessage}}" stepKey="waitForSuccess"/>
66+
67+
<!--Go to product page-->
68+
<amOnPage url="{{StorefrontProductPage.url(_defaultProduct.urlKey)}}" stepKey="goToConfigurableProductPage"/>
69+
<waitForPageLoad stepKey="waitForLoadConfigurableProductPage"/>
70+
71+
<actionGroup ref="StorefrontSelectSwatchOptionOnProductPageActionGroup" stepKey="selectBlueOption">
72+
<argument name="optionName" value="Blue"/>
73+
</actionGroup>
74+
75+
<actionGroup ref="StorefrontAddProductWithSwatchesTextOptionToTheCartActionGroup" stepKey="addConfigurableProductToTheCart">
76+
<argument name="productQty" value="1"/>
77+
<argument name="product" value="ApiConfigurableProduct"/>
78+
<argument name="productOption" value="Medium"/>
79+
</actionGroup>
80+
81+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openShoppingCartPage"/>
82+
83+
<actionGroup ref="StorefrontUpdateCartItemEditParametersProductActionGroup" stepKey="updateCartItem">
84+
<argument name="rowNumber" value="1"/>
85+
</actionGroup>
86+
87+
<see selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Blue')}}" userInput="Blue" stepKey="seeSwatchColorRemainsSelected"/>
88+
<see selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Medium')}}" userInput="Medium" stepKey="seeSwatchSizeRemainsSelected"/>
89+
</test>
90+
</tests>

0 commit comments

Comments
 (0)