|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<!-- |
| 3 | +/** |
| 4 | + * Copyright 2025 Adobe. |
| 5 | + * All Rights Reserved. |
| 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="AdminCreateOrderWithBackOrderQtyEnabledProductTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Sales"/> |
| 14 | + <stories value="Backorders"/> |
| 15 | + <title value="Backordered quantity is visible on order item level in backend"/> |
| 16 | + <description value="Ensure that backordered quantity is displayed at item level in admin order details when backorders are allowed."/> |
| 17 | + <testCaseId value="AC-12061"/> |
| 18 | + <severity value="AVERAGE"/> |
| 19 | + <group value="sales"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!-- Create product and customer --> |
| 23 | + <createData entity="SimpleProductInStockQuantityZero" stepKey="createProduct"/> |
| 24 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 25 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 26 | + </before> |
| 27 | + <after> |
| 28 | + <!-- Delete created data --> |
| 29 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 30 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 31 | + <deleteData createDataKey="createProduct" stepKey="deleteProduct"/> |
| 32 | + </after> |
| 33 | + <!-- Step1: Open created product and allow backorders --> |
| 34 | + <actionGroup ref="NavigateToCreatedProductEditPageActionGroup" stepKey="openCreatedProductEditPage"> |
| 35 | + <argument name="product" value="$$createProduct$$"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="AdminClickOnAdvancedInventoryLinkActionGroup" stepKey="clickOnAdvancedInventoryLink"/> |
| 38 | + <actionGroup ref="AdminSetBackordersOnProductAdvancedInventoryActionGroup" stepKey="allowBackorders"/> |
| 39 | + <actionGroup ref="AdminFillAdvancedInventoryQtyActionGroup" stepKey="fillProductQty"> |
| 40 | + <argument name="qty" value="-5"/> |
| 41 | + </actionGroup> |
| 42 | + <actionGroup ref="AdminSubmitAdvancedInventoryFormActionGroup" stepKey="clickDoneButton"/> |
| 43 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/> |
| 44 | + <!-- Step2: Create Order --> |
| 45 | + <actionGroup ref="AdminNavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderPage"> |
| 46 | + <argument name="customer" value="$createCustomer$"/> |
| 47 | + </actionGroup> |
| 48 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addProduct"> |
| 49 | + <argument name="product" value="$createProduct$"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInfo"> |
| 52 | + <argument name="customer" value="$createCustomer$"/> |
| 53 | + <argument name="address" value="US_Address_TX"/> |
| 54 | + </actionGroup> |
| 55 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="selectFlatRate"/> |
| 56 | + <!-- Submit order --> |
| 57 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 58 | + <!-- Step3: Create Invoice for this Order and verify backorder --> |
| 59 | + <actionGroup ref="StartCreateInvoiceFromOrderPageActionGroup" stepKey="createInvoice"/> |
| 60 | + <actionGroup ref="SubmitInvoiceActionGroup" stepKey="submitInvoice"/> |
| 61 | + <waitForText selector="{{AdminOrderItemsOrderedSection.itemsOrderedStatus($$createProduct.sku$$)}}" userInput="Invoiced" stepKey="verifyItemStatusAfterInvoice"/> |
| 62 | + <waitForText selector="{{AdminOrderItemsOrderedSection.backOrdered($$createProduct.sku$$)}}" userInput="1" stepKey="verifyBackOrderedAfterInvoice"/> |
| 63 | + </test> |
| 64 | +</tests> |
0 commit comments