Skip to content

Commit a4b58eb

Browse files
Kuldip.mahatoManjusha.S
authored andcommitted
MC-26873:StoreFrontReorderVirtualProduct
1 parent b439970 commit a4b58eb

File tree

2 files changed

+89
-0
lines changed

2 files changed

+89
-0
lines changed

app/code/Magento/Checkout/Test/Mftf/Section/CheckoutShippingGuestInfoSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<element name="next" type="button" selector="button.button.action.continue.primary" timeout="30"/>
2525
<element name="firstShippingMethod" type="radio" selector=".row:nth-of-type(1) .col-method .radio"/>
2626
<element name="shippingBlock" type="text" selector="#checkout-step-shipping"/>
27+
<element name="placeOrder" type="button" selector="//button[@class='action primary checkout']"/>
2728

2829
<!--Order Summary-->
2930
<element name="itemInCart" type="button" selector="div.items-in-cart div.title" timeout="30"/>
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
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="StorefrontReorderVirtualProductAsCustomer" >
12+
<annotations>
13+
<stories value="Reorder on Storefront for Virtual product"/>
14+
<title value="Reorder on Storefront for Virtual product"/>
15+
<description value="Verify customer able to reorder on Storefront for simple products."/>
16+
<testCaseId value="https://jira.corp.magento.com/browse/MC-26873"/>
17+
<severity value="MAJOR"/>
18+
<group value="Reorder_Product"/>
19+
</annotations>
20+
21+
<before>
22+
<!-- Login as admin -->
23+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
24+
<!-- create virtual product -->
25+
<createData entity="VirtualProduct" stepKey="createVirtualProduct"/>
26+
<!-- create US customer -->
27+
<createData entity="Simple_US_Customer_NY" stepKey="createDefaultCustomer"/>
28+
<!-- create default category -->
29+
<createData entity="_defaultCategory" stepKey="createCategory"/>
30+
<!-- assign virtual product to default category -->
31+
<createData entity="AssignProductToCategory" stepKey="assignCategoryToVirtualProduct">
32+
<requiredEntity createDataKey="createCategory"/>
33+
<requiredEntity createDataKey="createVirtualProduct"/>
34+
</createData>
35+
</before>
36+
37+
<after>
38+
<!-- delete category,product,customer -->
39+
<deleteData createDataKey="createVirtualProduct" stepKey="deleteVirtualProduct"/>
40+
<deleteData createDataKey="createCategory" stepKey="deleteSimpleCategory"/>
41+
<deleteData createDataKey="createDefaultCustomer" stepKey="deleteCustomer"/>
42+
</after>
43+
44+
<!-- Login to storefront as customer -->
45+
<actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginAsCustomer">
46+
<argument name="Customer" value="$createDefaultCustomer$"/>
47+
</actionGroup>
48+
<waitForPageLoad stepKey="waitForCatalogPageLoad"/>
49+
<!-- go to category -->
50+
<actionGroup ref="StorefrontNavigateCategoryPageActionGroup" stepKey="navigateToCategoryPage">
51+
<argument name="category" value="$$createCategory$$"/>
52+
</actionGroup>
53+
<!-- select the product image and add to cart -->
54+
<click selector="//img[@class='product-image-photo']" stepKey="clickProduct1"/>
55+
<actionGroup ref="AddToCartFromStorefrontProductPageActionGroup" stepKey="addToCartFromStorefrontProductPage">
56+
<argument name="productName" value="$$createVirtualProduct.name$$"/>
57+
</actionGroup>
58+
<!-- click on cart icon and proceed to checkout -->
59+
<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="goToCheckoutFromMiniCartAsCustomer"/>
60+
<click selector="{{CheckoutShippingGuestInfoSection.placeOrder}}" stepKey="clickPlaceOrder"/>
61+
<waitForElement selector="{{CheckoutPaymentSection.paymentSectionTitle}}" stepKey="waitForPaymentSectionLoaded"/>
62+
<waitForElementVisible selector="{{CheckoutPaymentSection.placeOrder}}" stepKey="waitForPlaceOrderButton"/>
63+
<seeElement selector="{{CheckoutSuccessMainSection.success}}" stepKey="orderIsSuccessfullyPlaced"/>
64+
<waitForElementVisible selector="{{CheckoutSuccessMainSection.success}}" stepKey="waitForSuccess"/>
65+
<!-- get order number -->
66+
<grabTextFrom selector="{{CheckoutSuccessMainSection.orderNumber22}}" stepKey="getOrderNumber"/>
67+
<!-- Log in as admin-->
68+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
69+
<!-- go to orders page and validate order details -->
70+
<actionGroup ref="OpenOrderByIdActionGroup" stepKey="addFilterToGridAndOpenOrder">
71+
<argument name="orderId" value="{$getOrderNumber}"/>
72+
</actionGroup>
73+
<see selector="{{AdminOrderDetailsInformationSection.orderStatus}}" userInput="Pending" stepKey="verifyOrderStatus"/>
74+
<click selector="{{AdminOrderDetailsInformationSection.orderStatus}}" stepKey="openOrderDetailPage"/>
75+
<!-- create an invoice for the order-->
76+
<actionGroup ref="AdminCreateInvoiceActionGroup" stepKey="createNewInvoice"/>
77+
<!-- Find the Order in storefront -->
78+
<amOnPage url="{StorefrontHomePage.url}" stepKey="goToStorefrontHomePage" />
79+
<amOnPage url="{{StorefrontGuestOrderSearchPage.url}}" stepKey="amOnOrdersAndReturns"/>
80+
<waitForPageLoad stepKey="waitForStorefrontMyOrdersPage"/>
81+
<!-- Click 'Reorder' link -->
82+
<click selector="{{StorefrontCustomerMyOrdersSection.reorderLink}}" stepKey="clickReturnLink"/>
83+
<waitForPageLoad stepKey="waitForPageLoad2"/>
84+
<!--Check that product from order is visible in cart after reorder -->
85+
<seeElement selector="{{CheckoutCartProductSection.ProductLinkByName($$createVirtualProduct.name$$)}}" stepKey="seeProductInCart"/>
86+
87+
</test>
88+
</tests>

0 commit comments

Comments
 (0)