Skip to content

Commit

Permalink
ENGCOM-8199: The "three dots" context menu is not closed after unsucc…
Browse files Browse the repository at this point in the history
…essful licensing from Media Gallery #29967
  • Loading branch information
gabrieldagama committed Sep 14, 2020
2 parents 4ae0f74 + 1e114f5 commit 4d73b70
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?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="AssertAdminMediaGalleryContextMenuOpenedActionGroup">
<annotations>
<description>Verify that context menu is closed in Media Gallery.</description>
</annotations>
<dontSeeElement selector="{{AdminEnhancedMediaGalleryImageActionsSection.contextMenuItem}}" stepKey="verifyContextMenuIsClosed" />
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
<section name="AdminEnhancedMediaGalleryImageActionsSection">
<element name="openContextMenu" type="button" selector=".three-dots"/>
<element name="contextMenuItem" type="block" selector="//div[@class='media-gallery-image']//ul[@class='action-menu _active']//li//a[@class='action-menu-item']"/>
<element name="viewDetails" type="button" selector="[data-ui-id='action-image-details']"/>
<element name="delete" type="button" selector="[data-ui-id='action-delete']"/>
<element name="edit" type="button" selector="[data-ui-id='action-edit']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ define([
deleteImageUrl: 'media_gallery/image/delete',
addSelectedBtnSelector: '#add_selected',
deleteSelectedBtnSelector: '#delete_selected',
gridSelector: '[data-id="media-gallery-masonry-grid"]',
selected: null,
allowedActions: [],
fields: {
Expand Down Expand Up @@ -281,6 +282,7 @@ define([
*/
addMessage: function (code, message) {
this.messages().add(code, message);
this.closeContextMenu();
this.scrollToMessageContent();
this.messages().scheduleCleanup();
},
Expand All @@ -298,6 +300,13 @@ define([
}
},

/**
* Action to close the context menu in media gallery.
*/
closeContextMenu: function () {
$(this.gridSelector).click();
},

/**
* Scroll to the top of media gallery page
*/
Expand Down

0 comments on commit 4d73b70

Please sign in to comment.