-
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
covered mftf test to create new search term #26704
covered mftf test to create new search term #26704
Conversation
Hi @ajithkumar-maragathavel. Thank you for your contribution
For more details, please, review the Magento Contributor Guide documentation. |
@rogyar Created a new set of MFTF tests for the Magento_AdvancedSearch module. Please review it. |
@rogyar Any updates on this PR. Please review it. |
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 @ajithkumar-maragathavel. Thank you for your collaboration. Please, check my comments below for a few adjustments
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminSaveNewSearchTermActionGroup"> |
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.
According to the best practices, we usually split big action groups into more granular pieces. Also, you may reuse the existing action group to avoid code duplication.
For navigating to a page, feel free to use AdminNavigateMenuActionGroup
Or, even better, create an action group that opens the new search term action group in the same manner. Let's call it AdminOpenNewSerchTermPageActionGroup
Then we will have two more action groups:
AdminFillSearchTermActionGroup
that accept values for all fields as argumentsAdminSaveSearchTermActionGroup
that fill submit the form and wait for the page load
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 Great thanks for the code review. I have made changes to the MFTF test based on your recommendations. Please review it.
|
||
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminSearchTermsPageFormActionsSection"> |
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 don't need to introduce a new section for the form actions. Please, feel free to reuse the existing one
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 I have used the existing one. Thanks for your guidance.
d37cd25
to
66e56f7
Compare
</annotations> | ||
<!-- Click save action and verify success message --> | ||
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/> | ||
<see userInput="You saved the search term." stepKey="assertSaveSearchTermSuccessMessage" /> |
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.
Please, do not combine assertion and saving in the same action group. Instead, leave only saving process in the current action group and use the existing action group for the assertion
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 Thanks for the review. I have used the existing action group for Assertion. Please review it.
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd"> | ||
<section name="AdminSearchTermsPageGridActionsSection"> | ||
<element name="addNewSearchTerm" type="button" selector="#add" timeout="30"/> |
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.
Please, feel free to reuse the existing 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.
@rogyar I will use the existing action groups. This file is not used in anywhere now. So removing this file.
Hi @rogyar, thank you for the review. |
✔️ QA Passed |
Updated MFTF test |
Failed functional tests not related to the changes in this PR |
Hi @ajithkumar-maragathavel, thank you for your contribution! |
Description (*)
Covered MFTF test cases for adding a new search term from Magento admin.
This test will navigate to the Search Terms grid and create a new search term using hardcoded data.
Related Pull Requests
Contribution checklist (*)