Skip to content

Commit bce29bd

Browse files
committed
MC-4527: Convert VerifyConfigurableProductEntityPriceTest to MFTF
- Make use of extends
1 parent 0796797 commit bce29bd

File tree

2 files changed

+30
-138
lines changed

2 files changed

+30
-138
lines changed

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

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
<before>
2121
<!-- Login as Admin -->
2222
<actionGroup ref="LoginAsAdmin" stepKey="loginToAdminPanel"/>
23+
2324
<!-- Create Default Category -->
2425
<createData entity="_defaultCategory" stepKey="createCategory"/>
26+
2527
<!-- Create an attribute with three options to be used in the first child product -->
2628
<createData entity="productAttributeWithTwoOptions" stepKey="createConfigProductAttribute"/>
2729
<createData entity="productAttributeOption1" stepKey="createConfigProductAttributeOption1">
@@ -33,44 +35,53 @@
3335
<createData entity="productAttributeOption3" stepKey="createConfigProductAttributeOption3">
3436
<requiredEntity createDataKey="createConfigProductAttribute"/>
3537
</createData>
38+
3639
<!-- Add the attribute just created to default attribute set -->
3740
<createData entity="AddToDefaultSet" stepKey="createConfigAddToAttributeSet">
3841
<requiredEntity createDataKey="createConfigProductAttribute"/>
3942
</createData>
43+
4044
<!-- Get the first option of the attribute created -->
4145
<getData entity="ProductAttributeOptionGetter" index="1" stepKey="getConfigAttributeOption1">
4246
<requiredEntity createDataKey="createConfigProductAttribute"/>
4347
</getData>
48+
4449
<!-- Get the second option of the attribute created -->
4550
<getData entity="ProductAttributeOptionGetter" index="2" stepKey="getConfigAttributeOption2">
4651
<requiredEntity createDataKey="createConfigProductAttribute"/>
4752
</getData>
53+
4854
<!-- Get the third option of the attribute created -->
4955
<getData entity="ProductAttributeOptionGetter" index="3" stepKey="getConfigAttributeOption3">
5056
<requiredEntity createDataKey="createConfigProductAttribute"/>
5157
</getData>
58+
5259
<!-- Create Configurable product -->
5360
<createData entity="BaseConfigurableProduct" stepKey="createConfigProduct">
5461
<requiredEntity createDataKey="createCategory"/>
5562
</createData>
63+
5664
<!-- Create a simple product and give it the attribute with the first option -->
5765
<createData entity="ApiSimpleOne" stepKey="createConfigChildProduct1">
5866
<requiredEntity createDataKey="createConfigProductAttribute"/>
5967
<requiredEntity createDataKey="getConfigAttributeOption1"/>
6068
<field key="price">10.00</field>
6169
</createData>
70+
6271
<!--Create a simple product and give it the attribute with the second option -->
6372
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct2">
6473
<requiredEntity createDataKey="createConfigProductAttribute"/>
6574
<requiredEntity createDataKey="getConfigAttributeOption2"/>
6675
<field key="price">20.00</field>
6776
</createData>
77+
6878
<!--Create a simple product and give it the attribute with the Third option -->
6979
<createData entity="ApiSimpleTwo" stepKey="createConfigChildProduct3">
70-
<requiredEntity createDataKey="createConfigProductAttribute"/>
80+
<requiredEntity createDataKey="createConfigProductAttribute"/>
7181
<requiredEntity createDataKey="getConfigAttributeOption3"/>
7282
<field key="price">30.00</field>
7383
</createData>
84+
7485
<!-- Create the configurable product -->
7586
<createData entity="ConfigurableProductThreeOptions" stepKey="createConfigProductOption">
7687
<requiredEntity createDataKey="createConfigProduct"/>
@@ -79,16 +90,19 @@
7990
<requiredEntity createDataKey="getConfigAttributeOption2"/>
8091
<requiredEntity createDataKey="getConfigAttributeOption3"/>
8192
</createData>
93+
8294
<!-- Add the first simple product to the configurable product -->
8395
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild1">
8496
<requiredEntity createDataKey="createConfigProduct"/>
8597
<requiredEntity createDataKey="createConfigChildProduct1"/>
8698
</createData>
99+
87100
<!-- Add the second simple product to the configurable product -->
88101
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild2">
89102
<requiredEntity createDataKey="createConfigProduct"/>
90103
<requiredEntity createDataKey="createConfigChildProduct2"/>
91104
</createData>
105+
92106
<!-- Add the third simple product to the configurable product -->
93107
<createData entity="ConfigurableProductAddChild" stepKey="createConfigProductAddChild3">
94108
<requiredEntity createDataKey="createConfigProduct"/>
@@ -105,24 +119,29 @@
105119
<deleteData createDataKey="createConfigProductAttribute" stepKey="deleteAttribute"/>
106120
<actionGroup ref="logout" stepKey="logout"/>
107121
</after>
122+
108123
<!-- Open Product in Store Front Page -->
109124
<amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront"/>
110125
<waitForPageLoad stepKey="waitForProductToLoad"/>
126+
111127
<!-- Verify category,Configurable product and initial price -->
112128
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage"/>
113129
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront"/>
114130
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeInitialPriceInStoreFront"/>
115131
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront"/>
116132
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront"/>
133+
117134
<!-- Verify First Child Product attribute option is displayed -->
118135
<see selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="seeOption1"/>
136+
119137
<!-- Select product Attribute option1, option2 and option3 and verify changes in the price -->
120138
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="selectOption1"/>
121139
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct1.price$$" stepKey="seeChildProduct1PriceInStoreFront"/>
122140
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectOption2"/>
123141
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeChildProduct2PriceInStoreFront"/>
124142
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption3.label$$" stepKey="selectOption3"/>
125143
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct3.price$$" stepKey="seeChildProduct3PriceInStoreFront"/>
144+
126145
<!-- Open Product Index Page and Filter First Child product -->
127146
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/>
128147
<waitForPageLoad stepKey="waitForProductIndexPageToLoad"/>
@@ -131,22 +150,27 @@
131150
</actionGroup>
132151
<click selector="{{AdminProductGridFilterSection.nthRow('1')}}" stepKey="selectFirstRow"/>
133152
<waitForPageLoad stepKey="waitForProductPageToLoad"/>
153+
134154
<!-- Disable the product -->
135155
<click selector="{{AdminProductFormSection.enableProductLabel}}" stepKey="disableProduct"/>
136156
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
137157
<waitForLoadingMaskToDisappear stepKey="waitForLoading"/>
138158
<see selector="{{AdminCategoryMessagesSection.SuccessMessage}}" userInput="You saved the product." stepKey="messageYouSavedTheProductIsShown"/>
159+
139160
<!-- Open Product Store Front Page -->
140161
<amOnPage url="$$createConfigProduct.sku$$.html" stepKey="openProductInStoreFront1"/>
141162
<waitForPageLoad stepKey="waitForProductToLoad1"/>
163+
142164
<!-- Verify category,configurable product and updated price -->
143165
<seeElement selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="seeCategoryInFrontPage1"/>
144166
<see selector="{{StorefrontProductInfoMainSection.productName}}" userInput="$$createConfigProduct.name$$" stepKey="seeProductNameInStoreFront1"/>
145167
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeUpdatedProductPriceInStoreFront"/>
146168
<see selector="{{StorefrontProductInfoMainSection.productSku}}" userInput="$$createConfigProduct.sku$$" stepKey="seeProductSkuInStoreFront1"/>
147169
<see selector="{{StorefrontProductInfoMainSection.productStockStatus}}" userInput="In Stock" stepKey="seeProductStatusInStoreFront1"/>
170+
148171
<!-- Verify product Attribute Option1 is not displayed -->
149172
<dontSee selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption1.label$$" stepKey="dontSeeOption1"/>
173+
150174
<!--Select product Attribute option2 and option3 and verify changes in the price -->
151175
<selectOption selector="{{StorefrontProductInfoMainSection.productOptionSelect($$createConfigProductAttribute.default_value$$)}}" userInput="$$getConfigAttributeOption2.label$$" stepKey="selectTheOption2"/>
152176
<see selector="{{StorefrontProductInfoMainSection.productPrice}}" userInput="$$createConfigChildProduct2.price$$" stepKey="seeSecondChildProductPriceInStoreFront"/>

0 commit comments

Comments
 (0)