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 =" ../../../../../../../dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd" >
10
+ <test name =" AdminCreateOrderWithBundleProductTest" >
11
+ <annotations >
12
+ <title value =" Create Order in Admin and update bundle product configuration" />
13
+ <stories value =" MAGETWO-96488: Wrong price calculation for bundle product on creating order from the admin panel" />
14
+ <description value =" Add bundle product with bundle option items with default quantity 2 to order in Admin and check price in product grid" />
15
+ <features value =" Sales" />
16
+ <severity value =" AVERAGE" />
17
+ <group value =" Sales" />
18
+ </annotations >
19
+
20
+ <before >
21
+ <!-- Set default flat rate shipping method settings-->
22
+ <createData entity =" FlatRateShippingMethodDefault" stepKey =" setDefaultFlatRateShippingMethod" />
23
+
24
+ <!-- Create simple customer-->
25
+ <createData entity =" Simple_US_Customer_CA" stepKey =" simpleCustomer" />
26
+
27
+ <!-- Create simple product 1-->
28
+ <createData entity =" ApiProductWithDescription" stepKey =" simple1" before =" simple2" />
29
+
30
+ <!-- Create simple product 2-->
31
+ <createData entity =" ApiProductWithDescription" stepKey =" simple2" before =" product" />
32
+
33
+ <!-- Create bundle product with checkbox bundle option-->
34
+ <createData entity =" ApiBundleProduct" stepKey =" product" />
35
+ <createData entity =" CheckboxOption" stepKey =" checkboxBundleOption" >
36
+ <requiredEntity createDataKey =" product" />
37
+ </createData >
38
+
39
+ <!-- Link simple product 1 to bundle option with default quantity 2-->
40
+ <createData entity =" ApiBundleLink" stepKey =" createBundleLink1" >
41
+ <requiredEntity createDataKey =" product" />
42
+ <requiredEntity createDataKey =" checkboxBundleOption" />
43
+ <requiredEntity createDataKey =" simple1" />
44
+ <field key =" qty" >2</field >
45
+ <field key =" is_default" >1</field >
46
+ </createData >
47
+
48
+ <!-- Link simple product 2 to bundle option with default quantity 2-->
49
+ <createData entity =" ApiBundleLink" stepKey =" createBundleLink2" >
50
+ <requiredEntity createDataKey =" product" />
51
+ <requiredEntity createDataKey =" checkboxBundleOption" />
52
+ <requiredEntity createDataKey =" simple2" />
53
+ <field key =" qty" >2</field >
54
+ <field key =" is_default" >1</field >
55
+ </createData >
56
+
57
+ <!-- Add drop-down bundle option-->
58
+ <createData entity =" DropDownBundleOption" stepKey =" dropDownBundleOption" >
59
+ <requiredEntity createDataKey =" product" />
60
+ </createData >
61
+
62
+ <!-- Link simple product 1 to drop-down bundle option with default quantity 2-->
63
+ <createData entity =" ApiBundleLink" stepKey =" createBundleLink3" >
64
+ <requiredEntity createDataKey =" product" />
65
+ <requiredEntity createDataKey =" dropDownBundleOption" />
66
+ <requiredEntity createDataKey =" simple1" />
67
+ <field key =" qty" >2</field >
68
+ <field key =" is_default" >1</field >
69
+ </createData >
70
+
71
+ <!-- Link simple product 2 to drop-down bundle option with default quantity 2-->
72
+ <createData entity =" ApiBundleLink" stepKey =" createBundleLink4" >
73
+ <requiredEntity createDataKey =" product" />
74
+ <requiredEntity createDataKey =" dropDownBundleOption" />
75
+ <requiredEntity createDataKey =" simple2" />
76
+ <field key =" qty" >2</field >
77
+ </createData >
78
+ <actionGroup ref =" LoginAsAdmin" stepKey =" loginAsAdmin" />
79
+ </before >
80
+
81
+ <!-- Create new customer order-->
82
+ <actionGroup ref =" navigateToNewOrderPageExistingCustomer" stepKey =" navigateToNewOrderWithExistingCustomer" >
83
+ <argument name =" customer" value =" $$simpleCustomer$$" />
84
+ </actionGroup >
85
+
86
+ <!-- Add bundle product to order and check product price in grid-->
87
+ <actionGroup ref =" addBundleProductToOrderAndCheckPriceInGrid" stepKey =" addBundleProductToOrder" >
88
+ <argument name =" product" value =" $$product$$" />
89
+ <argument name =" quantity" value =" 1" />
90
+ <argument name =" price" value =" $738.00" />
91
+ </actionGroup >
92
+
93
+ <!-- Select FlatRate shipping method-->
94
+ <actionGroup ref =" orderSelectFlatRateShipping" stepKey =" orderSelectFlatRateShippingMethod" />
95
+
96
+ <!-- Submit order-->
97
+ <click selector =" {{AdminOrderFormActionSection.SubmitOrder}}" stepKey =" submitOrder" />
98
+
99
+ <!-- Verify order information-->
100
+ <actionGroup ref =" verifyCreatedOrderInformation" stepKey =" verifyCreatedOrderInformation" />
101
+
102
+ <after >
103
+ <actionGroup ref =" logout" stepKey =" logout" />
104
+
105
+ <deleteData createDataKey =" product" stepKey =" delete" />
106
+ <deleteData createDataKey =" simpleCustomer" stepKey =" deleteSimpleCustomer" />
107
+ <deleteData createDataKey =" simple1" stepKey =" deleteSimple1" before =" deleteSimple2" />
108
+ <deleteData createDataKey =" simple2" stepKey =" deleteSimple2" before =" delete" />
109
+ </after >
110
+ </test >
111
+ </tests >
0 commit comments