Skip to content

Commit 02b28ba

Browse files
committed
ACQE-4048: [MFTF PR TESTS] AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest
- Stabilizing AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest
1 parent d75663f commit 02b28ba

File tree

1 file changed

+62
-53
lines changed

1 file changed

+62
-53
lines changed

app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest.xml

Lines changed: 62 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,42 @@
2323
<comment userInput="BIC workaround" stepKey="enableFlatRate"/>
2424
<comment userInput="BIC workaround" stepKey="performReindex"/>
2525
<comment userInput="BIC workaround" stepKey="cleanCache"/>
26+
27+
<!-- Create category for configurable product -->
28+
<createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/>
29+
30+
<!-- Create configurable product with two options -->
31+
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
32+
<requiredEntity createDataKey="firstSimpleCategory"/>
33+
</createData>
34+
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
35+
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption">
36+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
37+
</createData>
38+
<createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption">
39+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
40+
</createData>
41+
<createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet">
42+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
43+
</createData>
44+
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption">
45+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
46+
</getData>
47+
48+
<!-- Create one child product for configurable product -->
49+
<createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct">
50+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
51+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
52+
</createData>
53+
<createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption">
54+
<requiredEntity createDataKey="createFirstConfigProduct"/>
55+
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
56+
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
57+
</createData>
58+
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild">
59+
<requiredEntity createDataKey="createFirstConfigProduct"/>
60+
<requiredEntity createDataKey="createFirstConfigFirstChildProduct"/>
61+
</createData>
2662
</before>
2763

2864
<after>
@@ -32,52 +68,25 @@
3268
<deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/>
3369
<comment userInput="BIC workaround" stepKey="resetCatalogSearchConfiguration"/>
3470
<comment userInput="BIC workaround" stepKey="resetIndexerBackToOriginalState"/>
35-
<comment userInput="BIC workaround" stepKey="performReindex"/>
36-
<comment userInput="BIC workaround" stepKey="cleanCache"/>
71+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="performReindex">
72+
<argument name="indices" value=""/>
73+
</actionGroup>
74+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
75+
<argument name="tags" value="full_page"/>
76+
</actionGroup>
3777
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutOfAdmin"/>
3878
</after>
3979

40-
<!-- Create category for configurable product -->
41-
<createData entity="SimpleSubCategory" stepKey="firstSimpleCategory"/>
42-
43-
<!-- Create configurable product with two options -->
44-
<createData entity="ApiConfigurableProduct" stepKey="createFirstConfigProduct">
45-
<requiredEntity createDataKey="firstSimpleCategory"/>
46-
</createData>
47-
48-
<createData entity="productAttributeWithTwoOptions" stepKey="createFirstConfigProductAttribute"/>
49-
50-
<createData entity="productAttributeOption1" stepKey="createFirstConfigProductAttributeFirstOption">
51-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
52-
</createData>
53-
<createData entity="productAttributeOption2" stepKey="createFirstConfigProductAttributeSecondOption">
54-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
55-
</createData>
56-
57-
<createData entity="AddToDefaultSet" stepKey="addFirstProductToAttributeSet">
58-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
59-
</createData>
60-
61-
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getFirstConfigAttributeFirstOption">
62-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
63-
</getData>
64-
65-
<!-- Create one child product for configurable product -->
66-
<createData entity="ApiSimpleOne" stepKey="createFirstConfigFirstChildProduct">
67-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
68-
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
69-
</createData>
70-
71-
<createData entity="ConfigurableProductOneOption" stepKey="createFirstConfigProductOption">
72-
<requiredEntity createDataKey="createFirstConfigProduct"/>
73-
<requiredEntity createDataKey="createFirstConfigProductAttribute"/>
74-
<requiredEntity createDataKey="getFirstConfigAttributeFirstOption"/>
75-
</createData>
76-
77-
<createData entity="ConfigurableProductAddChild" stepKey="createFirstConfigProductAddFirstChild">
78-
<requiredEntity createDataKey="createFirstConfigProduct"/>
79-
<requiredEntity createDataKey="createFirstConfigFirstChildProduct"/>
80-
</createData>
80+
<comment userInput="BIC workaround" stepKey="firstSimpleCategory"/>
81+
<comment userInput="BIC workaround" stepKey="createFirstConfigProduct"/>
82+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttribute"/>
83+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttributeFirstOption"/>
84+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAttributeSecondOption"/>
85+
<comment userInput="BIC workaround" stepKey="addFirstProductToAttributeSet"/>
86+
<comment userInput="BIC workaround" stepKey="getFirstConfigAttributeFirstOption"/>
87+
<comment userInput="BIC workaround" stepKey="createFirstConfigFirstChildProduct"/>
88+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductOption"/>
89+
<comment userInput="BIC workaround" stepKey="createFirstConfigProductAddFirstChild"/>
8190

8291
<!-- Reindex -->
8392
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
@@ -88,35 +97,35 @@
8897
</actionGroup>
8998

9099
<!-- Assert first product in category -->
91-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront"/>
92-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad"/>
93-
100+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToFirstCategoryPageStorefront">
101+
<argument name="categoryUrl" value="$firstSimpleCategory.custom_attributes[url_key]$"/>
102+
</actionGroup>
103+
<comment userInput="BIC workaround" stepKey="waitForFirstCategoryPageLoad"/>
94104
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory">
95105
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
96106
<argument name="expectedPrice" value="$$createFirstConfigFirstChildProduct.price$$"/>
97107
</actionGroup>
98108

99-
<!-- Update default simple product with price -->
109+
<!-- Update simple product price -->
100110
<comment userInput="BIC workaround" stepKey="openProductCatalogPage"/>
101111
<comment userInput="BIC workaround" stepKey="filterProductGrid"/>
102112
<comment userInput="BIC workaround" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
103113
<comment userInput="BIC workaround" stepKey="waitUntilProductIsOpened"/>
104114
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
105115
<argument name="productId" value="$createFirstConfigFirstChildProduct.id$"/>
106116
</actionGroup>
117+
<waitForElementVisible selector="{{AdminProductFormSection.productPrice}}" stepKey="waitForProductPriceField"/>
107118
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="150" stepKey="fillSimpleProductPrice"/>
108119
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickButtonSave"/>
109-
110-
<!-- Verify customer see success message -->
111120
<waitForText selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
112121

113122
<!-- Assert first product in category -->
114123
<comment userInput="BIC workaround" stepKey="runCron1"/>
115124
<comment userInput="BIC workaround" stepKey="waitForUpdateStarts"/>
116-
117-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront1"/>
118-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad1"/>
119-
125+
<actionGroup ref="StorefrontNavigateToCategoryUrlActionGroup" stepKey="goToFirstCategoryPageStorefront1">
126+
<argument name="categoryUrl" value="$firstSimpleCategory.custom_attributes[url_key]$"/>
127+
</actionGroup>
128+
<comment userInput="BIC workaround" stepKey="waitForFirstCategoryPageLoad1"/>
120129
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory1">
121130
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
122131
<argument name="expectedPrice" value="150"/>

0 commit comments

Comments
 (0)