|
| 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="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 11 | + <test name="StorefrontValidateQuantityIncrementsWithDecimalInventoryTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CatalogInventory"/> |
| 14 | + <stories value="Qty increments wrong calculation for decimal fraction quantity"/> |
| 15 | + <title value="Validate qty increments for decimal fraction quantity works"/> |
| 16 | + <description value="Validate qty increments for decimal fraction quantity works"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <useCaseId value="MC-38242"/> |
| 19 | + <testCaseId value="MC-38883"/> |
| 20 | + <group value="catalogInventory"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> |
| 24 | + <createData entity="SimpleProduct" stepKey="createPreReqSimpleProduct"> |
| 25 | + <requiredEntity createDataKey="createPreReqCategory"/> |
| 26 | + </createData> |
| 27 | + </before> |
| 28 | + <after> |
| 29 | + <!--Clear Filters--> |
| 30 | + <actionGroup ref="AdminClearFiltersActionGroup" stepKey="ClearFiltersAfter"/> |
| 31 | + <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> |
| 32 | + <deleteData createDataKey="createPreReqSimpleProduct" stepKey="deletePreReqSimpleProduct"/> |
| 33 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 34 | + </after> |
| 35 | + <!--Step1. Login as admin. Go to Catalog > Products page. Filtering *prod1*. Open *prod1* to edit--> |
| 36 | + <actionGroup ref="AdminLoginActionGroup" stepKey="LoginAsAdmin" /> |
| 37 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterGroupedProductOptions"> |
| 38 | + <argument name="product" value="SimpleProduct"/> |
| 39 | + </actionGroup> |
| 40 | + <!-- Step2. Update product Advanced Inventory Setting. |
| 41 | + Set *Qty Uses Decimals* to *Yes* and *Enable Qty Increments* to *Yes* and *Qty Increments* to *3.33*. --> |
| 42 | + <actionGroup ref="OpenProductForEditByClickingRowXColumnYInProductGridActionGroup" stepKey="openProduct"/> |
| 43 | + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/> |
| 44 | + <actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig"> |
| 45 | + <argument name="value" value="Yes"/> |
| 46 | + </actionGroup> |
| 47 | + <actionGroup ref="AdminSetEnableQtyIncrementsActionGroup" stepKey="setEnableQtyIncrements"> |
| 48 | + <argument name="value" value="Yes"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="AdminSetQtyIncrementsForProductActionGroup" stepKey="setQtyIncrementsValue"> |
| 51 | + <argument name="qty" value="3.33"/> |
| 52 | + </actionGroup> |
| 53 | + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/> |
| 54 | + |
| 55 | + <!--Step3. Save the product--> |
| 56 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton2"/> |
| 57 | + <!--Step4. Open *Customer view* (Go to *Store Front*). Open *prod1* page (Find via search and click on product name) --> |
| 58 | + <amOnPage url="{{StorefrontHomePage.url}}$$createPreReqSimpleProduct.custom_attributes[url_key]$$.html" stepKey="amOnProductPage"/> |
| 59 | + <!--Step5. Fill *23.31* in *Qty*. Click on button *Add to Cart*--> |
| 60 | + <fillField selector="{{StorefrontProductPageSection.qtyInput}}" userInput="23.31" stepKey="fillQty"/> |
| 61 | + <click selector="{{StorefrontProductPageSection.addToCartBtn}}" stepKey="clickOnAddToCart"/> |
| 62 | + <waitForElementVisible selector="{{StorefrontProductPageSection.successMsg}}" time="30" stepKey="waitForProductAdded"/> |
| 63 | + <!--Step6. Verify the product is successfully added to the cart with success message--> |
| 64 | + <see selector="{{StorefrontCategoryMainSection.SuccessMsg}}" userInput="You added $$createPreReqSimpleProduct.name$$ to your shopping cart." stepKey="seeAddedToCartMessage"/> |
| 65 | + </test> |
| 66 | +</tests> |
0 commit comments