Skip to content

Commit 1f39326

Browse files
Manjusha.SManjusha.S
authored andcommitted
Merge branch 'ACQE-4220' into functional-testing-automation-version2
2 parents 11170c9 + 0f3abee commit 1f39326

File tree

5 files changed

+196
-0
lines changed

5 files changed

+196
-0
lines changed
Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
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="EditOrderWithBundleProductBackendTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Edit order with bundle product (backend)"/>
15+
<title value="Edit order with bundle product (backend)"/>
16+
<description value="Edit order with bundle product (backend)"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="AC-4601"/>
19+
</annotations>
20+
<before>
21+
22+
<!--Set default flat rate shipping method settings-->
23+
<magentoCLI command="config:set {{EnableFlatRateConfigData.path}} {{EnableFlatRateConfigData.value}}" stepKey="enableFlatRate"/>
24+
<!-- Create Customer Account -->
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
27+
<!-- Create Customer Account -->
28+
<createData entity="Simple_US_Customer" stepKey="createCustomer2"/>
29+
<!-- simple product1-->
30+
<createData entity="SimpleProduct" stepKey="SimpleProduct1">
31+
<field key="price">10.00</field>
32+
</createData>
33+
34+
<!-- simple product2 -->
35+
<createData entity="SimpleProduct" stepKey="SimpleProduct2">
36+
<field key="price">15.00</field>
37+
</createData>
38+
39+
<!-- simple product3-->
40+
<createData entity="SimpleProduct" stepKey="SimpleProduct3">
41+
<field key="price">20.00</field>
42+
</createData>
43+
44+
<!-- simple product3-->
45+
<createData entity="SimpleProduct" stepKey="SimpleProduct4">
46+
<field key="price">25.00</field>
47+
</createData>
48+
49+
<createData entity="ApiBundleProduct" stepKey="createBundleProduct"/>
50+
51+
<createData entity="CheckboxOption" stepKey="checkboxBundleOption1">
52+
<requiredEntity createDataKey="createBundleProduct"/>
53+
</createData>
54+
55+
<createData entity="DropDownBundleOption" stepKey="dropDownBundleOption2">
56+
<requiredEntity createDataKey="createBundleProduct"/>
57+
</createData>
58+
59+
<createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct1">
60+
<requiredEntity createDataKey="createBundleProduct"/>
61+
<requiredEntity createDataKey="checkboxBundleOption1"/>
62+
<requiredEntity createDataKey="SimpleProduct1"/>
63+
</createData>
64+
<createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct12">
65+
<requiredEntity createDataKey="createBundleProduct"/>
66+
<requiredEntity createDataKey="checkboxBundleOption1"/>
67+
<requiredEntity createDataKey="SimpleProduct2"/>
68+
</createData>
69+
70+
<createData entity="ApiBundleLink" stepKey="LinkOptionToFirstProduct21">
71+
<requiredEntity createDataKey="createBundleProduct"/>
72+
<requiredEntity createDataKey="dropDownBundleOption2"/>
73+
<requiredEntity createDataKey="SimpleProduct3"/>
74+
</createData>
75+
<createData entity="ApiBundleLink" stepKey="LinkOptionToSecondProduct22">
76+
<requiredEntity createDataKey="createBundleProduct"/>
77+
<requiredEntity createDataKey="dropDownBundleOption2"/>
78+
<requiredEntity createDataKey="SimpleProduct4"/>
79+
</createData>
80+
81+
82+
<!-- Login as admin -->
83+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
84+
</before>
85+
<after>
86+
<!--Remove default flat rate shipping method settings-->
87+
<magentoCLI command="config:set {{DisableFlatRateConfigData.path}} {{DisableFlatRateConfigData.value}}" stepKey="disableFlatRate"/>
88+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
89+
<deleteData createDataKey="createCustomer2" stepKey="deleteCustomer2"/>
90+
91+
<!-- Delete the simple product -->
92+
<deleteData createDataKey="SimpleProduct1" stepKey="DeleteSimpleProduct1"/>
93+
94+
<!-- Delete the simple product -->
95+
<deleteData createDataKey="SimpleProduct2" stepKey="DeleteSimpleProduct2"/>
96+
97+
<!-- Delete the simple product -->
98+
<deleteData createDataKey="SimpleProduct3" stepKey="DeleteSimpleProduct3"/>
99+
100+
<!-- Delete the simple product -->
101+
<deleteData createDataKey="SimpleProduct4" stepKey="DeleteSimpleProduct4"/>
102+
103+
<deleteData createDataKey="createBundleProduct" stepKey="deleteBundleProduct"/>
104+
105+
<!-- Log out -->
106+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
107+
</after>
108+
109+
<!--Get bundle product option.-->
110+
<amOnPage url="{{AdminProductEditPage.url($$createBundleProduct.id$$)}}" stepKey="openBundleProductEditPage"/>
111+
112+
<!--Create new customer order.-->
113+
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer">
114+
<argument name="customer" value="$createCustomer$"/>
115+
</actionGroup>
116+
<!--Add bundle product to order.-->
117+
<actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct">
118+
<argument name="productSKU" value="$createBundleProduct.sku$"/>
119+
</actionGroup>
120+
121+
<click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown"/>
122+
123+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('2')}}" stepKey="clickToSelectOption"/>
124+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="clickToCheckboxOption"/>
125+
<fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty"/>
126+
127+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover"/>
128+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton"/>
129+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts"/>
130+
131+
<!--Select FlatRate shipping method-->
132+
<actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod"/>
133+
134+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder"/>
135+
<wait time="2" stepKey="waitForPageLoad1"/>
136+
<!--Create new customer order.-->
137+
<actionGroup ref="NavigateToNewOrderPageExistingCustomerActionGroup" stepKey="navigateToNewOrderWithExistingCustomer2">
138+
<argument name="customer" value="$createCustomer2$"/>
139+
</actionGroup>
140+
<!--Add bundle product to order.-->
141+
<actionGroup ref="AdminFilterProductInCreateOrderActionGroup" stepKey="filterBundleProduct1">
142+
<argument name="productSKU" value="$createBundleProduct.sku$"/>
143+
</actionGroup>
144+
<click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown1"/>
145+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('2')}}" stepKey="clickToSelectOption1"/>
146+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="clickToCheckboxOption1"/>
147+
<fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty1"/>
148+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover1"/>
149+
<scrollTo selector="{{AdminOrderFormItemsSection.addSelected}}" x="0" y="-100" stepKey="scrollToAddSelectedButton1"/>
150+
<click selector="{{AdminOrderFormItemsSection.addSelected}}" stepKey="clickAddSelectedProducts1"/>
151+
<!--Select FlatRate shipping method-->
152+
<actionGroup ref="AdminSelectFlatRateShippingMethodActionGroup" stepKey="selectFlatRateShippingMethod1"/>
153+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="submitOrder1"/>
154+
<wait time="2" stepKey="waitForPageLoad2" />
155+
<click selector="{{AdminOrderDetailsMainActionsSection.edit}}" stepKey="clickEditButton"/>
156+
<click selector="{{AdminOrderDetailsMainActionsSection.ok}}" stepKey="clickOk"/>
157+
<click selector="{{AdminOrderFormItemsSection.configure}}" stepKey="clickConfigure"/>
158+
<click selector="{{AdminOrderFormConfigureProductSection.selectOption}}" stepKey="clickTodropdown2"/>
159+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductOption('3')}}" stepKey="clickToSelectOption2"/>
160+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('1')}}" stepKey="deselectProduct3"/>
161+
<click selector="{{AdminOrderFormConfigureProductSection.selectProductFromCheckbox('2')}}" stepKey="clickToCheckboxOption2"/>
162+
<fillField userInput="1" selector="{{AdminOrderFormConfigureProductSection.quantity}}" stepKey="fillQty2"/>
163+
<click selector="{{AdminOrderFormConfigureProductSection.ok}}" stepKey="clickOkConfigurablePopover2"/>
164+
<click selector="{{AdminOrderFormItemsSection.updateItemsAndQuantities}}" stepKey="clickUpdateItemsAndQuantity"/>
165+
<grabTextFrom selector="{{AdminOrderFormItemsOrderedSection.itemsSKU('1')}}" stepKey="grabSKU"/>
166+
<grabTextFrom selector="{{AdminOrderFormItemsSection.productName}}" stepKey="grabProductName"/>
167+
168+
<!-- Check that product total is correct -->
169+
<assertStringContainsString stepKey="AssertSKU">
170+
<actualResult type="const">$grabSKU</actualResult>
171+
<expectedResult type="string">SKU:</expectedResult>
172+
</assertStringContainsString>
173+
174+
<assertStringContainsString stepKey="AssertBundleProduct">
175+
<actualResult type="const">$grabProductName</actualResult>
176+
<expectedResult type="string">$$createBundleProduct.name$$</expectedResult>
177+
</assertStringContainsString>
178+
179+
<assertStringContainsString stepKey="AssertProduct2">
180+
<actualResult type="const">$grabSKU</actualResult>
181+
<expectedResult type="const">$$SimpleProduct2.sku$$</expectedResult>
182+
</assertStringContainsString>
183+
184+
<assertStringContainsString stepKey="AssertProduct4">
185+
<actualResult type="const">$grabSKU</actualResult>
186+
<expectedResult type="const">$$SimpleProduct4.sku$$</expectedResult>
187+
</assertStringContainsString>
188+
189+
<see userInput="$40.00" selector="{{AdminOrderTotalSection.subTotal1}}" stepKey="checkSubTotal"/>
190+
</test>
191+
</tests>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderDetailsMainActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@
2626
<element name="shipBtn" type="button" selector="//button[@title='Ship']"/>
2727
<element name="shipmentsTab" type="button" selector="#sales_order_view_tabs_order_shipments"/>
2828
<element name="authorize" type="button" selector="#order_authorize"/>
29+
<element name="ok" type="button" selector=".//*[@data-role='action']"/>
2930
</section>
3031
</sections>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormConfigureProductSection.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,7 @@
2020
<element name="downloadableInformation" type="block" selector="._show #catalog_product_composite_configure_fields_downloadable"/>
2121
<element name="checkLinkDownloadableProduct" type="checkbox" selector="//label[contains(text(),'{{link}}')]/preceding-sibling::input" parameterized="true"/>
2222
<element name="selectOption" type="select" selector="//form[@id='product_composite_configure_form']//select"/>
23+
<element name="selectProductOption" type="select" selector="(.//*[@class='control admin__field-control']/select)[3]//option[{{var}}]" parameterized="true"/>
24+
<element name="selectProductFromCheckbox" type="select" selector="(.//*[@class='nested last']//div/input)[{{var}}]" parameterized="true"/>
2325
</section>
2426
</sections>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderFormItemsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@
3838
<element name="removeCoupon" type="button" selector=".added-coupon-code .action-remove"/>
3939
<element name="totalRecords" type="text" selector="#sales_order_create_search_grid-total-count"/>
4040
<element name="numberOfPages" type="text" selector="div.admin__data-grid-pager-wrap div.admin__data-grid-pager > label"/>
41+
<element name="productName" type="button" selector="(.//*[@class='col-product'])[2]/span"/>
4142
</section>
4243
</sections>

app/code/Magento/Sales/Test/Mftf/Section/AdminOrderTotalSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@
1919
<element name="fpt" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='FPT']/following-sibling::td//span[@class='price']"/>
2020
<element name="taxRule1" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='Canada-GST-5% (5%)']/following-sibling::td//span[@class='price']"/>
2121
<element name="taxRule2" type="text" selector="//table[contains(@class, 'order-subtotal-table')]//td[normalize-space(.)='Canada-GST-PST-5% (5%)']/following-sibling::td//span[@class='price']"/>
22+
<element name="subTotal1" type="text" selector=".//*[@class='col-subtotal col-price']"/>
2223
</section>
2324
</sections>

0 commit comments

Comments
 (0)