|
| 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="AdminRemoveImageAffectsAllScopesTest"> |
| 12 | + <annotations> |
| 13 | + <features value="Catalog"/> |
| 14 | + <stories value="MAGETWO-66442: Changes in default scope not effect product images in other scopes"/> |
| 15 | + <title value="Effect of product images changes in default scope to other scopes"/> |
| 16 | + <description value="Product image should be deleted from all scopes"/> |
| 17 | + <severity value="MAJOR"/> |
| 18 | + <testCaseId value="MAGETWO-94265"/> |
| 19 | + <group value="Catalog"/> |
| 20 | + </annotations> |
| 21 | + <before> |
| 22 | + <!--Create 2 websites (with stores, store views)--> |
| 23 | + <actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/> |
| 24 | + <createData entity="_defaultCategory" stepKey="category"/> |
| 25 | + <createData entity="_defaultProduct" stepKey="product"> |
| 26 | + <requiredEntity createDataKey="category"/> |
| 27 | + </createData> |
| 28 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createWebsite"> |
| 29 | + <argument name="newWebsiteName" value="FirstWebSite"/> |
| 30 | + <argument name="websiteCode" value="FirstWebSiteCode"/> |
| 31 | + </actionGroup> |
| 32 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createNewStore" after="createWebsite"> |
| 33 | + <argument name="website" value="FirstWebSite"/> |
| 34 | + <argument name="storeGroupName" value="NewStore"/> |
| 35 | + <argument name="storeGroupCode" value="Base1"/> |
| 36 | + </actionGroup> |
| 37 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView" after="createNewStore"> |
| 38 | + <argument name="StoreGroup" value="staticFirstStoreGroup"/> |
| 39 | + <argument name="customStore" value="staticStore"/> |
| 40 | + </actionGroup> |
| 41 | + |
| 42 | + <actionGroup ref="AdminCreateWebsiteActionGroup" stepKey="createSecondWebsite" after="createCustomStoreView"> |
| 43 | + <argument name="newWebsiteName" value="SecondWebSite"/> |
| 44 | + <argument name="websiteCode" value="SecondWebSiteCode"/> |
| 45 | + </actionGroup> |
| 46 | + <actionGroup ref="AdminCreateNewStoreGroupActionGroup" stepKey="createSecondStore" after="createSecondWebsite"> |
| 47 | + <argument name="website" value="SecondWebSite"/> |
| 48 | + <argument name="storeGroupName" value="SecondStore"/> |
| 49 | + <argument name="storeGroupCode" value="Base2"/> |
| 50 | + </actionGroup> |
| 51 | + <actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createCustomStoreView2" after="createSecondStore"> |
| 52 | + <argument name="StoreGroup" value="staticStoreGroup"/> |
| 53 | + <argument name="customStore" value="staticSecondStore"/> |
| 54 | + </actionGroup> |
| 55 | + </before> |
| 56 | + |
| 57 | + <after> |
| 58 | + <actionGroup ref="ResetWebUrlOptions" stepKey="resetUrlOption"/> |
| 59 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteWebsite"> |
| 60 | + <argument name="websiteName" value="FirstWebSite"/> |
| 61 | + </actionGroup> |
| 62 | + |
| 63 | + <actionGroup ref="AdminDeleteWebsiteActionGroup" stepKey="deleteSecondWebsite"> |
| 64 | + <argument name="websiteName" value="SecondWebSite"/> |
| 65 | + </actionGroup> |
| 66 | + <deleteData createDataKey="category" stepKey="deletePreReqCategory"/> |
| 67 | + <deleteData createDataKey="product" stepKey="deleteFirstProduct"/> |
| 68 | + <actionGroup ref="logout" stepKey="logout"/> |
| 69 | + </after> |
| 70 | + |
| 71 | + <!--Create product--> |
| 72 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductIndex"/> |
| 73 | + <waitForPageLoad stepKey="waitForProductIndexPage"/> |
| 74 | + <actionGroup ref="resetProductGridToDefaultView" stepKey="resetProductGridColumnsInitial"/> |
| 75 | + |
| 76 | + <!--Open created product--> |
| 77 | + <click selector="{{AdminProductGridSection.productGridNameProduct($$product.name$$)}}" stepKey="createdProduct"/> |
| 78 | + <waitForPageLoad stepKey="waitForOpenedCreatedProduct"/> |
| 79 | + |
| 80 | + <!-- Add image to product --> |
| 81 | + <actionGroup ref="addProductImage" stepKey="addFirstImageForProduct"> |
| 82 | + <argument name="image" value="TestImageNew"/> |
| 83 | + </actionGroup> |
| 84 | + |
| 85 | + <!-- Add second image to product --> |
| 86 | + <actionGroup ref="addProductImage" stepKey="addSecondImageForProduct"> |
| 87 | + <argument name="image" value="MagentoLogo"/> |
| 88 | + </actionGroup> |
| 89 | + <!--"Product in Websites": select both Websites--> |
| 90 | + <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite1"> |
| 91 | + <argument name="website" value="FirstWebSite"/> |
| 92 | + </actionGroup> |
| 93 | + <actionGroup ref="ProductSetWebsite" stepKey="ProductSetWebsite2"> |
| 94 | + <argument name="website" value="SecondWebSite"/> |
| 95 | + </actionGroup> |
| 96 | + |
| 97 | + <!--Go to "Catalog" -> "Products". Open created product--> |
| 98 | + <amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductPage"/> |
| 99 | + <waitForPageLoad stepKey="waitForProductPageLoaded"/> |
| 100 | + <click selector="{{AdminProductGridSection.productGridNameProduct($$product.name$$)}}" stepKey="openCreatedProduct"/> |
| 101 | + <waitForPageLoad stepKey="waitForCreatedProductOpened"/> |
| 102 | + |
| 103 | + <!--Delete Image 1--> |
| 104 | + <actionGroup ref="removeProductImage" stepKey="removeProductImage"/> |
| 105 | + |
| 106 | + <!--Click "Save" in the upper right corner--> |
| 107 | + <actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/> |
| 108 | + |
| 109 | + <!--Switch to "Store view 1"--> |
| 110 | + <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectStoreView"> |
| 111 | + <argument name="storeViewName" value="Store View"/> |
| 112 | + </actionGroup> |
| 113 | + |
| 114 | + <!-- Assert product first image not in admin product form --> |
| 115 | + <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage"> |
| 116 | + <argument name="image" value="TestImageNew"/> |
| 117 | + </actionGroup> |
| 118 | + |
| 119 | + <!--Switch to "Store view 2"--> |
| 120 | + <actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView"> |
| 121 | + <argument name="storeViewName" value="Second Store View"/> |
| 122 | + </actionGroup> |
| 123 | + |
| 124 | + <!-- Verify that Image 1 is deleted from the Second Store View list --> |
| 125 | + <actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInSecondStoreViewPage"> |
| 126 | + <argument name="image" value="TestImageNew"/> |
| 127 | + </actionGroup> |
| 128 | + </test> |
| 129 | +</tests> |
0 commit comments