-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fix issue when can't remove layout update after add during new widget creation #29991
Fix issue when can't remove layout update after add during new widget creation #29991
Conversation
Hi @saphaljha. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
@magento run Functional Tests CE, Functional Tests EE, WebAPI Tests |
targetElement = event.target; | ||
var {$elementName}Array = document.querySelectorAll("{$elementSelector}"); | ||
|
||
{$elementName}Array.forEach(function(element){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make sure that document.querySelectorAll
will return an empty node list if there's no {$elementSelector}
on the page. @saphaljha have you tested this scenario?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rogyar , Thank you for suggestion, I have updated the code for validate empty nodeList. Also, covered MFTF.
Hi @saphaljha. Thank you for your collaboration. Please, check my comment above. Also, I would ask you to cover your fix with an MFTF test. The MFTF test should basically emulate all the steps from "steps to reproduce" and check if it is possible to remove items other than the first one. Thank you! |
@magento run all tests |
<actionGroups | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminCreateAndDeleteMultipleLayoutWidgetActionGroup"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @saphaljha. Great work! Thank you for the coverage.
We may improve this action group by splitting it into more atomic action groups. The main reason of it is the following. The purpose of the current action group is very specific and it might not be reused in many cases. In the meantime, we could split this huge action group into pieces like action group that creates widget, action group that deletes widget, action group that asserts number elements. In this case the smaller action groups will be much more reusable. Also, it's a good idea to double-check if we could reuse the existing action groups for adding/removing widgets.
Hope it makes sense.
Thank you!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @rogyar ,
I have updated it MFTF as per your suggestions, Please check and let me know if there is anything.
Hi @rogyar, thank you for the review. |
@magento Hello |
…ng new widget creation #29991
Hi @saphaljha, thank you for your contribution! |
Description (*)
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)