Skip to content
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

MFTF tests coverage for Used In links && fix bug with category grid urlFIlterApplie #29392

Merged
merged 5 commits into from
Aug 8, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="AdminMediaGalleryCatalogUiVerifyUsedInLinkCategoryGridTest">
<annotations>
<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"/>
<stories value="Story 58: User sees entities where asset is used in" />
<testCaseId value="https://studio.cucumber.io/projects/131313/test-plan/folders/943908/scenarios/4523889"/>
<description value="User can open each entity the asset is associated with in a separate tab to manage association"/>
<severity value="CRITICAL"/>
<group value="media_gallery_ui"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="category"/>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
</before>
<after>
<actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openMediaGallery"/>
<actionGroup ref="AdminEnhancedMediaGalleryEnableMassActionModeActionGroup" stepKey="enableMassActionToDeleteImages"/>
<actionGroup ref="AdminEnhancedMediaGallerySelectImageForMassActionActionGroup" stepKey="selectSecondImageToDelete">
<argument name="imageName" value="{{UpdatedImageDetails.title}}"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryClickDeleteImagesButtonActionGroup" stepKey="clikDeleteSelectedButton"/>
<actionGroup ref="AdminEnhancedMediaGalleryConfirmDeleteImagesActionGroup" stepKey="deleteImages"/>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
</after>

<actionGroup ref="AdminOpenCategoryPageActionGroup" stepKey="openCategoryPage"/>
<actionGroup ref="AdminCategoriesOpenCategoryActionGroup" stepKey="openCategory">
<argument name="category" value="$$category$$"/>
</actionGroup>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploader"/>
<actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage">
<argument name="image" value="ImageUpload"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="viewImageDetails"/>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsEditActionGroup" stepKey="editImage"/>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsSaveActionGroup" stepKey="saveImage">
<argument name="image" value="UpdatedImageDetails"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryCloseViewDetailsActionGroup" stepKey="closeViewDetails"/>
<actionGroup ref="AdminMediaGalleryClickAddSelectedActionGroup" stepKey="clickAddSelectedCategoryImage"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
<actionGroup ref="AdminOpenMediaGalleryFromCategoryImageUploaderActionGroup" stepKey="openMediaGalleryFromImageUploaderToVerifyLink"/>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="openViewImageDetails"/>
<actionGroup ref="AdminEnhancedMediaGalleryClickEntityUsedInActionGroup" stepKey="clickUsedInCategories">
<argument name="entityName" value="Categories"/>
</actionGroup>
<actionGroup ref="AdminMediaGalleryAssertCategoryNameInCategoryGridActionGroup" stepKey="assertCategoryInGrid">
<argument name="categoryName" value="$$category.name$$"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<body>
<referenceContainer htmlTag="div" htmlClass="media-gallery-category-container" name="content">
<uiComponent name="media_gallery_category_listing"/>
<block class="Magento\Backend\Block\Template" template="Magento_MediaGalleryCatalogUi::url_filter_applier.phtml" name="category_list_url_filter_applier"/>
</referenceContainer>
</body>
</page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

/** @var $block \Magento\Backend\Block\Template */
/** @var \Magento\Framework\Escaper $escaper */
?>
<script type="text/x-magento-init">
{
"*": {
"Magento_Ui/js/grid/url-filter-applier": {
"listingNamespace": "media_gallery_category_listing"
}
}
}
</script>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
<actionGroup name="AdminEnhancedMediaGalleryClickEntityUsedInActionGroup">
<annotations>
<description>Clicks one Used In section entity</description>
</annotations>
<arguments>
<argument name="entityName" type="string"/>
</arguments>

<click selector="{{AdminEnhancedMediaGalleryViewDetailsSection.usedInLink(entityName)}}" stepKey="openContextMenu"/>
<waitForPageLoad stepKey="waitForPageLoad"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
<element name="confirmDelete" type="button" selector=".action-accept"/>
<element name="addImage" type="button" selector=".add-image-action"/>
<element name="cancel" type="button" selector="#image-details-action-cancel"/>
<element name="usedInLink" type="button" parameterized="true" selector="//div[@class='attribute']/span[contains(text(), 'Used In')]/following-sibling::div/a[contains(text(), '{{entityName}}')]"/>
</section>
</sections>
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryClickDeleteImagesButtonActionGroup" stepKey="clikDeleteSelectedButton"/>
<actionGroup ref="AdminEnhancedMediaGalleryConfirmDeleteImagesActionGroup" stepKey="deleteImage"/>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<deleteData createDataKey="category" stepKey="deleteCategory"/>
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
</after>

Expand All @@ -64,14 +64,14 @@
<actionGroup ref="AdminMediaGalleryClickOkButtonTinyMce4ActionGroup" stepKey="clickOkButton"/>
<actionGroup ref="AdminSaveCategoryActionGroup" stepKey="saveCategory"/>
<actionGroup ref="AdminOpenCategoryGridPageActionGroup" stepKey="openCategoryGridPage"/>

<actionGroup ref="AdminEnhancedMediaGalleryCategoryGridExpandFilterActionGroup" stepKey="expandFilters"/>
<actionGroup ref="AdminEnhancedMediaGallerySelectUsedInFilterActionGroup" stepKey="setUsedInFilter">
<argument name="filterName" value="Asset"/>
<argument name="optionName" value="{{ImageMetadata.title}}"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryCategoryGridApplyFiltersActionGroup" stepKey="applyFilters"/>

<actionGroup ref="AdminMediaGalleryAssertCategoryNameInCategoryGridActionGroup" stepKey="assertCategoryInGrid">
<argument name="categoryName" value="$$category.name$$"/>
</actionGroup>
Expand Down
12 changes: 7 additions & 5 deletions app/code/Magento/Ui/view/base/web/js/form/element/ui-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,13 @@ define([
return false;
},

/**
* Return empty options html
*/
getEmptyOptionsUnsanitizedHtml: function () {
return this.emptyOptionsHtml;
},

/**
* Check options length and set to cache
* if some options is added
Expand Down Expand Up @@ -748,11 +755,6 @@ define([
return this.value() ? !!this.value().length : false;
},

/**
* @deprecated
*/
onMousemove: function () {},

/**
* Handles hover on list items.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,12 @@
</div>
<div ifnot="options().length"
class="admin__action-multiselect-empty-area">
<ul data-bind="html: emptyOptionsHtml"/>
<ul data-bind="html: getEmptyOptionsUnsanitizedHtml"/>
</div>
<!-- /ko -->
<ul class="admin__action-multiselect-menu-inner _root"
data-bind="
event: {
mousemove: function(data, event){onMousemove($data, $index(), event)},
scroll: function(data, event){onScrollDown(data, event)}
}
">
Expand Down