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