|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminSubmitsOrderWithAndWithoutFieldsValidationTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Sales"/> |
| 13 | + <stories value="Create orders"/> |
| 14 | + <title value="Fields validation is required to create an order from Admin Panel"/> |
| 15 | + <description value="Admin should not be able to submit orders without invalid address fields"/> |
| 16 | + <group value="sales"/> |
| 17 | + </annotations> |
| 18 | + <before> |
| 19 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 20 | + <createData entity="_defaultProduct" stepKey="createSimpleProduct"> |
| 21 | + <requiredEntity createDataKey="createCategory"/> |
| 22 | + </createData> |
| 23 | + </before> |
| 24 | + <after> |
| 25 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 26 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 27 | + <amOnPage url="admin/admin/auth/logout/" stepKey="amOnLogoutPage"/> |
| 28 | + </after> |
| 29 | + <!--Create order via Admin--> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 31 | + <comment userInput="Admin creates order" stepKey="adminCreateOrderComment"/> |
| 32 | + <!--<actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>--> |
| 33 | + <amOnPage url="{{AdminOrdersPage.url}}" stepKey="navigateToOrderIndexPage"/> |
| 34 | + <waitForPageLoad stepKey="waitForIndexPageLoad"/> |
| 35 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Orders" stepKey="seeIndexPageTitle"/> |
| 36 | + <click selector="{{AdminOrdersGridSection.createNewOrder}}" stepKey="clickCreateNewOrder"/> |
| 37 | + <click selector="{{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey="clickCreateCustomer"/> |
| 38 | + <see selector="{{AdminHeaderSection.pageTitle}}" userInput="Create New Order" stepKey="seeNewOrderPageTitle"/> |
| 39 | + |
| 40 | + <!--Check if order can be submitted without the required fields including email address--> |
| 41 | + <actionGroup ref="checkRequiredFieldsNewOrderForm" stepKey="checkRequiredFieldsNewOrder" after="seeNewOrderPageTitle"/> |
| 42 | + <scrollToTopOfPage stepKey="scrollToTopOfOrderFormPage" after="checkRequiredFieldsNewOrder"/> |
| 43 | + <actionGroup ref="addSimpleProductToOrder" stepKey="addSimpleProductToOrder" after="scrollToTopOfOrderFormPage"> |
| 44 | + <argument name="product" value="_defaultProduct"/> |
| 45 | + </actionGroup> |
| 46 | + |
| 47 | + <!--Fill customer group and customer email--> |
| 48 | + <selectOption selector="{{AdminOrderFormAccountSection.group}}" userInput="{{GeneralCustomerGroup.code}}" stepKey="selectCustomerGroup" after="addSimpleProductToOrder"/> |
| 49 | + <fillField selector="{{AdminOrderFormAccountSection.email}}" userInput="{{Simple_US_Customer.email}}" stepKey="fillCustomerEmail" after="selectCustomerGroup"/> |
| 50 | + |
| 51 | + <!--Fill wrong customer address information--> |
| 52 | + <actionGroup ref="fillOrderCustomerInformation" stepKey="fillWrongCustomerAddress" after="fillCustomerEmail"> |
| 53 | + <argument name="customer" value="Simple_US_Customer_Incorrect_Name"/> |
| 54 | + <argument name="address" value="US_Address_TX"/> |
| 55 | + </actionGroup> |
| 56 | + <!-- Select shipping --> |
| 57 | + <actionGroup ref="orderSelectFlatRateShipping" stepKey="selectFlatRateShipping" |
| 58 | + after="fillWrongCustomerAddress"/> |
| 59 | + |
| 60 | + <!--Verify totals on Order page--> |
| 61 | + <see selector="{{AdminOrderFormTotalSection.total('Subtotal')}}" userInput="${{AdminOrderSimpleProduct.subtotal}}" stepKey="seeOrderSubTotal" after="selectFlatRateShipping"/> |
| 62 | + <see selector="{{AdminOrderFormTotalSection.total('Shipping')}}" userInput="${{AdminOrderSimpleProduct.shipping}}" stepKey="seeOrderShipping" after="seeOrderSubTotal"/> |
| 63 | + <scrollTo selector="{{AdminOrderFormTotalSection.grandTotal}}" stepKey="scrollToOrderGrandTotal"/> |
| 64 | + <see selector="{{AdminOrderFormTotalSection.grandTotal}}" userInput="${{AdminOrderSimpleProduct.grandTotal}}" stepKey="seeCorrectGrandTotal" after="scrollToOrderGrandTotal"/> |
| 65 | + |
| 66 | + <!--Submit Order and verify information--> |
| 67 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrderWrong" |
| 68 | + after="seeCorrectGrandTotal"/> |
| 69 | + <see selector="{{AdminOrderFormBillingAddressSection.firstNameError}}" |
| 70 | + userInput="Please enter less or equal than 255 symbols." stepKey="firstNameError" |
| 71 | + after="clickSubmitOrderWrong"/> |
| 72 | + |
| 73 | + <!--Fill correct customer address information--> |
| 74 | + <actionGroup ref="fillOrderCustomerInformation" stepKey="fillCustomerAddress" after="firstNameError"> |
| 75 | + <argument name="customer" value="Simple_US_Customer"/> |
| 76 | + <argument name="address" value="US_Address_TX"/> |
| 77 | + </actionGroup> |
| 78 | + |
| 79 | + <!-- Select shipping --> |
| 80 | + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="clickShipping" after="fillCustomerAddress"/> |
| 81 | + <click selector="{{AdminOrderFormPaymentSection.getShippingMethods}}" stepKey="selectShipping" after="clickShipping"/> |
| 82 | + |
| 83 | + <!--Submit Order and verify information--> |
| 84 | + <click selector="{{AdminOrderFormActionSection.SubmitOrder}}" stepKey="clickSubmitOrder" after="selectShipping"/> |
| 85 | + <seeInCurrentUrl url="{{AdminOrderDetailsPage.url}}" stepKey="seeViewOrderPage" after="clickSubmitOrder"/> |
| 86 | + <see selector="{{AdminOrderDetailsMessagesSection.successMessage}}" userInput="You created the order." stepKey="seeSuccessMessage" after="seeViewOrderPage"/> |
| 87 | + </test> |
| 88 | +</tests> |
0 commit comments