Magento Test Framework
The Magento Test Framework (MTF) is a tool that can run nearly 170 automated functional
tests, which are included in Magento and designed to improve the quality of implementations
and to make it easier to perform basic acceptance testing when adding extensions, making
customizations, or upgrading Mag
1. Download Composer for UNIX or Windows. Then, follow the instructions to install Composer.
2. Run Composer from the [Magento install]/dev/tests/functional directory as
If you cannot run composer from the command line, do the following:
a. Copy composer.phar to the same directory where composer.json is located. The
typical location is:
[Magento install dir]/dev/tests/functional
The composer.json file contains dependency information and settings for PHPUnit,
Selenium server, libraries, and so on, and is required to start MTF. It checks out MTF from a
b. Run Composer as follows:
php composer.phar install
A new directory named vendor is created with the checked-out MTF. The vendor directory
- An MTF framework directory ( magento/mtf )
- autoload.php (file)
3. To run the generator, do one of the following:
- Use your browser to navigate to the following location:
[Magento install dir]/dev/tests/functional/utils/generate.php
- Execute the following from the command line:
The generator tool creates generated directories with factories for pages, blocks, handlers,
fixtures and repositories. After MTF is initialized, the factories are pre-generated to facilitate
creating and running tests.
If using a browser other than Firefox, you must first download drivers that are compatible with
Selenium. Then, add the following declaration to the config.xml file. The file is is located at:
To learn more, see the Selenium Documentation.
Update the phpunit.xml file with the URLs of your storefront and Magento Admin as
This reference provides information about each MTF configuration section located at:
[Magento install dir]/dev/tests/functional/etc/config.xml
Provides the login credentials for the Magento Admin.
Specifies the isolation strategies for tests, cases, and suites.
Your isolation strategy determines when the system returns to its initial state. An isolation
strategy can apply to any scope, such as a test, case, or suite. The following four isolation
strategies are available:
Specifies the Selenium web browser (if not Firefox) and other options. For a list of valid
browserName values, see:
- Selenium source code
- List of Selenium RC Browser Launchers