Skip to content

#1794: [MFTF] Unskip AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest #29895

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
<description>Assert category grid page image column a specific category</description>
</annotations>

<seeElement selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image(file)}}" stepKey="assertImageColumn"/>
<grabAttributeFrom selector="{{AdminMediaGalleryCatalogUiCategoryGridSection.image}}" userInput="src"
stepKey="getImageSrc"/>
<assertStringContainsString stepKey="assertImageSrc">
<actualResult type="string">{$getImageSrc}</actualResult>
<expectedResult type="string">{{file}}</expectedResult>
</assertStringContainsString>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<entities xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:DataGenerator/etc/dataProfileSchema.xsd">
<entity name="TestSubCategory" type="category">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for introducing this entity instead of SimpleSubCategory?

Copy link
Author

@joweecaquicla joweecaquicla Sep 10, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivaschenko There were instances when the test would fail because the category name did not match, to be more specific, it was the hashed suffix on the category name that did not match so I introduced the new entity.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joweecaquicla what was the reason of not matching hashed suffix?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sivaschenko I was not able to investigate that issue thoroughly as I was not able to replicate it in my local environment.

<data key="name" unique="suffix">TestSubCategory</data>
<data key="name_lwr" unique="suffix">testsubcategory</data>
<data key="is_active">true</data>
<data key="include_in_menu">true</data>
</entity>
</entities>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<section name="AdminMediaGalleryCatalogUiCategoryGridSection">
<element name="clearFilters" type="button" selector=".admin__data-grid-header [data-action='grid-filter-reset']" timeout="30"/>
<element name="activeFilterPlaceholder" type="text" selector="//div[@class='admin__current-filters-list-wrap']//li//span[contains(text(), '{{filterPlaceholder}}')]" parameterized="true"/>
<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"/>
<element name="image" type="text" selector="//tr//td[count(//div[@data-role='grid-wrapper']//tr//th[contains(., 'Image')]/preceding-sibling::th) +1]//img"/>
<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"/>
<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"/>
</section>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest">
<annotations>
<skip>
<issueId value="https://github.com/magento/adobe-stock-integration/issues/1794"/>
</skip>
<features value="AdminMediaGalleryCategoryGrid"/>
<useCaseId value="https://github.com/magento/adobe-stock-integration/issues/1503"/>
<title value="User can open each entity the asset is associated with in a separate tab to manage association"/>
Expand All @@ -22,23 +19,33 @@
<group value="media_gallery_ui"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="category"/>
<createData entity="TestSubCategory" stepKey="category"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminEnhancedMediaGalleryEnableMassActionModeActionGroup" stepKey="enableMassActionToDeleteImages"/>
<actionGroup ref="AdminEnhancedMediaGallerySelectImageForMassActionActionGroup" stepKey="selectSecondImageToDelete">
<argument name="imageName" value="{{UpdatedImageDetails.title}}"/>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectFolderForDelete">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryFolderDeleteActionGroup" stepKey="deleteFolder"/>
<actionGroup ref="AdminMediaGalleryAssertFolderDoesNotExistActionGroup" stepKey="assertFolderWasDeleted">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryClickDeleteImagesButtonActionGroup" stepKey="clikDeleteSelectedButton"/>
<actionGroup ref="AdminEnhancedMediaGalleryConfirmDeleteImagesActionGroup" stepKey="deleteImages"/>
</after>

<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openCategoryPage"/>
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory">
<argument name="category" value="$$category$$"/>
</actionGroup>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploader"/>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetCategoryImageGalleryGridToDefaultView"/>
<actionGroup ref="ClearFiltersAdminDataGridActionGroup" stepKey="clearFilter"/>
<actionGroup ref="AdminMediaGalleryOpenNewFolderFormActionGroup" stepKey="openNewFolderForm"/>
<actionGroup ref="AdminMediaGalleryCreateNewFolderActionGroup" stepKey="createCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryAssertFolderNameActionGroup" stepKey="assertCategoryImageFolderCreated">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage">
<argument name="image" value="ImageUpload"/>
</actionGroup>
Expand All @@ -51,6 +58,10 @@
<actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedCategoryImage"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploaderToVerifyLink"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="selectCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<waitForLoadingMaskToDisappear stepKey="waitForLoadingMaskToDisappear"/>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetails"/>
<actionGroup ref="AdminEnhancedMediaGalleryClickEntityUsedInActionGroup" stepKey="clickUsedInCategories">
<argument name="entityName" value="Categories"/>
Expand Down Expand Up @@ -80,13 +91,15 @@
<actionGroup ref="AssertAdminMediaGalleryAssetFilterPlaceHolderActionGroup" stepKey="assertFilterAppliedAfterUrlFilterApplier">
<argument name="filterPlaceholder" value="{{UpdatedImageDetails.title}}"/>
</actionGroup>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="resetAdminDataGridToDefaultView"/>
<actionGroup ref="ResetAdminDataGridToDefaultViewActionGroup" stepKey="secondResetAdminDataGridToDefaultView"/>

<deleteData createDataKey="category" stepKey="deleteCategory"/>
<actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openMediaGallery"/>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetailsToVerfifyEmptyUsedIn"/>
<actionGroup ref="AdminMediaGalleryFolderSelectActionGroup" stepKey="openCategoryImageFolder">
<argument name="name" value="categoryImage"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetailsToVerifyEmptyUsedIn"/>
<actionGroup ref="AssertAdminEnhancedMediaGalleryUsedInSectionNotDisplayedActionGroup" stepKey="assertThereIsNoUsedInSection"/>
<actionGroup ref="AdminEnhancedMediaGalleryCloseViewDetailsActionGroup" stepKey="closeDetails"/>

</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<data key="fileName">png</data>
<data key="extension">png</data>
</entity>
<entity name="ImageUploadGif" type="uploadImage">
<entity name="ImageUploadGif" type="uploadImage">
<data key="title" unique="suffix">Image1</data>
<data key="file_type">Upload File</data>
<data key="value">gif.gif</data>
Expand Down