Skip to content

Commit 706aec8

Browse files
committed
Merge remote-tracking branch 'origin/MAGETWO-97349' into 2.3-develop-pr39
2 parents 67e60e5 + dfee5cd commit 706aec8

File tree

40 files changed

+539
-91
lines changed

40 files changed

+539
-91
lines changed

app/code/Magento/Backend/Test/Mftf/Section/AdminMainActionsSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMainActionsSection">
1212
<element name="save" type="button" selector="#save" timeout="30"/>
13+
<element name="saveAndContinue" type="button" selector="button[id*=save_and_continue]" timeout="30"/>
1314
<element name="delete" type="button" selector="#delete" timeout="30"/>
1415
</section>
1516
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminMessagesSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@
1212
<element name="success" type="text" selector="#messages div.message-success"/>
1313
<element name="nthSuccess" type="text" selector=".message.message-success.success:nth-of-type({{n}})>div" parameterized="true"/>
1414
<element name="error" type="text" selector="#messages div.message-error"/>
15+
<element name="notice" type="text" selector=".message.message-notice.notice"/>
1516
</section>
1617
</sections>

app/code/Magento/Backend/Test/Mftf/Section/AdminSlideOutDialogSection.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<!--
3-
/**
4-
* Copyright © Magento, Inc. All rights reserved.
5-
* See COPYING.txt for license details.
6-
*/
7-
-->
8-
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
98
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
109
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1110
<section name="AdminSlideOutDialogSection">
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminAssignImageRolesActionGroup">
12+
<arguments>
13+
<argument name="image"/>
14+
</arguments>
15+
<conditionalClick selector="{{AdminProductImagesSection.productImagesToggleState('closed')}}" dependentSelector="{{AdminProductImagesSection.productImagesToggleState('open')}}" visible="false" stepKey="clickSectionImage"/>
16+
<click selector="{{AdminProductImagesSection.imageFile(image.fileName)}}" stepKey="clickProductImage"/>
17+
<waitForElementVisible selector="{{AdminProductImagesSection.altText}}" stepKey="seeAltTextSection"/>
18+
<checkOption selector="{{AdminProductImagesSection.roleBase}}" stepKey="checkRoleBase"/>
19+
<checkOption selector="{{AdminProductImagesSection.roleSmall}}" stepKey="checkRoleSmall"/>
20+
<checkOption selector="{{AdminProductImagesSection.roleThumbnail}}" stepKey="checkRoleThumbnail"/>
21+
<checkOption selector="{{AdminProductImagesSection.roleSwatch}}" stepKey="checkRoleSwatch"/>
22+
<click selector="{{AdminSlideOutDialogSection.closeButton}}" stepKey="clickCloseButton"/>
23+
</actionGroup>
24+
</actionGroups>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070

7171
<!--Save product and see success message-->
7272
<actionGroup name="saveProductForm">
73-
<scrollToTopOfPage stepKey="scrollToTop"/>
73+
<scrollToTopOfPage stepKey="scrollTopPageProduct"/>
7474
<click selector="{{AdminProductFormActionSection.saveButton}}" stepKey="clickSaveProduct"/>
7575
<see selector="{{AdminProductMessagesSection.successMessage}}" userInput="You saved the product." stepKey="seeSaveConfirmation"/>
7676
</actionGroup>

app/code/Magento/Catalog/Test/Mftf/Data/ProductData.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,4 +497,13 @@
497497
<data key="name" unique="suffix">Product With Long Name And Sku - But not too long</data>
498498
<data key="sku" unique="suffix">Product With Long Name And Sku - But not too long</data>
499499
</entity>
500+
<entity name="Magento3" type="image">
501+
<data key="title" unique="suffix">Magento3</data>
502+
<data key="price">1.00</data>
503+
<data key="file_type">Upload File</data>
504+
<data key="shareable">Yes</data>
505+
<data key="file">magento3.jpg</data>
506+
<data key="filename">magento3</data>
507+
<data key="file_extension">jpg</data>
508+
</entity>
500509
</entities>

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<element name="removeImageButton" type="button" selector=".action-remove"/>
1717
<element name="modalOkBtn" type="button" selector="button.action-primary.action-accept"/>
1818
<element name="uploadProgressBar" type="text" selector=".uploader .file-row"/>
19+
<element name="productImagesToggleState" type="button" selector="[data-index='gallery'] > [data-state-collapsible='{{status}}']" parameterized="true"/>
1920

