|
| 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" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Test/etc/testSchema.xsd"> |
| 10 | + <test name="StorefrontAddProductsToCartFromWishlistUsingSidebarTest"> |
| 11 | + <annotations> |
| 12 | + <title value="Add products from the wishlist to the cart using the sidebar."/> |
| 13 | + <description value="Products added to the cart from wishlist and a customer remains on the same page."/> |
| 14 | + <group value="wishlist"/> |
| 15 | + </annotations> |
| 16 | + <before> |
| 17 | + <createData entity="SimpleSubCategory" stepKey="categoryFirst"/> |
| 18 | + <createData entity="SimpleSubCategory" stepKey="categorySecond"/> |
| 19 | + <createData entity="SimpleProduct" stepKey="simpleProduct1"> |
| 20 | + <requiredEntity createDataKey="categoryFirst"/> |
| 21 | + </createData> |
| 22 | + <createData entity="SimpleProduct" stepKey="simpleProduct2"> |
| 23 | + <requiredEntity createDataKey="categorySecond"/> |
| 24 | + </createData> |
| 25 | + <createData entity="Simple_US_Customer" stepKey="customer"/> |
| 26 | + </before> |
| 27 | + <after> |
| 28 | + <deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/> |
| 29 | + <deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/> |
| 30 | + <deleteData createDataKey="categoryFirst" stepKey="deleteCategoryFirst"/> |
| 31 | + <deleteData createDataKey="categorySecond" stepKey="deleteCategorySecond"/> |
| 32 | + <deleteData createDataKey="customer" stepKey="deleteCustomer"/> |
| 33 | + </after> |
| 34 | + <!-- Sign in as customer --> |
| 35 | + <actionGroup ref="LoginToStorefrontActionGroup" stepKey="loginToStorefrontAccount"> |
| 36 | + <argument name="Customer" value="$$customer$$"/> |
| 37 | + </actionGroup> |
| 38 | + <!-- Add product from first category to the wishlist --> |
| 39 | + <amOnPage url="{{StorefrontCategoryPage.url($$categoryFirst.name$$)}}" stepKey="navigateToCategoryFirstPage"/> |
| 40 | + <actionGroup ref="StorefrontCheckCategorySimpleProduct" stepKey="browseAssertCategoryProduct1"> |
| 41 | + <argument name="product" value="$$simpleProduct1$$"/> |
| 42 | + </actionGroup> |
| 43 | + <actionGroup ref="StorefrontCustomerAddCategoryProductToWishlistActionGroup" stepKey="addSimpleProduct1ToWishlist"> |
| 44 | + <argument name="productVar" value="$$simpleProduct1$$"/> |
| 45 | + </actionGroup> |
| 46 | + <!--Add product to the cart from the Wishlist using the sidebar from the second category page--> |
| 47 | + <amOnPage url="{{StorefrontCategoryPage.url($$categorySecond.name$$)}}" stepKey="navigateToCategorySecondPage"/> |
| 48 | + <actionGroup ref="StorefrontSwitchCategoryViewToListMode" stepKey="switchCategoryViewToListMode"/> |
| 49 | + <actionGroup ref="StorefrontCustomerCheckProductInWishlistSidebar" stepKey="checkSimpleProduct1InWishlistSidebar"> |
| 50 | + <argument name="productVar" value="$$simpleProduct1$$"/> |
| 51 | + </actionGroup> |
| 52 | + <actionGroup ref="StorefrontCustomerAddProductToCartFromWishlistUsingSidebar" stepKey="addProduct1ToCartFromWishlistUsingSidebar"> |
| 53 | + <argument name="product" value="$$simpleProduct1$$"/> |
| 54 | + </actionGroup> |
| 55 | + <!--Check that a customer on the same page as before--> |
| 56 | + <!--hardcoded URL because this method does not support replacement--> |
| 57 | + <seeCurrentUrlMatches regex="~\/$$categorySecond.name$$\.html\?(\S+)?\w+=list(&\S+)?$~i" stepKey="seeCurrentCategoryUrlMatches"/> |
| 58 | + </test> |
| 59 | +</tests> |
0 commit comments