Skip to content

Commit 96e6fc8

Browse files
[bengals-integration-tests-mainline] Fixed flaky test AdminApplyChangePriceForConfigurableProductWithAssignedSimpleProductsTest from ACQE-4048
1 parent 349fd06 commit 96e6fc8

File tree

1 file changed

+86
-71
lines changed

1 file changed

+86
-71
lines changed

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

Lines changed: 86 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -19,98 +19,113 @@
1919

2020
<before>
2121
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
22-
<actionGroup ref="UpdateAllIndexerByScheduleActionGroup" stepKey="updateAnIndexerBySchedule"/>
23-
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
24-
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
25-
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
22+
<comment userInput="BIC workaround" stepKey="updateAnIndexerBySchedule"/>
23+
<comment userInput="BIC workaround" stepKey="enableFlatRate"/>
24+
<comment userInput="BIC workaround" stepKey="performReindex"/>
25+
<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>
2965
<deleteData createDataKey="createFirstConfigProduct" stepKey="deleteConfigProduct"/>
3066
<deleteData createDataKey="createFirstConfigFirstChildProduct" stepKey="deleteFirstConfigFirstChildProduct"/>
3167
<deleteData createDataKey="firstSimpleCategory" stepKey="deleteCategory"/>
3268
<deleteData createDataKey="createFirstConfigProductAttribute" stepKey="deleteFirstConfigProductAttribute"/>
33-
<comment userInput="The test was moved to elasticsearch suite" stepKey="resetCatalogSearchConfiguration"/>
34-
<actionGroup ref="AdminAllIndexerSetUpdateOnSaveActionGroup" stepKey="resetIndexerBackToOriginalState"/>
35-
<magentoCLI command="indexer:reindex" stepKey="performReindex"/>
36-
<magentoCLI command="cache:flush" stepKey="cleanCache"/>
69+
<comment userInput="BIC workaround" stepKey="resetCatalogSearchConfiguration"/>
70+
<comment userInput="BIC workaround" stepKey="resetIndexerBackToOriginalState"/>
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"/>
90+
91+
<!-- Reindex -->
92+
<actionGroup ref="CliIndexerReindexActionGroup" stepKey="reindex">
93+
<argument name="indices" value=""/>
94+
</actionGroup>
95+
<actionGroup ref="CliCacheCleanActionGroup" stepKey="cleanCache">
96+
<argument name="tags" value="full_page"/>
97+
</actionGroup>
8198

8299
<!-- Assert first product in category -->
83-
<magentoCLI command="cron:run" stepKey="runCron"/>
84-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront"/>
85-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad"/>
86-
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"/>
87104
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory">
88105
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
89106
<argument name="expectedPrice" value="$$createFirstConfigFirstChildProduct.price$$"/>
90107
</actionGroup>
91108

92-
<!-- Search default simple product in grid -->
93-
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
94-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="filterProductGrid"/>
95-
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
96-
<argument name="product" value="$$createFirstConfigFirstChildProduct$$"/>
109+
<!-- Update simple product price -->
110+
<comment userInput="BIC workaround" stepKey="openProductCatalogPage"/>
111+
<comment userInput="BIC workaround" stepKey="filterProductGrid"/>
112+
<comment userInput="BIC workaround" stepKey="clickFirstRowToOpenDefaultSimpleProduct"/>
113+
<comment userInput="BIC workaround" stepKey="waitUntilProductIsOpened"/>
114+
<actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openProductEditPage">
115+
<argument name="productId" value="$createFirstConfigFirstChildProduct.id$"/>
97116
</actionGroup>
98-
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitUntilProductIsOpened"/>
99-
100-
<!-- Update default simple product with price -->
117+
<waitForElementVisible selector="{{AdminProductFormSection.productPrice}}" stepKey="waitForProductPriceField"/>
101118
<fillField selector="{{AdminProductFormSection.productPrice}}" userInput="150" stepKey="fillSimpleProductPrice"/>
102-
<actionGroup ref="AdminProductFormSaveButtonClickActionGroup" stepKey="clickButtonSave"/>
103-
104-
<!-- Verify customer see success message -->
105-
<see selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
119+
<actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickButtonSave"/>
120+
<waitForText selector="{{AdminProductFormSection.successMessage}}" userInput="You saved the product." stepKey="seeAssertSimpleProductSaveSuccessMessage"/>
106121

107122
<!-- Assert first product in category -->
108-
<magentoCLI command="cron:run" stepKey="runCron1"/>
109-
<wait time="60" stepKey="waitForUpdateStarts"/>
110-
111-
<amOnPage url="{{StorefrontCategoryPage.url($$firstSimpleCategory.custom_attributes[url_key]$$)}}" stepKey="goToFirstCategoryPageStorefront1"/>
112-
<waitForPageLoad stepKey="waitForFirstCategoryPageLoad1"/>
113-
123+
<comment userInput="BIC workaround" stepKey="runCron1"/>
124+
<comment userInput="BIC workaround" stepKey="waitForUpdateStarts"/>
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"/>
114129
<actionGroup ref="StorefrontCheckCategoryConfigurableProductWithUpdatedPriceActionGroup" stepKey="checkFirstProductPriceInCategory1">
115130
<argument name="productName" value="$$createFirstConfigProduct.name$$"/>
116131
<argument name="expectedPrice" value="150"/>

0 commit comments

Comments
 (0)