|
| 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="AdminAddDecimalDefaultToBundleItemsTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Bundle"/> |
| 14 | + <stories value="Create/Edit bundle product in Admin"/> |
| 15 | + <title value="Admin should be able to set decimal default to bundle item when item allows it"/> |
| 16 | + <description value="Admin should be able to set decimal default value to new bundle option"/> |
| 17 | + <severity value="AVERAGE"/> |
| 18 | + <testCaseId value="AC-8646"/> |
| 19 | + <useCaseId value="ACP2E-1799"/> |
| 20 | + <group value="Bundle"/> |
| 21 | + </annotations> |
| 22 | + <before> |
| 23 | + <createData entity="_defaultCategory" stepKey="createPreReqCategory"/> |
| 24 | + <createData entity="SimpleProduct2" stepKey="simpleProduct1"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="simpleProduct2"/> |
| 26 | + <actionGroup stepKey="loginToAdminPanel" ref="AdminLoginActionGroup"/> |
| 27 | + </before> |
| 28 | + <after> |
| 29 | + <deleteData createDataKey="createPreReqCategory" stepKey="deletePreReqCategory"/> |
| 30 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 31 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 32 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="navigateToProductIndex"/> |
| 33 | + <actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="clearFilters"/> |
| 34 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 35 | + </after> |
| 36 | + |
| 37 | + <!-- Open simpleProduct1 in Admin --> |
| 38 | + <actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="filterSimpleProduct1"> |
| 39 | + <argument name="product" value="SimpleProduct2"/> |
| 40 | + </actionGroup> |
| 41 | + <click selector="{{AdminProductGridSection.productGridNameProduct('$$simpleProduct1.name$$')}}" stepKey="clickOpenProductForEdit"/> |
| 42 | + <waitForPageLoad time="30" stepKey="waitForProductEditOpen"/> |
| 43 | + <!-- Open *Advanced Inventory* pop-up (Click on *Advanced Inventory* link). Set *Qty Uses Decimals* to *Yes*. Click on button *Done* --> |
| 44 | + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/> |
| 45 | + <actionGroup ref="AdminSetQtyUsesDecimalsConfigActionGroup" stepKey="setQtyUsesDecimalsConfig"> |
| 46 | + <argument name="value" value="Yes"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickOnDoneButton"/> |
| 49 | + <actionGroup ref="AdminProductFormSaveActionGroup" stepKey="clickOnSaveButton"/> |
| 50 | + |
| 51 | + <!-- Create new Bundle product --> |
| 52 | + <actionGroup ref="AdminOpenCreateBundleProductPageActionGroup" stepKey="goToBundleProductCreationPage"/> |
| 53 | + <actionGroup ref="AdminClickAddOptionOnBundleProductEditPageActionGroup" stepKey="clickAddOption1"/> |
| 54 | + <actionGroup ref="AdminFillBundleOptionTitleActionGroup" stepKey="fillOptionTitle"> |
| 55 | + <argument name="optionTitle" value="{{BundleProduct.optionTitle1}}"/> |
| 56 | + </actionGroup> |
| 57 | + <actionGroup ref="AdminFillBundleOptionTypeActionGroup" stepKey="selectInputType"/> |
| 58 | + |
| 59 | + <actionGroup ref="AdminClickAddProductToOptionByOptionIndexActionGroup" stepKey="clickAddProductsToOption"/> |
| 60 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions"> |
| 61 | + <argument name="product" value="$$simpleProduct1$$"/> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow"/> |
| 64 | + <actionGroup ref="FilterProductGridBySkuActionGroup" stepKey="filterBundleProductOptions2"> |
| 65 | + <argument name="product" value="$$simpleProduct2$$"/> |
| 66 | + </actionGroup> |
| 67 | + <actionGroup ref="AdminCheckFirstCheckboxInAddProductsToOptionPanelGridActionGroup" stepKey="selectFirstGridRow2"/> |
| 68 | + <actionGroup ref="AdminClickAddSelectedProductsOnAddProductsToOptionPanelActionGroup" stepKey="clickAddSelectedBundleProducts"/> |
| 69 | + |
| 70 | + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '0')}}" stepKey="grabbedFirstBundleOptionQuantity"/> |
| 71 | + <assertEquals stepKey="assertFirstBundleOptionDefaultQuantity"> |
| 72 | + <expectedResult type="string">1</expectedResult> |
| 73 | + <actualResult type="string">$grabbedFirstBundleOptionQuantity</actualResult> |
| 74 | + </assertEquals> |
| 75 | + <grabValueFrom selector="{{AdminProductFormBundleSection.bundleOptionXProductYQuantity('0', '1')}}" stepKey="grabbedSecondBundleOptionQuantity"/> |
| 76 | + <assertEquals stepKey="assertSecondBundleOptionDefaultQuantity"> |
| 77 | + <expectedResult type="string">1</expectedResult> |
| 78 | + <actualResult type="string">$grabbedSecondBundleOptionQuantity</actualResult> |
| 79 | + </assertEquals> |
| 80 | + |
| 81 | + <!-- Fill first selection with decimal value --> |
| 82 | + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProduct1DefaultQty"> |
| 83 | + <argument name="optionIndex" value="0"/> |
| 84 | + <argument name="productIndex" value="0"/> |
| 85 | + <argument name="qty" value="2.56"/> |
| 86 | + </actionGroup> |
| 87 | + |
| 88 | + <!-- Check there is no error message for the slection with allowed decimal value --> |
| 89 | + <dontSee selector="{{AdminProductFormBundleSection.fieldError('uid')}}" userInput="Please enter a valid number in this field." stepKey="doNotSeeErrorMessageForProduct1"/> |
| 90 | + |
| 91 | + <!-- Fill second selection with decimal value --> |
| 92 | + <actionGroup ref="AdminFillBundleItemQtyActionGroup" stepKey="fillProduct2DefaultQty"> |
| 93 | + <argument name="optionIndex" value="0"/> |
| 94 | + <argument name="productIndex" value="1"/> |
| 95 | + <argument name="qty" value="2.56"/> |
| 96 | + </actionGroup> |
| 97 | + |
| 98 | + <!-- Check there is an error message for the slection with not allowed decimal value --> |
| 99 | + <see selector="{{AdminProductFormBundleSection.fieldError('uid')}}" userInput="Please enter a valid number in this field." stepKey="seeErrorMessageForProduct2"/> |
| 100 | + |
| 101 | + </test> |
| 102 | +</tests> |
0 commit comments