-
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
MC-30152: Bundle Product / Create / Price validation for dynamic price #31501
Conversation
Hi @engcom-Echo. 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 |
1 similar comment
@magento run all tests |
@magento run WebAPI Tests |
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 @engcom-Echo, thank you for the fix and test coverage. Could you please review the minor suggestions from my side?
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertAdminErrorMessageDisappearDisabledFieldActionGroup"> |
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.
The ActionGroup does too many things and I don't think it's a reusable one. I would split it in at least into the following ones:
- AdminTogglePriceSwitcherActionGroup
- AdminFocusAndFillElementActionGroup
- AdminAssertErrorIsVisibleActionGroup / AdminAssertErrorIsNotVisibleActionGroup
What do you think about a such refactoring?
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.
Thanks. Good idea.
--> | ||
<!-- Test XML Example --> | ||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminDisappearErrorValidateMessageFieldTest"> |
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.
I would rather move this test under Magento_Bundle module, as the test is more related to Bundle product. What do you think?
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, @eduard13
We change UI component and I think a test must be in module Ui. The test scenario is related to an issue. Maybe there are other places where the issue is reproduced but I didn't find them.
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.
Generally, a non written rule says that we shouldn't be using ActionGroups/Entities, etc. for modules that we don't have in dependencies. But seeing that Ui > Sales > Bundle, most likely we should be fine here.
<features value="Ui component"/> | ||
<stories value="Error message"/> | ||
<title value="Assert disappear error message."/> | ||
<description value="Verify disappear error message when disabled field."/> |
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.
If moving it to Bundle module, these tags should also reflect what actually the test does.
@magento run WebAPI Tests |
@magento run all tests |
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.
Good job on refactoring that ActionGroup. May you also address the below small suggestions?
Thank you.
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertAdminErrorIsNotVisibleActionGroup"> |
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.
Lets also add a better name: AssertAdminErrorIsNotVisibleForProductFieldActionGroup
.
<actionGroup name="AssertAdminErrorIsNotVisibleActionGroup"> | |
<actionGroup name="AssertAdminErrorIsNotVisibleForProductFieldActionGroup"> |
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AssertAdminErrorIsVisibleActionGroup"> |
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.
<actionGroup name="AssertAdminErrorIsVisibleActionGroup"> | |
<actionGroup name="AssertAdminErrorIsVisibleForProductFieldActionGroup"> |
@@ -69,6 +69,7 @@ | |||
<element name="priceField" type="input" selector="//div[@data-index='price']//input"/> | |||
<element name="listedBundleItem" type="text" selector="//tr[@data-repeat-index='0']//div"/> | |||
<element name="listedBundleItem2" type="text" selector="//tr[@data-repeat-index='2']//div"/> | |||
<element name="fieldError" type="text" selector="//div[@data-index='{{fieldIndex}}']//following-sibling::label[@class='admin__field-error']" parameterized="true"/> |
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.
Is this selector also applicable for all the product types? If yes, let's move it to AdminProductFormSection
.
<argument name="fieldIndex" type="string"/> | ||
</arguments> | ||
|
||
<seeElement selector="{{AdminProductFormBundleSection.fieldError(fieldIndex)}}" stepKey="seeError"/> |
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.
In case the selector applies to all products.
<seeElement selector="{{AdminProductFormBundleSection.fieldError(fieldIndex)}}" stepKey="seeError"/> | |
<seeElement selector="{{AdminProductFormSection.fieldError(fieldIndex)}}" stepKey="seeError"/> |
<argument name="fieldIndex" type="string"/> | ||
</arguments> | ||
|
||
<dontSeeElement selector="{{AdminProductFormBundleSection.fieldError(fieldIndex)}}" stepKey="seeError"/> |
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.
In case the selector applies to all products.
<dontSeeElement selector="{{AdminProductFormBundleSection.fieldError(fieldIndex)}}" stepKey="seeError"/> | |
<dontSeeElement selector="{{AdminProductFormSection.fieldError(fieldIndex)}}" stepKey="seeError"/> |
@magento import code to https://github.com/magento-tsg/magento2ce |
@zakdma, an error occurred during the Pull Request import. |
@zakdma the branch with code successfully imported into |
Hi @engcom-Echo, thank you for your contribution! |
Description (*)
Disappear error message after disabled field.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
See: #26214
Questions or comments
Contribution checklist (*)