|
| 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="AdminShouldBeAbleToAssociateSimpleProductToWebsitesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="Edit products"/> |
| 15 | + <title value="Admin should be able to associate simple product to websites"/> |
| 16 | + <description value="Admin should be able to associate simple product to websites"/> |
| 17 | + <testCaseId value="MC-3483"/> |
| 18 | + <group value="catalog"/> |
| 19 | + <severity value="AVERAGE"/> |
| 20 | + </annotations> |
| 21 | + |
| 22 | + <before> |
| 23 | + <magentoCLI command="config:set {{StorefrontEnableAddStoreCodeToUrls.path}} {{StorefrontEnableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToYes"/> |
| 24 | + <createData entity="secondCustomWebsite" stepKey="createCustomWebsite"/> |
| 25 | + <createData entity="SimpleProduct2" stepKey="createSimpleProduct"/> |
| 26 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 27 | + <actionGroup ref="AdminStoreGroupCreateActionGroup" stepKey="createNewStore"> |
| 28 | + <argument name="Website" value="secondCustomWebsite"/> |
| 29 | + <argument name="storeGroup" value="customStoreGroup"/> |
| 30 | + </actionGroup> |
| 31 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView"> |
| 32 | + <argument name="StoreGroup" value="customStoreGroup"/> |
| 33 | + <argument name="customStore" value="customStoreEN"/> |
| 34 | + </actionGroup> |
| 35 | + </before> |
| 36 | + |
| 37 | + <after> |
| 38 | + <magentoCLI command="config:set {{StorefrontDisableAddStoreCodeToUrls.path}} {{StorefrontDisableAddStoreCodeToUrls.value}}" stepKey="setAddStoreCodeToUrlsToNo"/> |
| 39 | + <deleteData createDataKey="createSimpleProduct" stepKey="deleteSimpleProduct"/> |
| 40 | + <!-- Delete second website --> |
| 41 | + <actionGroup ref="DeleteCustomWebsiteActionGroup" stepKey="deleteCustomWeWebsite"> |
| 42 | + <argument name="websiteName" value="$createCustomWebsite.website[name]$"/> |
| 43 | + </actionGroup> |
| 44 | + <actionGroup ref="AdminGridFilterResetActionGroup" stepKey="resetFiltersOnStoresIndexPage"/> |
| 45 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToResetFilters"/> |
| 46 | + <actionGroup ref="clearFiltersAdminDataGrid" stepKey="clearFiltersOnProductIndexPage"/> |
| 47 | + <actionGroup ref="logout" stepKey="logout"/> |
| 48 | + </after> |
| 49 | + |
| 50 | + <!-- 1. Go to product page in admin panel to edit --> |
| 51 | + <actionGroup ref="AdminOpenProductIndexPageActionGroup" stepKey="openProductIndexPageToAssociateToSecondWebsite"/> |
| 52 | + <actionGroup ref="filterProductGridByName2" stepKey="filterProductInGrid"> |
| 53 | + <argument name="name" value="$$createSimpleProduct.name$$"/> |
| 54 | + </actionGroup> |
| 55 | + |
| 56 | + <!-- 2. Go to Product in Websites tab, unassign product from Main website and assign it to Second website --> |
| 57 | + <actionGroup ref="AdminProcessProductWebsitesActionGroup" stepKey="processProductWebsites"> |
| 58 | + <argument name="website" value="secondCustomWebsite"/> |
| 59 | + <argument name="websiteToUnassign" value="_defaultWebsite"/> |
| 60 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 61 | + </actionGroup> |
| 62 | + <actionGroup ref="AssertProductIsAssignedToWebsite" stepKey="seeCustomWebsiteIsChecked"> |
| 63 | + <argument name="website" value="$createCustomWebsite.website[name]$"/> |
| 64 | + </actionGroup> |
| 65 | + <actionGroup ref="AssertProductIsNotAssignedToWebsite" stepKey="seeMainWebsiteIsNotChecked"> |
| 66 | + <argument name="website" value="{{_defaultWebsite.name}}"/> |
| 67 | + </actionGroup> |
| 68 | + |
| 69 | + <!-- 3. Go to frontend and open Simple product on Main website and assert 404 page--> |
| 70 | + <actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductPage"> |
| 71 | + <argument name="productUrl" value="$createSimpleProduct.custom_attributes[url_key]$"/> |
| 72 | + </actionGroup> |
| 73 | + <actionGroup ref="StorefrontAssertPageNotFoundErrorOnProductDetailPageActionGroup" stepKey="assertPageNotFoundErrorOnProductDetailPage"> |
| 74 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 75 | + </actionGroup> |
| 76 | + |
| 77 | + <!-- 4. Open Simple product on Second website and assert its name --> |
| 78 | + <actionGroup ref="StorefrontOpenProductPageUsingStoreCodeInUrlActionGroup" stepKey="openProductPageUsingStoreCodeInUrl"> |
| 79 | + <argument name="product" value="$$createSimpleProduct$$"/> |
| 80 | + <argument name="storeView" value="customStoreEN"/> |
| 81 | + </actionGroup> |
| 82 | + </test> |
| 83 | +</tests> |
0 commit comments