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 =" ../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd" >
10+ <test name =" AdminSubmitsOrderWithAndWithoutEmailTest" >
11+ <annotations >
12+ <title value =" Email is required to create an order from Admin Panel" />
13+ <description value =" Admin should not be able to submit orders without an email address" />
14+ <severity value =" MAJOR" />
15+ <testCaseId value =" MAGETWO-92980" />
16+ <group value =" sales" />
17+
18+ </annotations >
19+ <before >
20+ <createData entity =" _defaultCategory" stepKey =" createCategory" />
21+ <createData entity =" _defaultProduct" stepKey =" createSimpleProduct" >
22+ <requiredEntity createDataKey =" createCategory" />
23+ </createData >
24+ </before >
25+ <after >
26+ <deleteData createDataKey =" createSimpleProduct" stepKey =" deleteProduct" />
27+ <deleteData createDataKey =" createCategory" stepKey =" deleteCategory" />
28+ <amOnPage url =" admin/admin/auth/logout/" stepKey =" amOnLogoutPage" />
29+ </after >
30+ <!-- Create order via Admin-->
31+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
32+ <comment userInput =" Admin creates order" stepKey =" adminCreateOrderComment" />
33+ <!-- <actionGroup ref="navigateToNewOrderPageNewCustomer" stepKey="navigateToNewOrderPage"/>-->
34+ <amOnPage url =" {{AdminOrdersPage.url}}" stepKey =" navigateToOrderIndexPage" />
35+ <waitForPageLoad stepKey =" waitForIndexPageLoad" />
36+ <see selector =" {{AdminHeaderSection.pageTitle}}" userInput =" Orders" stepKey =" seeIndexPageTitle" />
37+ <click selector =" {{AdminOrdersGridSection.createNewOrder}}" stepKey =" clickCreateNewOrder" />
38+ <click selector =" {{AdminOrderFormActionSection.CreateNewCustomer}}" stepKey =" clickCreateCustomer" />
39+ <see selector =" {{AdminHeaderSection.pageTitle}}" userInput =" Create New Order" stepKey =" seeNewOrderPageTitle" />
40+
41+ <!-- Check if order can be submitted without the required fields including email address-->
42+ <actionGroup ref =" checkRequiredFieldsNewOrderForm" stepKey =" checkRequiredFieldsNewOrder" after =" seeNewOrderPageTitle" />
43+ <scrollToTopOfPage stepKey =" scrollToTopOfOrderFormPage" after =" checkRequiredFieldsNewOrder" />
44+ <actionGroup ref =" addSimpleProductToOrder" stepKey =" addSimpleProductToOrder" after =" scrollToTopOfOrderFormPage" >
45+ <argument name =" product" value =" _defaultProduct" />
46+ </actionGroup >
47+
48+ <!-- Fill customer group and customer email-->
49+ <selectOption selector =" {{AdminOrderFormAccountSection.group}}" userInput =" {{GeneralCustomerGroup.code}}" stepKey =" selectCustomerGroup" after =" addSimpleProductToOrder" />
50+ <fillField selector =" {{AdminOrderFormAccountSection.email}}" userInput =" {{Simple_US_Customer.email}}" stepKey =" fillCustomerEmail" after =" selectCustomerGroup" />
51+
52+ <!-- Fill customer address information-->
53+ <actionGroup ref =" fillOrderCustomerInformation" stepKey =" fillCustomerAddress" after =" fillCustomerEmail" >
54+ <argument name =" customer" value =" Simple_US_Customer" />
55+ <argument name =" address" value =" US_Address_TX" />
56+ </actionGroup >
57+ <!-- Select shipping -->
58+ <actionGroup ref =" orderSelectFlatRateShipping" stepKey =" selectFlatRateShipping" after =" fillCustomerAddress" />
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 =" clickSubmitOrder" after =" seeCorrectGrandTotal" />
68+ <seeInCurrentUrl url =" {{AdminOrderDetailsPage.url}}" stepKey =" seeViewOrderPage" after =" clickSubmitOrder" />
69+ <see selector =" {{AdminOrderDetailsMessagesSection.successMessage}}" userInput =" You created the order." stepKey =" seeSuccessMessage" after =" seeViewOrderPage" />
70+ </test >
71+ </tests >
0 commit comments