|
| 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 | +<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 9 | + xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> |
| 10 | + <test name="AdminChangeRelatedProductPropertiesOnStoreViewLevelTest"> |
| 11 | + <annotations> |
| 12 | + <features value="Catalog"/> |
| 13 | + <stories value="Product properties as per store view"/> |
| 14 | + <title value="Change related product properties on store view level"/> |
| 15 | + <description value="Change name and status of product properties on diferrent store view levels"/> |
| 16 | + <severity value="MAJOR"/> |
| 17 | + <testCaseId value="AC-4491"/> |
| 18 | + </annotations> |
| 19 | + <before> |
| 20 | + <!-- Login as admin --> |
| 21 | + <actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/> |
| 22 | + <!--Create product A--> |
| 23 | + <createData entity="SimpleProduct" stepKey="createSimpleProductA"/> |
| 24 | + <!--Create product B--> |
| 25 | + <createData entity="SimpleProduct" stepKey="createSimpleProductB"/> |
| 26 | + <!--Create website 1--> |
| 27 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite1"> |
| 28 | + <argument name="newWebsiteName" value="{{NewWebSiteData.name}}"/> |
| 29 | + <argument name="websiteCode" value="{{NewWebSiteData.code}}"/> |
| 30 | + </actionGroup> |
| 31 | + <!-- Create store 1--> |
| 32 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore1"> |
| 33 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 34 | + <argument name="storeGroupName" value="{{NewWebSiteData.name}}"/> |
| 35 | + <argument name="storeGroupCode" value="{{NewWebSiteData.code}}"/> |
| 36 | + </actionGroup> |
| 37 | + <!-- Create store view 1--> |
| 38 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView1"> |
| 39 | + <argument name="StoreGroup" value="NewWebSiteData"/> |
| 40 | + <argument name="customStore" value="NewWebSiteData"/> |
| 41 | + </actionGroup> |
| 42 | + <!--Create website 2--> |
| 43 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite2"> |
| 44 | + <argument name="newWebsiteName" value="{{secondCustomWebsite.name}}"/> |
| 45 | + <argument name="websiteCode" value="{{secondCustomWebsite.code}}"/> |
| 46 | + </actionGroup> |
| 47 | + <!-- Create store 2--> |
| 48 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createStore2"> |
| 49 | + <argument name="website" value="{{secondCustomWebsite.name}}"/> |
| 50 | + <argument name="storeGroupName" value="{{secondCustomWebsite.name}}"/> |
| 51 | + <argument name="storeGroupCode" value="{{secondCustomWebsite.code}}"/> |
| 52 | + </actionGroup> |
| 53 | + <!-- Create store view 2--> |
| 54 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreView2"> |
| 55 | + <argument name="StoreGroup" value="secondCustomWebsite"/> |
| 56 | + <argument name="customStore" value="secondCustomWebsite"/> |
| 57 | + </actionGroup> |
| 58 | + </before> |
| 59 | + <after> |
| 60 | + <!--Delete product--> |
| 61 | + <deleteData createDataKey="createSimpleProductA" stepKey="deleteSimpleProductA"/> |
| 62 | + <!--Delete product--> |
| 63 | + <deleteData createDataKey="createSimpleProductB" stepKey="deleteSimpleProductB"/> |
| 64 | + <!--Delete website 1--> |
| 65 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite1"> |
| 66 | + <argument name="websiteName" value="{{NewWebSiteData.name}}"/> |
| 67 | + </actionGroup> |
| 68 | + <!--Delete website 2--> |
| 69 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="DeleteWebsite2"> |
| 70 | + <argument name="websiteName" value="{{secondCustomWebsite.name}}"/> |
| 71 | + </actionGroup> |
| 72 | + <!--Logout as Admin--> |
| 73 | + <actionGroup ref="AdminLogoutActionGroup" stepKey="logoutAsAdmin"/> |
| 74 | + </after> |
| 75 | + <!--Open simple product A--> |
| 76 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductA"> |
| 77 | + <argument name="productId" value="$$createSimpleProductA.id$$"/> |
| 78 | + </actionGroup> |
| 79 | + <!--Assign product A to website 1--> |
| 80 | + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsite1"> |
| 81 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 82 | + </actionGroup> |
| 83 | + <!--Assign product A to website 2--> |
| 84 | + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductAtoWebsit2"> |
| 85 | + <argument name="website" value="{{secondCustomWebsite.name}}"/> |
| 86 | + </actionGroup> |
| 87 | + <!--Add simple product B as related product--> |
| 88 | + <actionGroup ref="AddRelatedProductBySkuActionGroup" stepKey="addProductBasRelatedProduct"> |
| 89 | + <argument name="sku" value="$$createSimpleProductB.sku$$"/> |
| 90 | + </actionGroup> |
| 91 | + <!--Save product A--> |
| 92 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductA"/> |
| 93 | + <!--Open simple product B--> |
| 94 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductB"> |
| 95 | + <argument name="productId" value="$$createSimpleProductB.id$$"/> |
| 96 | + </actionGroup> |
| 97 | + <!--Assign product B to website 1--> |
| 98 | + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite1"> |
| 99 | + <argument name="website" value="{{NewWebSiteData.name}}"/> |
| 100 | + </actionGroup> |
| 101 | + <!--Assign product B to website 2--> |
| 102 | + <actionGroup ref="AdminAssignProductInWebsiteActionGroup" stepKey="assignProductBtoWebsite2"> |
| 103 | + <argument name="website" value="{{secondCustomWebsite.name}}"/> |
| 104 | + </actionGroup> |
| 105 | + <!--Save product B--> |
| 106 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="saveProductB"/> |
| 107 | + <!--Change Scope to store view 2--> |
| 108 | + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="changeScopeToStoreView2"> |
| 109 | + <argument name="storeViewName" value="{{secondCustomWebsite.name}}"/> |
| 110 | + </actionGroup> |
| 111 | + <!--Uncheck default product status--> |
| 112 | + <waitForElementVisible selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="waitForDefaultValueCheckBox"/> |
| 113 | + <uncheckOption selector="{{AdminProductFormSection.productStatusUseDefault}}" stepKey="uncheckDefaultProductStatus"/> |
| 114 | + <!-- Change status of product to "Disable" and save it having scope as Website--> |
| 115 | + <actionGroup ref="AdminSetProductDisabledActionGroup" stepKey="disableProductStatusHavingScopeWebsite"/> |
| 116 | + <!--Change product name having scope as store view--> |
| 117 | + <actionGroup ref="AdminChangeProductNameAsPerStoreViewScopeActionGroup" stepKey="changeProductNameHavingScopeStoreView"> |
| 118 | + <argument name="productName" value="B2"/> |
| 119 | + </actionGroup> |
| 120 | + <!--Save product B--> |
| 121 | + <actionGroup ref="SaveProductFormActionGroup" stepKey="againSaveProductB"/> |
| 122 | + <!--Open simple product A again--> |
| 123 | + <actionGroup ref="AdminProductPageOpenByIdActionGroup" stepKey="openSimpleProductAagain"> |
| 124 | + <argument name="productId" value="$$createSimpleProductA.id$$"/> |
| 125 | + </actionGroup> |
| 126 | + <!--Switch scope to store view 1--> |
| 127 | + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView1"> |
| 128 | + <argument name="storeViewName" value="{{NewWebSiteData.name}}"/> |
| 129 | + </actionGroup> |
| 130 | + <!--Expand "Related Products" tab--> |
| 131 | + <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="openRelatedProductTab"/> |
| 132 | + <!--Assert product name and status as per store view 1--> |
| 133 | + <waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="$$createSimpleProductB.name$$" stepKey="assertView1ProductName"/> |
| 134 | + <waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Enabled" stepKey="assertView1ProductStatus"/> |
| 135 | + <!--Switch scope to store view 2--> |
| 136 | + <actionGroup ref="SwitchToTheNewStoreViewActionGroup" stepKey="switchScopeToStoreView2"> |
| 137 | + <argument name="storeViewName" value="{{secondCustomWebsite.name}}"/> |
| 138 | + </actionGroup> |
| 139 | + <!--Expand "Related Products" tab--> |
| 140 | + <conditionalClick selector="{{AdminProductFormSection.productFormTab('Related Products')}}" dependentSelector="{{AdminProductFormSection.productFormTabState('Related Products', 'closed')}}" visible="true" stepKey="expandRelatedProductTab"/> |
| 141 | + <!--Assert product name and status as per store view 2--> |
| 142 | + <waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.selectedRelatedProduct}}" userInput="B2" stepKey="assertView2ProductName"/> |
| 143 | + <waitForText selector="{{AdminProductFormRelatedUpSellCrossSellSection.relatedProductStatus}}" userInput="Disabled" stepKey="assertView2ProductStatus"/> |
| 144 | + </test> |
| 145 | +</tests> |
0 commit comments