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.
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.
Magento 2 Company ? Read 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. 🙂