Skip to content

Commit 9f9331f

Browse files
committed
MC-30682: [FT] [MFTF] [2.4] Fix flaky test AdminCreateVirtualProductWithTierPriceForGeneralGroupTest (MC-6033)
1 parent 606c3e8 commit 9f9331f

9 files changed

+200
-92
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormAdvancedPricingAddTierPriceActionGroup">
12+
<annotations>
13+
<description>Add new tier price on Advanced Pricing dialog on the Admin Product creation/edit page.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
17+
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
18+
<argument name="quantity" type="string" defaultValue="1"/>
19+
<argument name="priceType" type="string" defaultValue="Fixed"/>
20+
<argument name="amount" type="string" defaultValue="10"/>
21+
</arguments>
22+
23+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForGroupPriceAddButtonAppears"/>
24+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="clickCustomerGroupPriceAddButton"/>
25+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" stepKey="waitForPriceWebsiteInputAppears"/>
26+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceWebsite}}" userInput="{{website}}" stepKey="selectWebsite"/>
27+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceCustomerGroup}}" userInput="{{customerGroup}}" stepKey="selectCustomerGroup"/>
28+
<fillField selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceQty}}" userInput="{{quantity}}" stepKey="fillQuantity"/>
29+
<selectOption selector="{{AdminProductFormAdvancedPricingSection.lastTierPriceType}}" userInput="{{priceType}}" stepKey="selectPriceType"/>
30+
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceDiscountAmount}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.lastTierPriceFixedAmount}}&quot;" stepKey="priceAmountSelector"/>
31+
<waitForElementVisible selector="{$priceAmountSelector}" stepKey="waitPriceAmountFieldAppers"/>
32+
<fillField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="fillPriceAmount"/>
33+
</actionGroup>
34+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormCloseAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Close Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
17+
<click selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickCloseButton"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormDoneAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Done Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<scrollToTopOfPage stepKey="scrollToTopOfThePage"/>
17+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDoneButton"/>
18+
</actionGroup>
19+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminProductFormOpenAdvancedPricingDialogActionGroup">
12+
<annotations>
13+
<description>Open Advanced Pricing dialog from product form.</description>
14+
</annotations>
15+
16+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickAdvancedPricingLink"/>
17+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" stepKey="waitForModalTitleAppears"/>
18+
<see selector="{{AdminProductFormAdvancedPricingSection.modalTitle}}" userInput="Advanced Pricing" stepKey="checkModalTitle"/>
19+
</actionGroup>
20+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertAdminProductFormAdvancedPricingCheckTierPriceActionGroup">
12+
<annotations>
13+
<description>Check AdvancedPricing tier price row.</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="rowNumber" type="string" defaultValue="0"/>
17+
<argument name="website" type="string" defaultValue="All Websites [USD]"/>
18+
<argument name="customerGroup" type="string" defaultValue="ALL GROUPS"/>
19+
<argument name="quantity" type="string" defaultValue="1"/>
20+
<argument name="priceType" type="string" defaultValue="Fixed"/>
21+
<argument name="amount" type="string" defaultValue="10"/>
22+
</arguments>
23+
24+
<waitForElementVisible selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" stepKey="waitForPricesGridAppears"/>
25+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceWebsiteSelect(rowNumber)}}" userInput="{{website}}" stepKey="seeWebsite"/>
26+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceCustGroupSelect(rowNumber)}}" userInput="{{customerGroup}}" stepKey="seeCustomerGroup"/>
27+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput(rowNumber)}}" userInput="{{quantity}}" stepKey="seeQuantity"/>
28+
<seeInField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceValueTypeSelect(rowNumber)}}" userInput="{{priceType}}" stepKey="seePriceType"/>
29+
<executeJS function="return '{{priceType}}' == 'Discount' ? &quot;{{AdminProductFormAdvancedPricingSection.productTierPricePercentageValuePriceInput(rowNumber)}}&quot; : &quot;{{AdminProductFormAdvancedPricingSection.productTierPriceFixedPriceInput(rowNumber)}}&quot;" stepKey="priceAmountSelector"/>
30+
<seeInField selector="{$priceAmountSelector}" userInput="{{amount}}" stepKey="seePriceAmount"/>
31+
</actionGroup>
32+
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/ActionGroup/SetProductUrlKeyByStringActionGroup.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<argument name="urlKey" type="string"/>
1717
</arguments>
1818

19-
<click selector="{{AdminProductSEOSection.sectionHeader}}" stepKey="openSeoSection"/>
19+
<conditionalClick selector="{{AdminProductSEOSection.sectionHeader}}" dependentSelector="{{AdminProductSEOSection.urlKeyInput}}" visible="false" stepKey="openSeoSection"/>
2020
<fillField userInput="{{urlKey}}" selector="{{AdminProductSEOSection.urlKeyInput}}" stepKey="fillUrlKey"/>
2121
</actionGroup>
2222
</actionGroups>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,7 @@
756756
<data key="status">In Stock</data>
757757
<data key="visibility">Catalog, Search</data>
758758
<data key="urlKey" unique="suffix">virtual-product</data>
759+
<data key="storefrontStatus">IN STOCK</data>
759760
<data key="type_id">virtual</data>
760761
</entity>
761762
<entity name="virtualProductCustomImportOptions" type="product">

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductFormAdvancedPricingSection.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,13 @@
2525
<element name="msrp" type="input" selector="//input[@name='product[msrp]']" timeout="30"/>
2626
<element name="msrpType" type="select" selector="//select[@name='product[msrp_display_actual_price_type]']" timeout="30"/>
2727
<element name="save" type="button" selector="#save-button" timeout="30"/>
28+
<element name="modalTitle" type="text" selector="aside.product_form_product_form_advanced_pricing_modal h1.modal-title"/>
29+
<!-- Last row tier price elements-->
30+
<element name="lastTierPriceWebsite" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[website_id]']"/>
31+
<element name="lastTierPriceCustomerGroup" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[cust_group]']"/>
32+
<element name="lastTierPriceQty" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[price_qty]']"/>
33+
<element name="lastTierPriceType" type="select" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[value_type]']"/>
34+
<element name="lastTierPriceFixedAmount" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[price]']"/>
35+
<element name="lastTierPriceDiscountAmount" type="input" selector="[data-index='tier_price'] table tbody tr.data-row:last-child [name*='[percentage_value]']"/>
2836
</section>
2937
</sections>

0 commit comments

Comments
 (0)