|
| 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