|
| 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" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminCreateOrderWithCustomerWithoutEmailTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Admin Create Order"/> |
| 13 | + <stories value="Admin create order with customer without email."/> |
| 14 | + <description value="Verify, admin able to create order with customer without email."/> |
| 15 | + <severity value="MINOR"/> |
| 16 | + <group value="Sales"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <!--Disable required 'email' field on create order page.--> |
| 20 | + <magentoCLI command="config:set {{DisableEmailRequiredForOrder.path}} {{DisableEmailRequiredForOrder.value}}" stepKey="disableRequiredFieldEmailForAdminOrderCreation"/> |
| 21 | + <!--Create test data.--> |
| 22 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 23 | + <createData entity="SimpleProduct" stepKey="simpleProduct"> |
| 24 | + <requiredEntity createDataKey="category"/> |
| 25 | + </createData> |
| 26 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 27 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 28 | + </before> |
| 29 | + <after> |
| 30 | + <!--Clean up created test data.--> |
| 31 | + <deleteData createDataKey="simpleProduct" stepKey="deleteSimpleProduct"/> |
| 32 | + <deleteData createDataKey="category" stepKey="deleteCategory"/> |
| 33 | + <!--Enable required 'email' field on create order page.--> |
| 34 | + <magentoCLI command="config:set {{EnableEmailRequiredForOrder.path}} {{EnableEmailRequiredForOrder.value}}" stepKey="enableRequiredFieldEmailForAdminOrderCreation"/> |
| 35 | + <actionGroup ref="logout" stepKey="logout"/> |
| 36 | + <magentoCLI command="cache:flush" stepKey="flushCache"/> |
| 37 | + </after> |
| 38 | + |
| 39 | + <!--Create order.--> |
| 40 | + <actionGroup ref="NavigateToNewOrderPageNewCustomerActionGroup" stepKey="navigateToNewOrderPageNewCustomerActionGroup" /> |
| 41 | + <actionGroup ref="AddSimpleProductToOrderActionGroup" stepKey="addSimpleProductToOrder"> |
| 42 | + <argument name="product" value="$$simpleProduct$$"/> |
| 43 | + <argument name="productQty" value="{{SimpleProduct.quantity}}"/> |
| 44 | + </actionGroup> |
| 45 | + <!--Fill customer address without 'email'--> |
| 46 | + <actionGroup ref="FillOrderCustomerInformationActionGroup" stepKey="fillCustomerInformation"> |
| 47 | + <argument name="customer" value="Simple_US_Customer_CA_Without_Email"/> |
| 48 | + <argument name="address" value="US_Address_CA"/> |
| 49 | + </actionGroup> |
| 50 | + <actionGroup ref="OrderSelectFlatRateShippingActionGroup" stepKey="orderSelectFlatRateShippingMethod"/> |
| 51 | + <actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/> |
| 52 | + <!--Verify, 'email' is generated.--> |
| 53 | + <actionGroup ref="VerifyCreatedOrderInformationWithGeneratedEmailActionGroup" stepKey="verifyCustomerEmail"> |
| 54 | + <argument name="email" value="@example.com"/> |
| 55 | + </actionGroup> |
| 56 | + <grabTextFrom selector="{{AdminOrderDetailsInformationSection.customerEmail}}" stepKey="generatedCustomerEmail"/> |
| 57 | + <actionGroup ref="DeleteCustomerByEmailActionGroup" stepKey="deleteCustomer"> |
| 58 | + <argument name="email" value="$generatedCustomerEmail"/> |
| 59 | + </actionGroup> |
| 60 | + </test> |
| 61 | +</tests> |
0 commit comments