Reading list Switch to dark mode

    Prerequisite for Custom Modules with Magento Functional Testing Framework

    Updated 24 October 2018

    MFTF helps you to minimize your repetitive tasks. It’s easy to learn and write MFTF test cases. The test cases we write in MFTF are all in xml. And it automatically converts all your written test cases in codeception format.

    Here I’ll explain to you what the basic things you need to do to use your MFTF tests for your custom module. If you have not written any of the tests yet. Don’t need to worry. Please check my blog on MFTF (Magento 2 Functional Testing Framework) for Custom Signup Form to learn how to write tests for custom modules.

    For testing please set up all the required things as explained here. To learn the basics of MFTF you can read Magento Functional Testing Framework Guide.

    You can write your test inside YourMagentoRoot/dev/tests/acceptance/tests/functional/Magento/FunctionalTest/YourModuleName.
    Inside this you need to create ActionGroup, Data, Page, Section, Test depending on your module requirements.

    To generate the tests you need to run the command – vendor/bin/robo generate:tests. It checks for the all enabled modules in your Magento and generate tests for those modules only. So, to generate the tests for your custom module you need to do some chages in .env file.

    Searching for an experienced
    Magento 2 Company ?
    Find out More

    Before writing tests for your custom module you need to go inside YourMagentoRoot/dev/tests/acceptance/ and open .env file and need to remove comment from the line “MODULE_WHITELIST=” and add an entry for your module like-

    MODULE_WHITELIST=Magento_YourModuleName and save it.

     

    In case of any doubt please leave us a comment here. 🙂

     

     

    . . .

    Leave a Comment

    Your email address will not be published. Required fields are marked*


    5 comments

  • Parveen Narwal
    • Ayaz Mittaqi (Moderator)
  • Jaya Venkat
    • Jaya Venkat
      • Ayaz Mittaqi (Moderator)
  • Back to Top

    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home