Skip to content

Commit fe5880f

Browse files
author
Oleksandr Iegorov
committed
Merge branch 'MAGETWO-96026' of github.com:magento-tango/magento2ce into PR-1911
2 parents 069d5cd + 3343ad6 commit fe5880f

File tree

4 files changed

+113
-0
lines changed

4 files changed

+113
-0
lines changed

app/code/Magento/Catalog/Test/Mftf/Page/AdminProductCreatePage.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
<section name="AdminProductMessagesSection"/>
1818
<section name="AdminProductFormRelatedUpSellCrossSellSection"/>
1919
<section name="AdminProductFormAdvancedPricingSection"/>
20+
<section name="AdminProductFormAdvancedInventorySection"/>
2021
</page>
2122
</pages>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
11+
<section name="AdminProductFormAdvancedInventorySection">
12+
<element name="enableQtyIncrements" type="select" selector="//*[@name='product[stock_data][enable_qty_increments]']"/>
13+
<element name="enableQtyIncrementsOptions" type="select" selector="//*[@name='product[stock_data][enable_qty_increments]']//option[contains(@value, '{{var1}}')]" parameterized="true"/>
14+
<element name="enableQtyIncrementsUseConfigSettings" type="checkbox" selector="//input[@name='product[stock_data][use_config_enable_qty_inc]']"/>
15+
<element name="qtyUsesDecimals" type="select" selector="//*[@name='product[stock_data][is_qty_decimal]']"/>
16+
<element name="qtyUsesDecimalsOptions" type="select" selector="//*[@name='product[stock_data][is_qty_decimal]']//option[contains(@value, '{{var1}}')]" parameterized="true"/>
17+
<element name="qtyIncrements" type="input" selector="//input[@name='product[stock_data][qty_increments]']"/>
18+
<element name="qtyIncrementsUseConfigSettings" type="checkbox" selector="//input[@name='product[stock_data][use_config_qty_increments]']"/>
19+
<element name="doneButton" type="button" selector="//aside[contains(@class,'product_form_product_form_advanced_inventory_modal')]//button[contains(@data-role,'action')]" timeout="5"/>
20+
</section>
21+
</sections>
22+
23+
24+
25+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<element name="advancedPricingLink" type="button" selector="button[data-index='advanced_pricing_button']"/>
2929
<element name="categoriesDropdown" type="multiselect" selector="div[data-index='category_ids']"/>
3030
<element name="productQuantity" type="input" selector=".admin__field[data-index=qty] input"/>
31+
<element name="advancedInventoryLink" type="button" selector="//button[contains(@data-index, 'advanced_inventory_button')]"/>
3132
<element name="productStockStatus" type="select" selector="select[name='product[quantity_and_stock_status][is_in_stock]']"/>
3233
<element name="productWeight" type="input" selector=".admin__field[data-index=weight] input"/>
3334
<element name="productWeightSelect" type="select" selector="select[name='product[product_has_weight]']"/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd">
11+
<test name="TieredPricingAndQuantityIncrementsWorkWithDecimalinventoryTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Tiered pricing and quantity increments work with decimal inventory"/>
15+
<title value="Tiered pricing and quantity increments work with decimal inventory"/>
16+
<description value="Tiered pricing and quantity increments work with decimal inventory"/>
17+
<severity value="CRITICAL"/>
18+
<testCaseId value="MAGETWO-93973"/>
19+
<group value="Catalog"/>
20+
</annotations>
21+
<before>
22+
<createData entity="_defaultCategory" stepKey="createPreReqCategory"/>
23+
<createData entity="SimpleProduct" stepKey="createPreReqSimpleProduct">
24+
<requiredEntity createDataKey="createPreReqCategory"/>
25+
</createData>
26+
</before>
27+
<after>
28+
<deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/>
29+
<deleteData createDataKey="createPreReqSimpleProduct" stepKey="deletePreReqSimpleProduct"/>
30+
</after>
31+
<!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit-->
32+
<actionGroup ref="LoginAsAdmin" stepKey="LoginAsAdmin" />
33+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions">
34+
<argument name="product" value="SimpleProduct"/>
35+
</actionGroup>
36+
<click selector="{{AdminProductGridSection.productGridNameProduct('$$createPreReqSimpleProduct.name$$')}}"
37+
stepKey="clickOpenProductForEdit"/>
38+
<waitForPageLoad time="30" stepKey="waitForProductEditOpen"/>
39+
<!--Step2. Open *Advanced Inventory* pop-up (Click on *Advanced Inventory* link). Set *Qty Uses Decimals* to *Yes*. Click on button *Done* -->
40+
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink"/>
41+
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="scrollToQtyUsesDecimalsDropBox"/>
42+
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimals}}" stepKey="clickOnQtyUsesDecimalsDropBox"/>
43+
<click selector="{{AdminProductFormAdvancedInventorySection.qtyUsesDecimalsOptions('1')}}" stepKey="chooseYesOnQtyUsesDecimalsDropBox"/>
44+
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnDoneButton"/>
45+
<!--Step3. Open *Advanced Pricing* pop-up (Click on *Advanced Pricing* link). Click on *Add* button. Fill *0.5* in *Quantity*-->
46+
<scrollTo selector="{{AdminProductFormSection.productName}}" stepKey="scrollToProductName"/>
47+
<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingLink1"/>
48+
<waitForElement selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="waitForAddButton"/>
49+
<click selector="{{AdminProductFormAdvancedPricingSection.customerGroupPriceAddButton}}" stepKey="clickOnCustomerGroupPriceAddButton"/>
50+
<fillField selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" userInput="0.5" stepKey="fillProductTierPriceQty"/>
51+
<!--Step4. Close *Advanced Pricing* (Click on button *Done*). Save *prod1* (Click on button *Save*)-->
52+
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickOnDoneButton2"/>
53+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton"/>
54+
55+
<!--The code should be uncommented after fix MAGETWO-96016-->
56+
<!--<click selector="{{AdminProductFormSection.advancedPricingLink}}" stepKey="clickOnAdvancedPricingLink2"/>-->
57+
<!--<seeInField userInput="0.5" selector="{{AdminProductFormAdvancedPricingSection.productTierPriceQtyInput('0')}}" stepKey="seeInField1"/>-->
58+
<!--<click selector="{{AdminProductFormAdvancedPricingSection.advancedPricingCloseButton}}" stepKey="clickOnCloseButton"/>-->
59+
60+
<!--Step5. Open *Advanced Inventory* pop-up. Set *Enable Qty Increments* to *Yes*. Fill *.5* in *Qty Increments*-->
61+
<click selector="{{AdminProductFormSection.advancedInventoryLink}}" stepKey="clickOnAdvancedInventoryLink2"/>
62+
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="scrollToEnableQtyIncrements"/>
63+
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsUseConfigSettings}}" stepKey="clickOnEnableQtyIncrementsUseConfigSettingsCheckbox"/>
64+
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrements}}" stepKey="clickOnEnableQtyIncrements"/>
65+
<click selector="{{AdminProductFormAdvancedInventorySection.enableQtyIncrementsOptions(('1'))}}" stepKey="chooseYesOnEnableQtyIncrements"/>
66+
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyIncrementsUseConfigSettings}}" stepKey="scrollToQtyIncrementsUseConfigSettings"/>
67+
<click selector="{{AdminProductFormAdvancedInventorySection.qtyIncrementsUseConfigSettings}}" stepKey="clickOnQtyIncrementsUseConfigSettings"/>
68+
<scrollTo selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" stepKey="scrollToQtyIncrements"/>
69+
<fillField selector="{{AdminProductFormAdvancedInventorySection.qtyIncrements}}" userInput=".5" stepKey="fillQtyIncrements"/>
70+
<!--Step6. Close *Advanced Inventory* (Click on button *Done*). Save *prod1* (Click on button *Save*) -->
71+
<click selector="{{AdminProductFormAdvancedInventorySection.doneButton}}" stepKey="clickOnDoneButton3"/>
72+
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickOnSaveButton2"/>
73+
<!--Step7. Open *Customer view* (Go to *Store Front*). Open *prod1* page (Find via search and click on product name) -->
74+
<amOnPage url="{{StorefrontHomePage.url}}$$createPreReqSimpleProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/>
75+
<!--Step8. Fill *1.5* in *Qty*. Click on button *Add to Cart*-->
76+
<fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="1.5" stepKey="fillQty"/>
77+
<click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="clickOnAddToCart"/>
78+
<waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" time="30" stepKey="waitForProductAdded"/>
79+
<see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createPreReqSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/>
80+
<!--Step9. Click on *Cart* icon. Click on *View and Edit Cart* link. Change *Qty* value to *5.5*-->
81+
<actionGroup ref="clickViewAndEditCartFromMiniCart" stepKey="goToShoppingCartFromMinicart"/>
82+
<fillField selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" userInput="5.5" stepKey="fillQty2"/>
83+
<click selector="{{CheckoutCartProductSection.updateShoppingCartButton}}" stepKey="clickOnUpdateShoppingCartButton"/>
84+
<seeInField userInput="5.5" selector="{{CheckoutCartProductSection.ProductQuantityByName(('$$createPreReqSimpleProduct.name$$'))}}" stepKey="seeInField2"/>
85+
</test>
86+
</tests>

0 commit comments

Comments
 (0)