|
| 1 | +<style> |
| 2 | +.mftf-dl { |
| 3 | + margin-bottom: 2.5em; |
| 4 | +} |
| 5 | +dl dt{ |
| 6 | + font-weight:400; |
| 7 | +} |
| 8 | +</style> |
| 9 | + |
| 10 | +# MFTF functional test modules and packaging |
| 11 | + |
| 12 | +## MFTF predefined test module paths |
| 13 | +The Magento Functional Testing Framework can run tests from predefined paths and custom paths. The predefined paths are: |
| 14 | +``` |
| 15 | +app/code/<Vendor>/<Module>/Test/Mftf |
| 16 | +dev/tests/acceptance/tests/functional/<Vendor>/<TestModule> |
| 17 | +vendor/<Vendor>/<Module>/Test/Mftf |
| 18 | +vendor/<Vendor>/<TestModule> |
| 19 | +``` |
| 20 | + |
| 21 | +To support future service isolation, Test module in `dev/tests/acceptance/tests/functional/<Vendor>/<TestModule>` and |
| 22 | +`vendor/<Vendor>/<TestModule>` must define the module type as `magento2-functional-test-module` in a `composer.json` file. |
| 23 | +No `composer.json` file is required for tests in `app/code/<Vendor>/<Module>/Test/Mftf` and `vendor/<Vendor>/<Module>/Test/Mftf` |
| 24 | +as they are part of the Magento modules. |
| 25 | + |
| 26 | +Test module for a specific Magento module can only be in one of the path. |
| 27 | + |
| 28 | +## Test module composer.json format |
| 29 | + |
| 30 | +Test module `composer.json` file should use type `magento2-functional-test-module`. |
| 31 | + |
| 32 | +Test module `composer.json` file should define Magento module dependencies in suggests block. |
| 33 | +MFTF will recognize the dependency if the suggest message of a module specifies `type` using `magento2-module` and `name` |
| 34 | +using module name registered with Magento. |
| 35 | + |
| 36 | +Here is an example `composer.json` file for the test module `dev/tests/acceptance/tests/functional/Magento/ConfigurableProductCatalogSearch`: |
| 37 | + |
| 38 | +```json |
| 39 | +{ |
| 40 | + "name": "magento/module-configurable-product-catalog-search-functional-test", |
| 41 | + "description": "MFTF test module for Magento_ConfigurableProduct and Magento_CatalogSearch", |
| 42 | + "type": "magento2-functional-test-module", |
| 43 | + "config": { |
| 44 | + "sort-packages": true |
| 45 | + }, |
| 46 | + "require": { |
| 47 | + "magento/magento2-functional-testing-framework": ">=2.5" |
| 48 | + }, |
| 49 | + "suggest": { |
| 50 | + "magento/module-configurable-product": "type: magento2-module, name: Magento_ConfigurableProduct, version: *", |
| 51 | + "magento/module-catalog-search": "type: magento2-module, name: Magento_CatalogSearch, version: *" |
| 52 | + }, |
| 53 | + "license": [ |
| 54 | + "OSL-3.0", |
| 55 | + "AFL-3.0" |
| 56 | + ] |
| 57 | +} |
| 58 | +``` |
0 commit comments