2021
<element name="nthProductImage" type="button" selector="#media_gallery_content > div:nth-child({{var}}) img.product-image" parameterized="true"/>
2122
<element name="nthRemoveImageBtn" type="button" selector="#media_gallery_content > div:nth-child({{var}}) button.action-remove" parameterized="true"/>
@@ -32,4 +33,4 @@
3233
<element name="isThumbnailSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Thumbnail']"/>
3334
<element name="isSwatchSelected" type="button" selector="//div[contains(@class, 'field-image-role')]//ul/li[contains(@class, 'selected')]/label[normalize-space(.) = 'Swatch']"/>
3435
</section>
35-
</sections>
36+
</sections>

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="StorefrontProductMediaSection">
1212
<element name="imageFile" type="text" selector="//*[@class='product media']//img[contains(@src, '{{filename}}')]" parameterized="true"/>
13+
<element name="productImageActive" type="text" selector=".product.media div[data-active=true] > img[src*='{{filename}}']" parameterized="true"/>
1314
</section>
1415
</sections>
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
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="AdminProductImageAssignmentForMultipleStoresTest">
12+
<annotations>
13+
<features value="Catalog"/>
14+
<stories value="Product image assignment for multiple stores"/>
15+
<title value="Product image assignment for multiple stores"/>
16+
<description value="Product image assignment for multiple stores"/>
17+
<severity value="MAJOR"/>
18+
<testCaseId value="MAGETWO-58718"/>
19+
<group value="product"/>
20+
<group value="WYSIWYGDisabled"/>
21+
</annotations>
22+
<before>
23+
<!-- Login Admin -->
24+
<actionGroup ref="LoginAsAdmin" stepKey="loginAsAdmin"/>
25+
<!-- Create Store View English -->
26+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewEn">
27+
<argument name="customStore" value="customStoreEN"/>
28+
</actionGroup>
29+
<!-- Create Store View France -->
30+
<actionGroup ref="AdminCreateStoreViewActionGroup" stepKey="createStoreViewFr">
31+
<argument name="customStore" value="customStoreFR"/>
32+
</actionGroup>
33+
<!-- Create Category and Simple Product -->
34+
<createData entity="_defaultCategory" stepKey="createCategory"/>
35+
<createData entity="_defaultProduct" stepKey="createSimpleProduct">
36+
<requiredEntity createDataKey="createCategory"/>
37+
<field key="price">100</field>
38+
</createData>
39+
</before>
40+
<after>
41+
<!-- Delete Store View English -->
42+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewEn">
43+
<argument name="customStore" value="customStoreEN"/>
44+
</actionGroup>
45+
<!-- Delete Store View France -->
46+
<actionGroup ref="AdminDeleteStoreViewActionGroup" stepKey="deleteStoreViewFr">
47+
<argument name="customStore" value="customStoreFR"/>
48+
</actionGroup>
49+
<!-- Clear Filter Store -->
50+
<actionGroup ref="clearFiltersAdminDataGrid" stepKey="resetFiltersOnStorePage"/>
51+
<!-- Delete Category and Simple Product -->
52+
<deleteData createDataKey="createSimpleProduct" stepKey="deleteProduct"/>
53+
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
54+
<!-- Clear Filter Product -->
55+
<actionGroup ref="AdminClearFiltersActionGroup" stepKey="clearProductFilters"/>
56+
<!-- Logout Admin -->
57+
<actionGroup ref="logout" stepKey="logoutOfAdmin"/>
58+
</after>
59+
<!-- Search Product and Open Edit -->
60+
<actionGroup ref="SearchForProductOnBackendActionGroup" stepKey="searchProduct">
61+
<argument name="product" value="$$createSimpleProduct$$"/>
62+
</actionGroup>
63+
<actionGroup ref="OpenEditProductOnBackendActionGroup" stepKey="openEditProduct">
64+
<argument name="product" value="$$createSimpleProduct$$"/>
65+
</actionGroup>
66+
67+
<!-- Switch to the English store view -->
68+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewEnglishProduct">
69+
<argument name="storeView" value="customStoreEN.name"/>
70+
</actionGroup>
71+
72+
<!-- Upload Image English -->
73+
<actionGroup ref="addProductImage" stepKey="uploadImageEnglish"/>
74+
<actionGroup ref="saveProductForm" stepKey="saveProduct1"/>
75+
76+
<!-- Switch to the French store view -->
77+
<actionGroup ref="AdminSwitchStoreViewActionGroup" stepKey="switchStoreViewFrenchProduct">
78+
<argument name="storeView" value="customStoreFR.name"/>
79+
</actionGroup>
80+
81+
<!-- Upload Image French -->
82+
<actionGroup ref="addProductImage" stepKey="uploadImageFrench">
83+
<argument name="image" value="Magento3"/>
84+
</actionGroup>
85+
<actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole1">
86+
<argument name="image" value="Magento3"/>
87+
</actionGroup>
88+
<actionGroup ref="saveProductForm" stepKey="saveProduct2"/>
89+
90+
<!-- Switch to the All store view -->
91+
<actionGroup ref="AdminSwitchToAllStoreViewActionGroup" stepKey="switchAllStoreViewProduct"/>
92+
93+
<!-- Upload Image All Store View -->
94+
<actionGroup ref="addProductImage" stepKey="uploadImageAllStoreView">
95+
<argument name="image" value="TestImageNew"/>
96+
</actionGroup>
97+
<actionGroup ref="AdminAssignImageRolesActionGroup" stepKey="assignImageRole">
98+
<argument name="image" value="TestImageNew"/>
99+
</actionGroup>
100+
101+
<!-- Change any product data product description -->
102+
<click selector="{{AdminProductContentSection.sectionHeader}}" stepKey="openDescriptionDropDown"/>
103+
<fillField selector="{{AdminProductContentSection.descriptionTextArea}}" userInput="This is the long description" stepKey="fillLongDescription"/>
104+
<fillField selector="{{AdminProductContentSection.shortDescriptionTextArea}}" userInput="This is the short description" stepKey="fillShortDescription"/>
105+
<actionGroup ref="saveProductForm" stepKey="saveProduct"/>
106+
107+
<!-- Go to Product Page and see Default Store View-->
108+
<amOnPage url="{{StorefrontProductPage.url($$createSimpleProduct.custom_attributes[url_key]$$)}}" stepKey="goToDefaultStorefrontProductPage"/>
109+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(TestImageNew.filename)}}" stepKey="seeActiveImageDefault"/>
110+
111+
<!-- English Switch Store View and see English Store View -->
112+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewEnglish">
113+
<argument name="storeView" value="customStoreEN"/>
114+
</actionGroup>
115+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="openCategoryPage"/>
116+
<waitForPageLoad time="30" stepKey="waitForCategoryPage"/>
117+
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc(ProductImage.fileName)}}" stepKey="seeThumb"/>
118+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct.name$$)}}" stepKey="openProductPage"/>
119+
<waitForPageLoad time="30" stepKey="waitForProductPage"/>
120+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(ProductImage.filename)}}" stepKey="seeActiveImageEnglish"/>
121+
122+
<!-- Switch France Store View and see France Store View -->
123+
<actionGroup ref="StorefrontSwitchStoreViewActionGroup" stepKey="switchStoreViewFrance">
124+
<argument name="storeView" value="customStoreFR"/>
125+
</actionGroup>
126+
<click selector="{{StorefrontHeaderSection.NavigationCategoryByName($$createCategory.name$$)}}" stepKey="openCategoryPage1"/>
127+
<waitForPageLoad time="30" stepKey="waitForCategoryPage1"/>
128+
<seeElement selector="{{StorefrontCategoryProductSection.ProductImageBySrc(Magento3.fileName)}}" stepKey="seeThumb1"/>
129+
<click selector="{{StorefrontCategoryProductSection.ProductTitleByName($$createSimpleProduct.name$$)}}" stepKey="openProductPage1"/>
130+
<waitForPageLoad time="30" stepKey="waitForProductPage1"/>
131+
<seeElement selector="{{StorefrontProductMediaSection.productImageActive(Magento3.filename)}}" stepKey="seeActiveImageFrance"/>
132+
</test>
133+
</tests>

0 commit comments

Comments
 (0)