Skip to content

Commit 176cf49

Browse files
committed
MC-41981: [Magento Cloud] Reorder Not Working On Storefront
Admin Reorder Product with custom options test
1 parent 1adf291 commit 176cf49

File tree

1 file changed

+134
-0
lines changed

1 file changed

+134
-0
lines changed
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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="urn:magento:mftf:Test/etc/testSchema.xsd">
10+
<test name="AdminReorderProductWithCustomOptionsTest">
11+
<annotations>
12+
<stories value="Admin reorder product with custom options"/>
13+
<title value="Make reorder as Admin"/>
14+
<description value="Make reorder as admin on admin order page with simple product custom options"/>
15+
<severity value="CRITICAL"/>
16+
<testCaseId value="MC-42974"/>
17+
<useCaseId value="MC-41981" />
18+
<group value="sales"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Login As Admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- Create Customer -->
25+
<createData entity="Simple_US_Customer" stepKey="createCustomer"/>
26+
<!-- Create Simple Category -->
27+
<createData entity="_defaultCategory" stepKey="initialCategoryEntity"/>
28+
<!-- Create Simple Product -->
29+
<createData entity="defaultSimpleProduct" stepKey="initialSimpleProduct"/>
30+
</before>
31+
32+
<after>
33+
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
34+
<deleteData createDataKey="initialCategoryEntity" stepKey="deleteDefaultCategory"/>
35+
<deleteData createDataKey="initialSimpleProduct" stepKey="deleteSimpleProduct"/>
36+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
37+
</after>
38+
39+
<!-- Search default simple product in the grid -->
40+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="openProductCatalogPage"/>
41+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="clickFirstRowToOpenDefaultSimpleProduct">
42+
<argument name="product" value="$$initialSimpleProduct$$"/>
43+
</actionGroup>
44+
45+
<!-- Open custom option panel -->
46+
<click selector="{{AdminProductCustomizableOptionsSection.customizableOptions}}" stepKey="openCustomizableOptions"/>
47+
<waitForPageLoad stepKey="waitForCustomOptionsOpen"/>
48+
49+
<!-- Add First Drop Down Custom Options -->
50+
<actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomDropDownOptionFirst">
51+
<argument name="customOptionTitle" value="{{ProductOptionDropDown.title}}"/>
52+
<argument name="customOptionType" value="Drop-down"/>
53+
</actionGroup>
54+
<actionGroup ref="AdminAddTitleAndPriceValueToCustomOptionActionGroup" stepKey="addTitleAndPriceValueToCustomDropDownOptionFirst">
55+
<argument name="optionValue" value="ProductOptionValueDropdown1"/>
56+
</actionGroup>
57+
58+
<!-- Add Custom file option -->
59+
<actionGroup ref="AddProductCustomOptionFileActionGroup" stepKey="addFileOption">
60+
<argument name="option" value="ProductOptionFile"/>
61+
</actionGroup>
62+
63+
<!-- Add Second Drop Down Custom Options -->
64+
<!-- As per issue both drop-down are fixed valued so used again ProductOptionValueDropdown1 DataEntity -->
65+
<actionGroup ref="AdminAddProductCustomOptionActionGroup" stepKey="addProductCustomDropDownOptionSecond">
66+
<argument name="customOptionTitle" value="{{ProductOptionDropDownWithLongValuesTitle.title}}"/>
67+
<argument name="customOptionType" value="Drop-down"/>
68+
</actionGroup>
69+
<actionGroup ref="AdminAddTitleAndPriceValueToCustomOptionActionGroup" stepKey="addTitleAndPriceValueToCustomDropDownOptionSecond">
70+
<argument name="optionValue" value="ProductOptionValueDropdown2"/>
71+
</actionGroup>
72+
73+
<actionGroup ref="SaveProductFormActionGroup" stepKey="saveProduct"/>
74+
75+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/>
76+
77+
<!-- Login to storefront as Customer -->
78+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
79+
<argument name="Customer" value="$$createCustomer$$"/>
80+
</actionGroup>
81+
82+
<!-- Place Order as Customer -->
83+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage">
84+
<argument name="productUrl" value="$$initialSimpleProduct.custom_attributes[url_key]$$"/>
85+
</actionGroup>
86+
87+
<!-- Select Option From First DropDown option -->
88+
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectFirstOption">
89+
<argument name="attributeLabel" value="{{ProductOptionDropDown.title}}"/>
90+
<argument name="optionLabel" value="{{ProductOptionValueDropdown1.title}}"/>
91+
</actionGroup>
92+
93+
<!-- Attach file option -->
94+
<actionGroup ref="StorefrontAttachOptionFileActionGroup" stepKey="selectAndAttachFile"/>
95+
96+
<!-- Select Option From Second DropDown option -->
97+
<actionGroup ref="StorefrontProductPageSelectDropDownOptionValueActionGroup" stepKey="selectSecondOption">
98+
<argument name="attributeLabel" value="{{ProductOptionDropDownWithLongValuesTitle.title}}"/>
99+
<argument name="optionLabel" value="{{ProductOptionValueDropdown2.title}}"/>
100+
</actionGroup>
101+
102+
<!-- Add Product to Card -->
103+
<actionGroup ref="StorefrontAddProductToCartActionGroup" stepKey="addProductToCart">
104+
<argument name="product" value="$$initialSimpleProduct$$"/>
105+
<argument name="productCount" value="1"/>
106+
</actionGroup>
107+
108+
<actionGroup ref="StorefrontCartPageOpenActionGroup" stepKey="openCart"/>
109+
<actionGroup ref="PlaceOrderWithLoggedUserActionGroup" stepKey="placeOrder"/>
110+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="grabOrderNumber"/>
111+
112+
<!-- Log out from storefront as Customer -->
113+
<actionGroup ref="StorefrontCustomerLogoutActionGroup" stepKey="customerLogOut"/>
114+
115+
<!-- Again Login As Admin -->
116+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdminForSubmitShipment"/>
117+
118+
<!-- Open order -->
119+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="openOrderForCreatingShipment">
120+
<argument name="orderId" value="{$grabOrderNumber}"/>
121+
</actionGroup>
122+
<!-- Create Shipment for the order -->
123+
<actionGroup ref="GoToShipmentIntoOrderActionGroup" stepKey="startCreateShipment"/>
124+
<actionGroup ref="SubmitShipmentIntoOrderActionGroup" stepKey="adminClickSubmitShipment"/>
125+
126+
<!-- Reorder created order -->
127+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="adminOpenOrderById">
128+
<argument name="orderId" value="{$grabOrderNumber}"/>
129+
</actionGroup>
130+
<actionGroup ref="AdminStartReorderFromOrderPageActionGroup" stepKey="adminStartReorder"/>
131+
<actionGroup ref="AdminSubmitOrderActionGroup" stepKey="adminSubmitOrder"/>
132+
133+
</test>
134+
</tests>

0 commit comments

Comments
 (0)