Skip to content

Commit 8c9c01b

Browse files
committed
ACP2E-891: Edit cart line item configurable product failed to Pre-select Production Option in 2.4.4
- Fixed the functional test build failure.
1 parent bde132a commit 8c9c01b

File tree

1 file changed

+60
-9
lines changed

1 file changed

+60
-9
lines changed

app/code/Magento/Swatches/Test/Mftf/Test/StorefrontConfigurableProductSwatchMinimumPriceTest/StorefrontValidateConfigurableProductSwatchOptionToBePreSelectFromCartEditPageTest.xml

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
*/
77
-->
88
<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">
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="StorefrontValidateConfigurableProductSwatchOptionToBePreSelectFromCartEditPageTest">
1111
<annotations>
1212
<features value="Swatches"/>
1313
<stories value="Edit cart line item configurable product failed to Pre-select Production Option in 2.4.4"/>
@@ -18,13 +18,62 @@
1818
<useCaseId value="ACP2E-891"/>
1919
<group value="Swatches"/>
2020
</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-
21+
<before>
22+
<!-- Create category -->
23+
<createData entity="ApiCategory" stepKey="createCategory"/>
24+
<!-- Login as Admin -->
25+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin1"/>
26+
</before>
27+
<after>
28+
<!-- Delete configurable product and all child products -->
29+
<actionGroup ref="DeleteProductsByKeywordActionGroup" stepKey="deleteProductsByKeyword">
30+
<argument name="keyword" value="{{_defaultProduct.sku}}"/>
31+
</actionGroup>
32+
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/>
33+
<!-- Delete category -->
34+
<deleteData createDataKey="createCategory" stepKey="deleteCategoryAttribute"/>
35+
<!-- Delete color attribute -->
36+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteColorAttribute">
37+
<argument name="ProductAttribute" value="ProductColorAttribute"/>
38+
</actionGroup>
39+
<!-- Delete size attribute -->
40+
<actionGroup ref="DeleteProductAttributeActionGroup" stepKey="deleteSizeAttribute">
41+
<argument name="ProductAttribute" value="ProductSizeAttribute"/>
42+
</actionGroup>
43+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
44+
<argument name="indices" value=""/>
45+
</actionGroup>
46+
<!-- Logout -->
47+
<actionGroup ref="AdminLogoutActionGroup" stepKey="amOnLogoutPage"/>
48+
</after>
49+
<!--Create text swatch attribute with 3 options: Black, White and Blue-->
50+
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addColorAttribute">
51+
<argument name="attributeName" value="{{ProductColorAttribute.frontend_label}}"/>
52+
<argument name="attributeCode" value="{{ProductColorAttribute.attribute_code}}"/>
53+
<argument name="option1" value="Black"/>
54+
<argument name="option2" value="White"/>
55+
<argument name="option3" value="Blue"/>
56+
<argument name="usedInProductListing" value="Yes"/>
57+
</actionGroup>
58+
<!--Create text swatch attribute with 3 options: Small, Medium and Large-->
59+
<actionGroup ref="AddTextSwatchToProductActionGroup" stepKey="addSizeAttribute">
60+
<argument name="attributeName" value="{{ProductSizeAttribute.frontend_label}}"/>
61+
<argument name="attributeCode" value="{{ProductSizeAttribute.attribute_code}}"/>
62+
<argument name="option1" value="Small"/>
63+
<argument name="option2" value="Medium"/>
64+
<argument name="option3" value="Large"/>
65+
</actionGroup>
66+
<!--Create configurable product with two attributes: Color and Size-->
67+
<actionGroup ref="CreateConfigurableProductWithTwoAttributesActionGroup" stepKey="createProduct">
68+
<argument name="product" value="_defaultProduct"/>
69+
<argument name="category" value="$$createCategory$$"/>
70+
<argument name="attribute1" value="ProductColorAttribute"/>
71+
<argument name="attribute2" value="ProductSizeAttribute"/>
72+
</actionGroup>
73+
<!--Save configurable product-->
74+
<actionGroup ref="SaveConfigurableProductActionGroup" stepKey="saveProduct">
75+
<argument name="product" value="_defaultProduct"/>
76+
</actionGroup>
2877
<!-- Go to the edit page for the "color" attribute -->
2978
<actionGroup ref="AdminOpenProductAttributePageActionGroup" stepKey="goToProductAttributes"/>
3079
<fillField selector="{{AdminProductAttributeGridSection.FilterByAttributeCode}}" userInput="{{ProductColorAttribute.attribute_code}}" stepKey="fillFilter"/>
@@ -84,6 +133,8 @@
84133
<argument name="rowNumber" value="1"/>
85134
</actionGroup>
86135

136+
<wait time="60" stepKey="testWait"/>
137+
87138
<waitForElementVisible selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Blue')}}" time="30" stepKey="waitForElementSwatchColorVisible"/>
88139

89140
<see selector="{{StorefrontProductInfoMainSection.selectedSwatchValue('Blue')}}" userInput="Blue" stepKey="seeSwatchColorRemainsSelected"/>

0 commit comments

Comments
 (0)