|
| 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="AdminProductBackRedirectNavigateFromCustomerViewCartProduct"> |
| 12 | + <annotations> |
| 13 | + <features value="Customer"/> |
| 14 | + <title value="Product back redirect navigate from customer view cart product"/> |
| 15 | + <description value="Back button on product page is redirecting to customer page if opened form shopping cart"/> |
| 16 | + <severity value="MINOR"/> |
| 17 | + <group value="Customer"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Create new product--> |
| 21 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 22 | + <createData entity="_defaultProduct" stepKey="createProduct"> |
| 23 | + <requiredEntity createDataKey="createCategory"/> |
| 24 | + </createData> |
| 25 | + |
| 26 | + <!-- Create new customer--> |
| 27 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 28 | + |
| 29 | + <!-- Login as admin--> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 31 | + </before> |
| 32 | + |
| 33 | + <!-- Go to storefront as customer--> |
| 34 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin"> |
| 35 | + <argument name="Customer" value="$$createCustomer$$"/> |
| 36 | + </actionGroup> |
| 37 | + |
| 38 | + <!-- Add product to cart --> |
| 39 | + <actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart"> |
| 40 | + <argument name="product" value="$$createProduct$$"/> |
| 41 | + </actionGroup> |
| 42 | + |
| 43 | + <!-- Navigate to customer edit page in admin --> |
| 44 | + <amOnPage url="{{AdminCustomerPage.url}}edit/id/$$createCustomer.id$$/" stepKey="openCustomerEditPage"/> |
| 45 | + <waitForPageLoad stepKey="waitForCustomerEditPage"/> |
| 46 | + |
| 47 | + <!-- Open shopping cart --> |
| 48 | + <click selector="{{AdminCustomerInformationSection.shoppingCart}}" stepKey="clickShoppingCartButton"/> |
| 49 | + <waitForPageLoad stepKey="waitForPageLoaded"/> |
| 50 | + |
| 51 | + <!-- Open product --> |
| 52 | + <click selector="{{AdminCustomerCartSection.cartItem('1')}}" stepKey="openProduct"/> |
| 53 | + |
| 54 | + <!-- Go back to customer page --> |
| 55 | + <click selector="{{AdminProductFormActionSection.backButton}}" stepKey="goBackToCustomerPage"/> |
| 56 | + |
| 57 | + <!-- Check current page is customer page --> |
| 58 | + <seeInCurrentUrl stepKey="onCustomerAccountPage" url="{{AdminCustomerPage.url}}edit/id/$$createCustomer.id$$/"/> |
| 59 | + |
| 60 | + <after> |
| 61 | + <!--Delete product--> |
| 62 | + <deleteData stepKey="deleteProduct" createDataKey="createProduct"/> |
| 63 | + |
| 64 | + <!--Delete category--> |
| 65 | + <deleteData stepKey="deleteCategory" createDataKey="createCategory"/> |
| 66 | + |
| 67 | + <!--Delete customer--> |
| 68 | + <deleteData stepKey="deleteCustomer" createDataKey="createCustomer"/> |
| 69 | + |
| 70 | + <!-- Sign out--> |
| 71 | + <actionGroup ref="SignOut" stepKey="signOut"/> |
| 72 | + </after> |
| 73 | + </test> |
| 74 | +</tests> |
0 commit comments