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