Skip to content

#1703: The deleted tags are not removed from Tags drop-down until the web page is refreshed #29400

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
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,21 @@
<?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="AdminMediaGalleryEditAssetRemoveKeywordActionGroup">
<annotations>
<description>Remove Keywords on the Edit Details panel</description>
</annotations>
<arguments>
<argument name="keyword" type="string"/>
</arguments>

<click selector="{{AdminEnhancedMediaGalleryEditDetailsSection.removeSelectedKeyword(keyword)}}" stepKey="removeKeyword"/>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?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="AssetAdminEnhancedMediaGalleryAssetDetailsKeywordsAbsentActionGroup">
<annotations>
<description>Verifies that the passed comma-separated list of keywords are not present on the View Details panel</description>
</annotations>
<arguments>
<argument name="keywords" type="string"/>
</arguments>

<grabTextFrom selector="{{AdminEnhancedMediaGalleryViewDetailsSection.keywords}}" stepKey="grabKeywords"/>
<assertStringNotContainsString stepKey="verifyKeywords">
<actualResult type="variable">grabKeywords</actualResult>
<expectedResult type="string">{{keywords}}</expectedResult>
</assertStringNotContainsString>
</actionGroup>
</actionGroups>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<element name="description" type="textarea" selector="#description"/>
<element name="newKeyword" type="input" selector="[data-ui-id='keyword']"/>
<element name="addNewKeyword" type="input" selector="[data-ui-id='add-keyword']"/>
<element name="removeSelectedKeyword" type="button" selector="//span[contains(text(), '{{keyword}}')]/following-sibling::button[@data-action='remove-selected-item']" parameterized="true"/>
<element name="cancel" type="button" selector="#image-details-action-cancel"/>
<element name="save" type="button" selector="#image-details-action-save"/>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?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="AdminEnhancedMediaGalleryVerifyUpdatedTagsTest">
<annotations>
<features value="MediaGallery"/>
<useCaseId value="https://github.com/magento/adobe-stock-integration/issues/1703"/>
<title value="User checks if the deleted tags are removed from Edit page, Tags field"/>
<stories value="User checks if the deleted tags are removed from Edit page, Tags field"/>
<testCaseId value="https://studio.cucumber.io/projects/131313/test-plan/folders/1337102/scenarios/5064888"/>
<description value="User checks if changes made on the tags are updated from Edit page, Tags field"/>
<severity value="CRITICAL"/>
<group value="media_gallery_ui"/>
</annotations>
<before>
<actionGroup ref="AdminLoginActionGroup" stepKey="loginAsAdmin"/>
<actionGroup ref="AdminOpenStandaloneMediaGalleryActionGroup" stepKey="openMediaGallery"/>
</before>
<after>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsDeleteActionGroup" stepKey="deleteImage"/>
</after>
<actionGroup ref="AdminEnhancedMediaGalleryUploadImageActionGroup" stepKey="uploadImage">
<argument name="image" value="ImageUpload3"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryViewImageDetails" stepKey="viewImageDetails"/>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsEditActionGroup" stepKey="editImage"/>
Copy link
Member

Choose a reason for hiding this comment

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

I think AdminEnhancedMediaGalleryViewImageDetails should be executed before this step

<actionGroup ref="AdminMediaGalleryEditAssetAddKeywordActionGroup" stepKey="setKeywords">
<argument name="keyword" value="UpdatedImageDetails.keyword"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsSaveActionGroup" stepKey="saveImage">
<argument name="image" value="UpdatedImageDetails"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryVerifyImageKeywordsActionGroup" stepKey="verifyAddedKeywords">
<argument name="keywords" value="UpdatedImageDetails.keyword"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsEditActionGroup" stepKey="updateImageDetails"/>
<actionGroup ref="AdminMediaGalleryEditAssetRemoveKeywordActionGroup" stepKey="removeKeywords">
<argument name="keyword" value="{{UpdatedImageDetails.keyword}}"/>
</actionGroup>
<actionGroup ref="AdminEnhancedMediaGalleryImageDetailsSaveActionGroup" stepKey="saveUpdatedImage">
<argument name="image" value="UpdatedImageDetails"/>
</actionGroup>
<actionGroup ref="AssetAdminEnhancedMediaGalleryAssetDetailsKeywordsAbsentActionGroup" stepKey="verifyRemovedKeywords">
<argument name="keywords" value="{{UpdatedImageDetails.keyword}}"/>
</actionGroup>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ define([
form = modalElement.find('#image-edit-details-form'),
imageId = this.imageModel().getSelected().id,
keywords = this.mediaGalleryEditDetails().selectedKeywords(),
imageDetails = this.mediaGalleryImageDetails();
imageDetails = this.mediaGalleryImageDetails(),
imageEditDetails = this.mediaGalleryEditDetails();

if (form.validation('isValid')) {
saveDetails(
Expand All @@ -98,6 +99,7 @@ define([
this.closeModal();
this.imageModel().reloadGrid();
imageDetails.removeCached(imageId);
imageEditDetails.removeCached(imageId);

if (imageDetails.isActive()) {
imageDetails.showImageDetailsById(imageId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ define([
}

return true;
},

/**
* Remove cached image details in edit form
*
* @param {String} id
*/
removeCached: function (id) {
delete this.images[id];
}
});
});