Skip to content

Commit 30f5c61

Browse files
Merge branch 'MAGETWO-66442' into MAGETWO-66442-2.3
2 parents b55989d + 0eb435b commit 30f5c61

File tree

16 files changed

+225
-22
lines changed

16 files changed

+225
-22
lines changed

app/code/Magento/Catalog/Model/Product/Gallery/UpdateHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function processDeletedImages($product, array &$images)
3131

3232
foreach ($images as &$image) {
3333
if (!empty($image['removed'])) {
34-
if (!empty($image['value_id']) && !isset($picturesInOtherStores[$image['file']])) {
34+
if (!empty($image['value_id'])) {
3535
if (preg_match('/\.\.(\\\|\/)/', $image['file'])) {
3636
continue;
3737
}

app/code/Magento/Catalog/Test/Mftf/ActionGroup/AdminProductActionGroup.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,4 +214,30 @@
214214
<click selector="{{AdminProductFormAdvancedPricingSection.doneButton}}" stepKey="clickDone"/>
215215
<waitForElementNotVisible selector="{{AdminProductFormAdvancedPricingSection.specialPrice}}" stepKey="waitForCloseModalWindow"/>
216216
</actionGroup>
217+
218+
<!--Select Product In Websites-->
219+
<actionGroup name="SelectProductInWebsitesActionGroup">
220+
<arguments>
221+
<argument name="website" type="string"/>
222+
</arguments>
223+
<scrollTo selector="{{CreateProductSection.productInWebsite}}" stepKey="ScrollToWebsites"/>
224+
<click selector="{{CreateProductSection.productInWebsite}}" stepKey="ClickTpOpenProductInWebsite"/>
225+
<waitForPageLoad stepKey="waitForPageOpened"/>
226+
<click selector="{{CreateProductSection.isSelected(website)}}" stepKey="SelectWebsite"/>
227+
<click selector="{{CreateProductSection.saveButton}}" stepKey="clickSaveProduct"/>
228+
</actionGroup>
229+
230+
<!--Switch to New Store view-->
231+
<actionGroup name="SwitchToTheNewStoreView">
232+
<arguments>
233+
<argument name="storeViewName" type="string"/>
234+
</arguments>
235+
<scrollTo selector="{{AdminProductContentSection.pageHeader}}" stepKey="scrollToUp"/>
236+
<waitForElementVisible selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="waitForElementBecomeVisible"/>
237+
<click selector="{{AdminProductFormActionSection.changeStoreButton}}" stepKey="clickStoreviewSwitcher"/>
238+
<click selector="{{AdminProductFormActionSection.selectStoreView(storeViewName)}}" stepKey="chooseStoreView"/>
239+
<click selector="{{AdminConfirmationModalSection.ok}}" stepKey="acceptStoreSwitchingMessage"/>
240+
<waitForPageLoad stepKey="waitForPageLoad"/>
241+
</actionGroup>
242+
217243
</actionGroups>

app/code/Magento/Catalog/Test/Mftf/Section/AdminProductContentSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
<element name="descriptionTextArea" type="textarea" selector="#product_form_description"/>
1414
<element name="shortDescriptionTextArea" type="textarea" selector="#product_form_short_description"/>
1515
<element name="sectionHeaderIfNotShowing" type="button" selector="//div[@data-index='content']//div[contains(@class, '_hide')]"/>
16+
<element name="pageHeader" type="textarea" selector="//*[@class='page-header row']"/>
1617
</section>
1718
</sections>
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
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="../../../../../../../vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/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+
<amOnPage url="{{AdminLogoutPage.url}}" stepKey="amOnLogoutPage"/>
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+
90+
<!--"Product in Websites": select both Websites-->
91+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectFirstWebsite">
92+
<argument name="website" value="FirstWebSite"/>
93+
</actionGroup>
94+
95+
<actionGroup ref="SelectProductInWebsitesActionGroup" stepKey="selectSecondWebsite">
96+
<argument name="website" value="SecondWebSite"/>
97+
</actionGroup>
98+
99+
<!--Go to "Catalog" -> "Products". Open created product-->
100+
<amOnPage url="{{AdminProductIndexPage.url}}" stepKey="navigateToProductPage"/>
101+
<waitForPageLoad stepKey="waitForProductPageLoaded"/>
102+
<click selector="{{AdminProductGridSection.productGridNameProduct($$product.name$$)}}" stepKey="openCreatedProduct"/>
103+
<waitForPageLoad stepKey="waitForCreatedProductOpened"/>
104+
105+
<!--Delete Image 1-->
106+
<actionGroup ref="removeProductImage" stepKey="removeProductImage"/>
107+
108+
<!--Click "Save" in the upper right corner-->
109+
<actionGroup ref="saveProductForm" stepKey="saveProductFormAfterRemove"/>
110+
111+
<!--Switch to "Store view 1"-->
112+
<actionGroup ref="SwitchToTheNewStoreView" stepKey="selectStoreView">
113+
<argument name="storeViewName" value="Store View"/>
114+
</actionGroup>
115+
116+
<!-- Assert product first image not in admin product form -->
117+
<actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInAdminProductPage">
118+
<argument name="image" value="TestImageNew"/>
119+
</actionGroup>
120+
121+
<!--Switch to "Store view 2"-->
122+
<actionGroup ref="SwitchToTheNewStoreView" stepKey="selectSecondStoreView">
123+
<argument name="storeViewName" value="Second Store View"/>
124+
</actionGroup>
125+
126+
<!-- Verify that Image 1 is deleted from the Second Store View list -->
127+
<actionGroup ref="assertProductImageNotInAdminProductPage" stepKey="assertProductImageNotInSecondStoreViewPage">
128+
<argument name="image" value="TestImageNew"/>
129+
</actionGroup>
130+
</test>
131+
</tests>

app/code/Magento/ProductVideo/i18n/de_DE.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/en_US.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ Delete,Delete
4040
"Autostart base video","Autostart base video"
4141
"Show related video","Show related video"
4242
"Auto restart video","Auto restart video"
43+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/es_ES.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/fr_FR.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/nl_NL.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

app/code/Magento/ProductVideo/i18n/pt_BR.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
"Preview Image","Preview Image"
88
"Get Video Information","Get Video Information"
99
"Youtube or Vimeo supported","Youtube or Vimeo supported"
10+
"Delete image in all store views","Delete image in all store views"

0 commit comments

Comments
 (0)