Skip to content
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

Conversation

ajithkumar-maragathavel
Copy link
Contributor

@ajithkumar-maragathavel ajithkumar-maragathavel commented Feb 4, 2020

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 (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Feb 4, 2020

Hi @ajithkumar-maragathavel. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@ajithkumar-maragathavel
Copy link
Contributor Author

@rogyar Created a new set of MFTF tests for the Magento_AdvancedSearch module. Please review it.

@ajithkumar-maragathavel
Copy link
Contributor Author

@rogyar Any updates on this PR. Please review it.

Copy link
Contributor

@rogyar rogyar left a 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">
Copy link
Contributor

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 arguments
  • AdminSaveSearchTermActionGroup that fill submit the form and wait for the page load

Copy link
Contributor Author

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">
Copy link
Contributor

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

Copy link
Contributor Author

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.

@ghost ghost moved this from Review in Progress to Changes Requested in Pull Requests Dashboard Apr 15, 2020
</annotations>
<!-- Click save action and verify success message -->
<click selector="{{AdminMainActionsSection.save}}" stepKey="clickSaveSearchButton"/>
<see userInput="You saved the search term." stepKey="assertSaveSearchTermSuccessMessage" />
Copy link
Contributor

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

Copy link
Contributor Author

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"/>
Copy link
Contributor

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

Copy link
Contributor Author

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.

@rogyar rogyar added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: category of expertise labels Apr 26, 2020
@ghost ghost moved this from Changes Requested to Ready for Testing in Pull Requests Dashboard Apr 26, 2020
@magento-engcom-team
Copy link
Contributor

Hi @rogyar, thank you for the review.
ENGCOM-7487 has been created to process this Pull Request

@engcom-Alfa engcom-Alfa self-assigned this Apr 27, 2020
@engcom-Alfa engcom-Alfa moved this from Ready for Testing to Testing in Progress in Pull Requests Dashboard Apr 27, 2020
@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@engcom-Alfa engcom-Alfa moved this from Testing in Progress to Extended Testing (optional) in Pull Requests Dashboard Apr 27, 2020
@engcom-Kilo engcom-Kilo self-assigned this Apr 27, 2020
@engcom-Kilo
Copy link
Contributor

Updated MFTF test

@engcom-Kilo
Copy link
Contributor

Failed functional tests not related to the changes in this PR

@engcom-Kilo engcom-Kilo moved this from Extended Testing (optional) to Merge in Progress in Pull Requests Dashboard Apr 30, 2020
@slavvka slavvka added this to the 2.4.0 milestone Apr 30, 2020
@slavvka slavvka merged commit 6dd0719 into magento:2.4-develop May 1, 2020
@m2-assistant
Copy link

m2-assistant bot commented May 1, 2020

Hi @ajithkumar-maragathavel, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@ghost ghost moved this from Merge in Progress to Recently Merged in Pull Requests Dashboard May 1, 2020
@magento-engcom-team magento-engcom-team removed this from Recently Merged in Pull Requests Dashboard May 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants