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

[ MFTF ] Mess in ActionGroups: invalid names, multiple nodes. #26331

Closed
lbajsarowicz opened this issue Jan 9, 2020 · 6 comments
Closed

[ MFTF ] Mess in ActionGroups: invalid names, multiple nodes. #26331

lbajsarowicz opened this issue Jan 9, 2020 · 6 comments
Assignees
Labels
Component: Test Fixed in 2.4.x The issue has been fixed in 2.4-develop branch improvement Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch

Comments

@lbajsarowicz
Copy link
Contributor

Summary (*)

Goal of this ticket is to explain Why I put so much effort to cleanup the Magento's Funcionatl Testing Framework:

  1. MFTF Best Practices states that Action Group name should be consistent with the filename (We're moving towards having it as a requirement)
  2. Practical side: When looking for ActionGroup - it's enough if you search for a file with its "what we expect" name (eg. PHPStorm: CTRL + SHIFT + N and type AdminLoginActionGroup)
  3. Maintainability: Only one ActionGroup with the same name is created in the module (when trying to create another one with the same name - you'll hit existing file).
  4. Extensibility: I want to introduce ActionGroup lazy loading. When you're running even single Test, MFTF traverses all the files of ActionGroups to parse them and build the dependency of necessary files. I want to change that and use the only files that we need.

Examples (*)

Report from my tool - for example for Customer module.

Multiple ActionGroups in single file

    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontOpenCustomerAccountCreatePageActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerLogoutActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerAddressActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/SignUpNewUserFromStorefrontActionGroup.xml --- 13
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenEditCustomerFromAdminActionGroup.xml --- 4
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/DeleteCustomerActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerAddressesFromActionGroup.xml --- 4
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCreateCustomerWithWebsiteAndStoreViewActionGroup.xml --- 2
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml --- 2

Inconsistent ActionGroup names

/app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectAllCustomersActionGroup.xml
        - AdminSelectAllCustomers
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerDefaultBillingAddressActionGroup.xml
        - AdminAssertCustomerDefaultBillingAddress
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerAddressNoZipNoStateActionGroup.xml
        - AdminEditCustomerAddressNoZipNoState
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerGridByEmailActionGroup.xml
        - AdminFilterCustomerGridByEmail
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertCustomerLoggedInActionGroup.xml
        - AssertCustomerWelcomeMessageActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerDefaultShippingAddressActionGroup.xml
        - AdminAssertCustomerDefaultShippingAddress
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertSuccessLoginToStorefrontActionGroup.xml
        - StorefrontAssertSuccessLoginToStorefront
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerNoDefaultBillingAddressActionGroup.xml
        - AdminAssertCustomerNoDefaultBillingAddress
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSelectCustomerByEmailActionGroup.xml
        - AdminSelectCustomerByEmail
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerActionGroup.xml
        - CustomerLogoutStorefrontByMenuItemsActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AssertStorefrontPasswordAutocompleteOffActionGroup.xml
        - AssertStorefrontPasswordAutoCompleteOffActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerElementNotVisibleActionGroup.xml
        - StorefrontCustomerReorderButtonNotVisibleActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertNumberOfRecordsInCustomersAddressGridActionGroup.xml
        - AdminAssertNumberOfRecordsInCustomersAddressGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/LoginToStorefrontWithEmailAndPasswordActionGroup.xml
        - LoginToStorefrontWithEmailAndPassword
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerGridActionGroup.xml
        - AdminFilterCustomerByEmail
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerAccountInformationActionGroup.xml
        - AdminAssertCustomerAccountInformation
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerActionGroup.xml
        - NavigateToAllCustomerPage
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerByNameActionGroup.xml
        - AdminFilterCustomerByName
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminResetFilterInCustomerGridActionGroup.xml
        - AdminResetFilterInCustomerGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressBookNotContainsActionGroup.xml
        - StorefrontCustomerAddressBookNotContains
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminResetFilterInCustomerAddressGridActionGroup.xml
        - AdminResetFilterInCustomerAddressGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerGroupOnCustomerFormActionGroup.xml
        - AdminAssertCustomerGroupOnCustomerForm
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminSaveCustomerAndAssertSuccessMessageActionGroup.xml
        - AdminSaveCustomerAndAssertSuccessMessage
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/OpenStorefrontStoredPaymentMethodsPageActionGroup.xml
        - OpenStorefrontCustomerStoredPaymentMethodsPageActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontRegisterCustomerFromOrderSuccessPageActionGroup.xml
        - StorefrontRegisterCustomerFromOrderSuccessPage
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/SetGroupCustomerActionGroup.xml
        - SetCustomerGroupForSelectedCustomersViaGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminUpdateCustomerGroupActionGroup.xml
        - AdminUpdateCustomerGroupByEmailActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerSubscribeNewsletterActionGroup.xml
        - AdminAssertCustomerIsSubscribedToNewsletters
        - AdminAssertCustomerIsSubscribedToNewslettersAndSelectedStoreView
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSubscribeNewsletterActionGroup.xml
        - AdminSubscribeCustomerToNewsletters
        - AdminSubscribeCustomerToNewslettersAndSelectStoreView
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerAddressSetDefaultShippingAndBillingActionGroup.xml
        - AdminEditCustomerAddressSetDefaultShippingAndBilling
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerGroupPresentInGridActionGroup.xml
        - AdminAssertCustomerGroupPresentInGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminConfigCustomerActionGroup.xml
        - SetCustomerDataLifetimeActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAssertRegistrationPageFieldsActionGroup.xml
        - StorefrontAssertRegistrationPageFields
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressBookNumberOfAddressesActionGroup.xml
        - StorefrontCustomerAddressBookNumberOfAddresses
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerSaveAndContinueActionGroup.xml
        - AdminCustomerSaveAndContinue
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/NavigateCustomerGroupActionGroup.xml
        - NavigateToCustomerGroupPage
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminDeleteAddressInCustomersAddressGridActionGroup.xml
        - AdminDeleteAddressInCustomersAddressGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerAddressesFromActionGroup.xml
        - AdminEditCustomerAddressesFrom
        - AdminEditCustomerAddressSetDefaultShippingAndBilling
        - AdminEditCustomerAddressNoZipNoState
        - SelectDropdownCustomerAddressAttributeValueActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminEditCustomerInformationFromActionGroup.xml
        - AdminEditCustomerAccountInformationActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertAddressInCustomersAddressGridActionGroup.xml
        - AdminAssertAddressInCustomersAddressGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/VerifyGroupCustomerActionGroup.xml
        - VerifyCustomerGroupForCustomer
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerGoToSidebarMenuActionGroup.xml
        - StorefrontCustomerGoToSidebarMenu
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontCustomerAddressBookContainsActionGroup.xml
        - StorefrontCustomerAddressBookContains
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerNoDefaultShippingAddressActionGroup.xml
        - AdminAssertCustomerNoDefaultShippingAddress
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/SwitchAccountActionGroup.xml
        - SignOut
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerGroupOnProductFormActionGroup.xml
        - AdminAssertCustomerGroupOnProductForm
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertCustomerInCustomersGridActionGroup.xml
        - AdminAssertCustomerInCustomersGrid
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminAssertErrorMessageCustomerGroupAlreadyExistsActionGroup.xml
        - AdminAssertErrorMessageCustomerGroupAlreadyExists
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminCustomerShopingCartActionGroup.xml
        - AdminAddProductToShoppingCartActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/StorefrontAddCustomerAddressActionGroup.xml
        - StorefrontAddNewCustomerAddressActionGroup
        - StorefrontAddCustomerDefaultAddressActionGroup
    /app/code/Magento/Customer/Test/Mftf/ActionGroup/AdminFilterCustomerAddressGridByPhoneNumberActionGroup.xml
        - AdminFilterCustomerAddressGridByPhoneNumber

Proposed solution

Currently I work with all the Open Source and Commerce modules to address the issue, as well as to report other issues - like workarounds applied to the tests, that create overhead when it comes to time of execution.

CC: @okolesnyk @dmytro-ch @ihor-sviziev @rogyar @soumyau @nuzil

@m2-assistant
Copy link

m2-assistant bot commented Jan 9, 2020

Hi @lbajsarowicz. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

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

@lbajsarowicz do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • yes
  • no

@m2-assistant
Copy link

m2-assistant bot commented Jan 10, 2020

Hi @dmytro-ch. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: 👇

  • 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).

    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.

  • 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and stop verification process here!

  • 5. Add label Issue: Confirmed once verification is complete.

  • 6. Make sure that automatic system confirms that report has been added to the backlog.

@dmytro-ch dmytro-ch added Component: Test Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch labels Jan 10, 2020
@magento-engcom-team magento-engcom-team added the Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development label Jan 10, 2020
@magento-engcom-team
Copy link
Contributor

✅ Confirmed by @dmytro-ch
Thank you for verifying the issue. Based on the provided information internal tickets MC-30327 were created

Issue Available: @dmytro-ch, You will be automatically unassigned. Contributors/Maintainers can claim this issue to continue. To reclaim and continue work, reassign the ticket to yourself.

@lbajsarowicz
Copy link
Contributor Author

When this task is done, another one is ready to be done: magento/magento2-functional-testing-framework#520

@magento-engcom-team
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Test Fixed in 2.4.x The issue has been fixed in 2.4-develop branch improvement Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is valid Gate 1 Passed. Automatic verification of issue format passed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.4.x The issue has been reproduced on latest 2.4-develop branch
Projects
None yet
Development

No branches or pull requests

4 participants