Skip to content

Commit 879a74e

Browse files
author
Viktor Kopin
committed
adobe-stock-integration#1792: cover by mftf test
1 parent 70b0d06 commit 879a74e

File tree

5 files changed

+103
-0
lines changed

5 files changed

+103
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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="AdminUploadSameImageDeleteFromTemporaryFolderTest">
12+
<annotations>
13+
<features value="AdminUploadSameImageDeleteFromTemporaryFolderTest"/>
14+
<useCaseId value="https://github.com/magento/adobe-stock-integration/issues/1792"/>
15+
<title value="Image is deleted from tmp folder if is uploaded second time"/>
16+
<description value="Image is deleted from tmp folder if is uploaded second time"/>
17+
<severity value="CRITICAL"/>
18+
<group value="media_gallery_ui"/>
19+
</annotations>
20+
<before>
21+
<createData entity="SimpleSubCategory" stepKey="category"/>
22+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
23+
</before>
24+
<after>
25+
<deleteData createDataKey="category" stepKey="deleteCategory"/>
26+
</after>
27+
28+
<!-- Upload test image to category twice -->
29+
<actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openCategoryPage"/>
30+
<actionGroup ref="AdminEditCategoryInGridPageActionGroup" stepKey="editCategoryItem">
31+
<argument name="categoryName" value="$category.name$"/>
32+
</actionGroup>
33+
<actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImage"/>
34+
<actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategoryForm"/>
35+
<actionGroup ref="AddCategoryImageActionGroup" stepKey="addCategoryImageSecondTime"/>
36+
<actionGroup ref="AdminSaveCategoryFormActionGroup" stepKey="saveCategoryFormSecondTime"/>
37+
38+
<!-- Open tmp/category folder -->
39+
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGallery"/>
40+
<actionGroup ref="AdminEnhancedMediaGalleryExpandCatalogTmpFolderActionGroup" stepKey="expandTmpFolder"/>
41+
<actionGroup ref="AdminMediaGalleryFolderSelectByFullPathActionGroup" stepKey="selectCategoryFolder">
42+
<argument name="name" value="catalog/tmp/category"/>
43+
</actionGroup>
44+
45+
<!-- Asset folder is empty -->
46+
<actionGroup ref="AdminAssertMediaGalleryEmptyFolderActionGroup" stepKey="assertEmptyFolder"/>
47+
</test>
48+
</tests>

app/code/Magento/MediaGalleryCatalogUi/Test/Mftf/Section/AdminMediaGalleryCatalogUiCategoryGridSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@
1414
<element name="image" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Image')]/preceding-sibling::th) +1]//img[contains(@src, '{{file}}')]" parameterized="true"/>
1515
<element name="columnValue" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., '{{columnName}}')]/preceding-sibling::th) +1 ]//div" parameterized="true"/>
1616
<element name="edit" type="button" selector="//tr[td//text()[contains(., '{{categoryName}}')]]//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Action')]/preceding-sibling::th) +1 ]//*[text()='{{actionButton}}']" parameterized="true"/>
17+
<element name="noDataMessage" type="text" selector="div.no-data-message-container"/>
1718
</section>
1819
</sections>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
9+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
10+
<actionGroup name="AdminAssertMediaGalleryEmptyFolderActionGroup">
11+
<annotations>
12+
<description>Requires select folder in directory tree. Assert that selected folder is empty.</description>
13+
</annotations>
14+
15+
<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.noDataMessage}}" stepKey="assertNoDataMessageDisplayed" />
16+
</actionGroup>
17+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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="AdminEnhancedMediaGalleryExpandCatalogTmpFolderActionGroup">
12+
<annotations>
13+
<description>Expand media gallery tmp folder tree</description>
14+
</annotations>
15+
<waitForLoadingMaskToDisappear stepKey="waitLoadingMask"/>
16+
<conditionalClick selector="//li[@id='catalog']/ins" dependentSelector="//li[@id='catalog']/ul" visible="false" stepKey="expandCatalog"/>
17+
<wait time="2" stepKey="waitCatalogExpanded"/>
18+
<conditionalClick selector="//li[@id='catalog/tmp']/ins" dependentSelector="//li[@id='catalog/tmp']/ul" visible="false" stepKey="expandTmp"/>
19+
<wait time="2" stepKey="waitTmpExpanded"/>
20+
</actionGroup>
21+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
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="AdminMediaGalleryFolderSelectByFullPathActionGroup"
12+
extends="AdminMediaGalleryFolderSelectActionGroup">
13+
<remove keyForRemoval="selectFolder"/>
14+
<click selector="//li[@id='{{name}}']" stepKey="selectSubFolder" after="waitBeforeClickOnFolder"/>
15+
</actionGroup>
16+
</actionGroups>

0 commit comments

Comments
 (0)