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 =" CreateAdminOrderPayedWithOnlinePaymentIncludingTaxAndDiscount" >
12
+ <annotations >
13
+ <features value =" Braintree" />
14
+ <stories value =" Get access to a New Credit Memo Page from Invocie for Order payed with online payment via Admin" />
15
+ <title value =" Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method" />
16
+ <description value =" Admin should be able to open a New Credit Memo Page from Invoice Page for Order with tax and discount and payed using online payment method" />
17
+ <severity value =" CRITICAL" />
18
+ <testCaseId value =" MAGETWO-94472" />
19
+ <group value =" braintree" />
20
+ </annotations >
21
+
22
+ <before >
23
+ <!-- Create Default Category-->
24
+ <createData entity =" SimpleSubCategory" stepKey =" createCategory" />
25
+
26
+ <!-- Create Simple product-->
27
+ <createData entity =" _defaultProduct" stepKey =" simpleProduct" >
28
+ <requiredEntity createDataKey =" createCategory" />
29
+ </createData >
30
+
31
+ <!-- Create Tax Rule is based on default tax rates (Stores>Tax Rule) US-CA-*-Rate 1 = 8.2500 US-NY-*-Rate 1 = 8.3750 -->
32
+ <createData entity =" SimpleTaxRule" stepKey =" createTaxRule" />
33
+
34
+ <!-- Configure Braintree Payment method-->
35
+ <createData entity =" BraintreeConfig" stepKey =" BraintreeConfigurationData" />
36
+ <createData entity =" CustomBraintreeConfigurationData" stepKey =" enableBraintree" />
37
+
38
+ <!-- Create Retailer Customer with US_CA address-->
39
+ <createData entity =" Simple_US_Customer_CA" stepKey =" simpleCustomer" >
40
+ <field key =" group_id" >3</field >
41
+ </createData >
42
+
43
+ <!-- Login as Admin User-->
44
+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
45
+ </before >
46
+
47
+ <after >
48
+ <!-- Delete Cart Price Rule-->
49
+ <actionGroup ref =" AdminDeleteCartPriceRuleForRetailerActionGroup" stepKey =" deleteSalesRule" />
50
+
51
+ <!-- Set to default configuration Tax Shipping Class-->
52
+ <actionGroup ref =" setDefaultShippingTaxClass" stepKey =" setdefaultClass" />
53
+
54
+ <!-- Delete Simple Sub Category-->
55
+ <deleteData createDataKey =" createCategory" stepKey =" deleteCategory" />
56
+
57
+ <!-- Delete Simple Product-->
58
+ <deleteData createDataKey =" simpleProduct" stepKey =" deleteSimpleProduct" />
59
+
60
+ <!-- Delete Tax Rule -->
61
+ <deleteData createDataKey =" createTaxRule" stepKey =" deleteTaxRule" />
62
+
63
+ <!-- Rollback Braintree to Default -->
64
+ <createData entity =" RollBackCustomBraintreeConfigurationData" stepKey =" rollbackBraintreeConfig" />
65
+
66
+ <!-- Delete Customer-->
67
+ <deleteData createDataKey =" simpleCustomer" stepKey =" deleteSimpleCustomer" />
68
+
69
+ <!-- Log Out-->
70
+ <actionGroup ref =" logout" stepKey =" logout" />
71
+ </after >
72
+
73
+ <!-- Create a cart price rule with 10% discount for whole cart -->
74
+ <click selector =" {{AdminMenuSection.marketing}}" stepKey =" clickOnMarketing" />
75
+ <waitForPageLoad stepKey =" waitForMarketing" time =" 3" />
76
+ <click selector =" {{CartPriceRulesSubmenuSection.cartPriceRules}}" stepKey =" clickOnCartPriceRules" />
77
+ <waitForPageLoad stepKey =" waitForCartPriceRules" time =" 3" />
78
+ <click selector =" {{AdminCartPriceRulesSection.addNewRuleButton}}" stepKey =" clickAddNewRule" />
79
+ <fillField selector =" {{AdminCartPriceRulesFormSection.ruleName}}" userInput =" {{SimpleSalesRule.name}}" stepKey =" fillRuleName" />
80
+ <selectOption selector =" {{AdminCartPriceRulesFormSection.websites}}" userInput =" Main Website" stepKey =" selectWebsites" />
81
+ <actionGroup ref =" selectRetailerCustomerGroup" stepKey =" selectRetailerCustomerGroup" />
82
+ <click selector =" {{AdminCartPriceRulesFormSection.actionsHeader}}" stepKey =" clickToExpandActions" />
83
+ <selectOption selector =" {{AdminCartPriceRulesFormSection.apply}}" userInput =" Percent of product price discount" stepKey =" selectActionType" />
84
+ <fillField selector =" {{AdminCartPriceRulesFormSection.discountAmount}}" userInput =" 10" stepKey =" fillDiscountAmount" />
85
+ <click selector =" {{AdminCartPriceRulesFormSection.save}}" stepKey =" clickSaveButton" />
86
+ <waitForPageLoad stepKey =" waitForCartRuleLoad" time =" 3" />
87
+ <see selector =" {{AdminCartPriceRulesSection.messages}}" userInput =" You saved the rule." stepKey =" seeSuccessMessage" />
88
+
89
+ <!-- Set Taxable Goods for Shipping Tax Class-->
90
+ <actionGroup ref =" changeShippingTaxClass" stepKey =" changeShippingTaxClass" />
91
+
92
+ <!-- Adding Special price to product-->
93
+ <amOnPage url =" {{AdminProductEditPage.url($$simpleProduct.id$$)}}" stepKey =" openAdminProductEditPage" />
94
+ <actionGroup ref =" AddSpecialPriceToProductActionGroup" stepKey =" addSpecialPrice" />
95
+ <actionGroup ref =" saveProductForm" stepKey =" saveProductForm" />
96
+
97
+ <!-- Create New Order-->
98
+ <actionGroup ref =" navigateToNewOrderPageExistingCustomer" stepKey =" navigateToNewOrderWithExistingCustomer" >
99
+ <argument name =" customer" value =" $$simpleCustomer$$" />
100
+ </actionGroup >
101
+
102
+ <!-- Add a product to order-->
103
+ <actionGroup ref =" addSimpleProductToOrder" stepKey =" addProductToOrder" >
104
+ <argument name =" product" value =" $$simpleProduct$$" />
105
+ </actionGroup >
106
+
107
+ <!-- Select FlatRate shipping method-->
108
+ <actionGroup ref =" orderSelectFlatRateShipping" stepKey =" orderSelectFlatRateShippingMethod" />
109
+
110
+ <!-- Select Braintree online Payment method -->
111
+ <actionGroup ref =" AdminOrderBraintreeFillActionGroup" stepKey =" selectCreditCardPayment" />
112
+
113
+ <!-- Submit Order-->
114
+ <click stepKey =" submitOrder" selector =" {{NewOrderSection.submitOrder}}" />
115
+ <waitForPageLoad stepKey =" waitForSubmitOrder" time =" 5" />
116
+ <see selector =" {{AdminOrderDetailsMessagesSection.successMessage}}" userInput =" You created the order." stepKey =" seeOrderSuccessMessage" after =" waitForSubmitOrder" />
117
+
118
+ <!-- Create New invoice-->
119
+ <actionGroup ref =" adminFastCreateInvoice" stepKey =" createInvoice" />
120
+
121
+ <!-- Get access to Credit Memo page from Invoice page-->
122
+ <click selector =" {{AdminInvoiceMainActionsSection.openNewCreditMemoFromInvoice}}" stepKey =" clickCreateNewCreditMemo" />
123
+ <waitForPageLoad stepKey =" waitForLoadNewCreditMemoPage" time =" 5" />
124
+ <see selector =" {{AdminCreditMemoOrderInformationSection.orderStatus}}" userInput =" Processing" stepKey =" seeNewCreditMemo" />
125
+ </test >
126
+ </tests >
0 commit comments