Skip to content

Commit c61ce63

Browse files
ENGCOM-8522: [MFTF] Refactoring of AdminApplyTierPriceToProductWithPercentageDiscountTest #31147
2 parents c6d0b8e + 3a160ee commit c61ce63

File tree

2 files changed

+37
-13
lines changed

2 files changed

+37
-13
lines changed

app/code/Magento/Catalog/Test/Mftf/Data/TierPriceData.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,10 @@
8080
<data key="quantity">1</data>
8181
<var key="sku" entityType="product" entityKey="sku" />
8282
</entity>
83+
<entity name="tierPrice01PercentDiscount" type="data">
84+
<data key="website">All Websites [USD]</data>
85+
<data key="customer_group">ALL GROUPS</data>
86+
<data key="price">0.1</data>
87+
<data key="qty">1</data>
88+
</entity>
8389
</entities>

app/code/Magento/Catalog/Test/Mftf/Test/AdminApplyTierPriceToProductTest/AdminApplyTierPriceToProductWithPercentageDiscountTest.xml

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
<requiredEntity createDataKey="createCategory"/>
2424
<field key="price">100</field>
2525
</createData>
26+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminInBefore"/>
2627
</before>
2728
<after>
2829
<deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/>
@@ -31,29 +32,46 @@
3132
<actionGroup ref="ResetProductGridToDefaultViewActionGroup" stepKey="resetGridToDefaultKeywordSearch"/>
3233
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
3334
</after>
34-
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
35+
36+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="loginAsAdmin"/>
3537
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchForSimpleProduct">
3638
<argument name="product" value="$$createSimpleProduct$$"/>
3739
</actionGroup>
3840
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct1">
3941
<argument name="product" value="$$createSimpleProduct$$"/>
4042
</actionGroup>
41-
<scrollToTopOfPage stepKey="scrollToTopOfPage"/>
42-
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingButton"/>
43-
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForCustomerGroupPriceAddButton"/>
44-
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/>
45-
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="1" stepKey="fillProductTierPriceQtyInput"/>
46-
<selectOption selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect('0')}}" userInput="Discount" stepKey="selectProductTierPriceValueType"/>
47-
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput('0')}}" userInput="0.1" stepKey="selectProductTierPricePriceInput"/>
48-
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
43+
44+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="scrollToTopOfPage"/>
45+
<actionGroup ref="AdminProductFormOpenAdvancedPricingDialogActionGroup" stepKey="clickOnAdvancedPricingButton"/>
46+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForCustomerGroupPriceAddButton"/>
47+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="addCustomerGroupAllGroupsQty1PriceDiscountAndpercent"/>
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/>
49+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/>
50+
51+
<actionGroup ref="AdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="selectProductTierPricePriceInput">
52+
<argument name="website" value="{{tierPrice01PercentDiscount.website}}"/>
53+
<argument name="customerGroup" value="{{tierPrice01PercentDiscount.customer_group}}"/>
54+
<argument name="quantity" value="{{tierPrice01PercentDiscount.qty}}"/>
55+
<argument name="priceType" value="Discount"/>
56+
<argument name="amount" value="{{tierPrice01PercentDiscount.price}}"/>
57+
</actionGroup>
58+
59+
<actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="clickDoneButton"/>
4960
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/>
50-
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/>
51-
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
61+
62+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront">
63+
<argument name="productUrl" value="$$createSimpleProduct.sku$$"/>
64+
</actionGroup>
65+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/>
5266
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/>
5367
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceProductPage"/>
5468
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountProductPage"/>
55-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/>
56-
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
69+
70+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
71+
<argument name="category" value="$createCategory$"/>
72+
</actionGroup>
73+
74+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/>
5775
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceCategoryPage"/>
5876
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabelCategoryPage"/>
5977
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountCategoryPage"/>

0 commit comments

Comments
 (0)