Skip to content

Commit d4e1641

Browse files
committed
refactored AdminApplyTierPriceToProductWithPercentageDiscountTest
1 parent 479f304 commit d4e1641

File tree

2 files changed

+36
-13
lines changed

2 files changed

+36
-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: 30 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,45 @@
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="addCustomerGroupAllGroupsQty1PriceDiscountAndpercente"/>
47+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="fillProductTierPriceQtyInput"/>
48+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="selectProductTierPriceValueType"/>
49+
50+
<actionGroup ref="AdminProductFormAdvancedPricingAddTierPriceActionGroup" stepKey="selectProductTierPricePriceInput">
51+
<argument name="website" value="{{tierPrice01PercentDiscount.website}}"/>
52+
<argument name="customerGroup" value="{{tierPrice01PercentDiscount.customer_group}}"/>
53+
<argument name="quantity" value="{{tierPrice01PercentDiscount.qty}}"/>
54+
<argument name="priceType" value="Discount"/>
55+
<argument name="amount" value="{{tierPrice01PercentDiscount.price}}"/>
56+
</actionGroup>
57+
58+
<actionGroup ref="AdminProductFormDoneAdvancedPricingDialogActionGroup" stepKey="clickDoneButton"/>
4959
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct1"/>
50-
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.sku$$)}}" stepKey="goProductPageOnStorefront"/>
51-
<waitForPageLoad time="30" stepKey="waitForPageLoad1"/>
60+
61+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="goProductPageOnStorefront">
62+
<argument name="productUrl" value="$$createSimpleProduct.sku$$"/>
63+
</actionGroup>
64+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad1"/>
5265
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceProductPage"/>
5366
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceProductPage"/>
5467
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountProductPage"/>
55-
<amOnPage url="{{StorefrontCategoryPage.url($$createCategory.name$$)}}" stepKey="navigateToCategoryPage"/>
56-
<waitForPageLoad time="30" stepKey="waitForPageLoad2"/>
68+
69+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
70+
<argument name="category" value="$createCategory$"/>
71+
</actionGroup>
72+
73+
<comment userInput="Comment is added to preserve the step key for backward compatibility" stepKey="waitForPageLoad2"/>
5774
<seeElement selector="{{StorefrontCategoryProductSection.productPriceFinal('99.90')}}" stepKey="assertProductFinalPriceCategoryPage"/>
5875
<seeElement selector="{{StorefrontCategoryProductSection.productPriceLabel('Regular Price')}}" stepKey="assertRegularPriceLabelCategoryPage"/>
5976
<seeElement selector="{{StorefrontCategoryProductSection.productPriceOld('100')}}" stepKey="assertRegularPriceAmountCategoryPage"/>

0 commit comments

Comments
 (0)