|
| 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="AdminLoginAsCustomerAddProductToWishlistTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Login As Customer"/> |
| 14 | + <stories value="Added product to wish-list"/> |
| 15 | + <title value="Admin user login as customer and add products to customer's wish-list"/> |
| 16 | + <description |
| 17 | + value="Verify that Admin can add products to customer's wish-list using Login As Customer functionality"/> |
| 18 | + <severity value="AVERAGE"/> |
| 19 | + <group value="login_as_customer"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 1" |
| 23 | + stepKey="enableLoginAsCustomer"/> |
| 24 | + <magentoCLI command="cache:flush config" stepKey="flushCacheBeforeTestRun"/> |
| 25 | + <createData entity="_defaultCategory" stepKey="createCategory"/> |
| 26 | + <createData entity="SimpleProduct" stepKey="createSimpleProduct"> |
| 27 | + <requiredEntity createDataKey="createCategory"/> |
| 28 | + </createData> |
| 29 | + <createData entity="Simple_US_Customer" stepKey="createCustomer"/> |
| 30 | + <actionGroup ref="LoginAsAdmin" stepKey="login"/> |
| 31 | + </before> |
| 32 | + <after> |
| 33 | + <deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/> |
| 34 | + <deleteData createDataKey="createCategory" stepKey="deleteCategory"/> |
| 35 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/> |
| 36 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logout"/> |
| 37 | + <magentoCLI command="config:set {{LoginAsCustomerConfigDataEnabled.path}} 0" |
| 38 | + stepKey="disableLoginAsCustomer"/> |
| 39 | + <magentoCLI command="cache:flush config" stepKey="flushCacheAfterTestRun"/> |
| 40 | + </after> |
| 41 | + |
| 42 | + <!-- Admin Login As Customer from Customer page --> |
| 43 | + <actionGroup ref="AdminLoginAsCustomerLoginFromCustomerPageActionGroup" |
| 44 | + stepKey="lLoginAsCustomerFromCustomerPage"> |
| 45 | + <argument name="customerId" value="$$createCustomer.id$$"/> |
| 46 | + </actionGroup> |
| 47 | + |
| 48 | + <!-- Navigate to Product page and add it to Wishlist --> |
| 49 | + <actionGroup ref="OpenStoreFrontProductPageActionGroup" stepKey="openProductPage"> |
| 50 | + <argument name="productUrlKey" value="$$createSimpleProduct.custom_attributes[url_key]$$"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="StorefrontCustomerAddProductToWishlistActionGroup" stepKey="addProductToWishlist"> |
| 53 | + <argument name="productVar" value="$$createSimpleProduct$$"/> |
| 54 | + </actionGroup> |
| 55 | + |
| 56 | + <!-- Open Customer Wishlist and verify Product present there --> |
| 57 | + <actionGroup ref="AssertProductIsPresentInWishListActionGroup" stepKey="assertProductInWishlist"> |
| 58 | + <argument name="productName" value="$$createSimpleProduct.name$$"/> |
| 59 | + <argument name="productPrice" value="$$createSimpleProduct.price$$"/> |
| 60 | + </actionGroup> |
| 61 | + </test> |
| 62 | +</tests> |
0 commit comments