|
| 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="AdminAddSelectedProductToOrderTest"> |
| 12 | + <annotations> |
| 13 | + <features value="CatalogInventory"/> |
| 14 | + <stories value="Admin create order"/> |
| 15 | + <title value="Add selected products to order in Admin when requested qty more than available"/> |
| 16 | + <description value="Trying to add selected products to order in Admin when requested qty more than available"/> |
| 17 | + <useCaseId value="MC-29184"/> |
| 18 | + <testCaseId value="MC-31589"/> |
| 19 | + <severity value="MAJOR"/> |
| 20 | + <group value="sales"/> |
| 21 | + <group value="catalogInventory"/> |
| 22 | + </annotations> |
| 23 | + <before> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="simpleCustomer"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="simpleProduct"/> |
| 26 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 27 | + </before> |
| 28 | + <after> |
| 29 | + <deleteData createDataKey="simpleCustomer" stepKey="deleteSimpleCustomer"/> |
| 30 | + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> |
| 31 | + <actionGroup ref="logout" stepKey="logoutFromAdmin"/> |
| 32 | + </after> |
| 33 | + |
| 34 | + <!-- Initiate create new order --> |
| 35 | + <actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPageWithExistingCustomer"> |
| 36 | + <argument name="customer" value="$simpleCustomer$"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Add to order maximum available quantity - 1 --> |
| 39 | + <executeJS function="return {{SimpleProduct2.quantity}} - 1" stepKey="maxQtyMinusOne"/> |
| 40 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderWithMaxQtyMinusOne"> |
| 41 | + <argument name="product" value="$simpleProduct$"/> |
| 42 | + <argument name="productQty" value="{$maxQtyMinusOne}"/> |
| 43 | + </actionGroup> |
| 44 | + <!-- Check that there is no error or notice --> |
| 45 | + <actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsent"> |
| 46 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 47 | + <argument name="messageType" value="notice"/> |
| 48 | + </actionGroup> |
| 49 | + <actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsent"> |
| 50 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 51 | + <argument name="messageType" value="error"/> |
| 52 | + </actionGroup> |
| 53 | + <!-- Add to order maximum available quantity --> |
| 54 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrder"> |
| 55 | + <argument name="product" value="$simpleProduct$"/> |
| 56 | + <argument name="productQty" value="1"/> |
| 57 | + </actionGroup> |
| 58 | + <!-- Check that there is no error or notice --> |
| 59 | + <actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertNoticeAbsentAgain"> |
| 60 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 61 | + <argument name="messageType" value="notice"/> |
| 62 | + </actionGroup> |
| 63 | + <actionGroup ref="AssertAdminItemOrderedErrorNotVisibleActionGroup" stepKey="assertErrorAbsentAgain"> |
| 64 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 65 | + <argument name="messageType" value="error"/> |
| 66 | + </actionGroup> |
| 67 | + <!-- Add to order one more quantity --> |
| 68 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProductToOrderAgain"> |
| 69 | + <argument name="product" value="$simpleProduct$"/> |
| 70 | + <argument name="productQty" value="1"/> |
| 71 | + </actionGroup> |
| 72 | + <!-- Check that error remains --> |
| 73 | + <actionGroup ref="AssertAdminItemOrderedErrorActionGroup" stepKey="assertProductErrorRemains"> |
| 74 | + <argument name="productName" value="$simpleProduct.name$"/> |
| 75 | + <argument name="messageType" value="notice"/> |
| 76 | + </actionGroup> |
| 77 | + </test> |
| 78 | +</tests> |
0 commit comments