Getting started

This topic was updated after 2.0.2 MFTF release.

Find out your version of the MFTF. If your version is 2.3.x, see the MFTF 2.3 documentation.

Prepare environment

Make sure that you’ve installed and set up the following software:


We recommend using PhpStorm 2017.1 or newer for your integrated development environment (IDE). They recently added support for Codeception Test execution, which is helpful when debugging.

Install Magento

Use instructions below to install Magento.

Step 1. Clone the magento2 source code repository

git clone


git clone

Step 2. Install dependencies

Checkout the Magento version that you are going to test.

cd magento2/
git checkout 2.2-develop

Install the Magento application.

composer install

Prepare Magento

Configure the following settings in Magento as described below.

WYSIWYG settings

A Selenium web driver cannot enter data to fields with WYSIWYG .

To disable the WYSIWYG and enable the web driver to process these fields as simple text areas:

  1. Log in to the Magento Admin as an administrator.
  2. Navigate to Stores > Configuration > General > Content Management.
  3. In the WYSIWYG Options section set the Enable WYSIWYG Editor option to Disabled Completely.
  4. Click Save Config.

Enable WYSIWYG in your test suite when you need to test it.

Security settings

To enable the Admin Account Sharing setting, to avoid unpredictable logout during a testing session, and disable the Add Secret Key in URLs setting, to open pages using direct URLs:

  1. Navigate to Stores > Configuration > Advanced > Admin > Security.
  2. Set Admin Account Sharing to Yes.
  3. Set Add Secret Key to URLs to No.
  4. Click Save Config.

Set up the framework

Follow these steps in a command line interface to set up the MFTF on your system.

Step 1. Install dependencies

cd magento2/dev/tests/acceptance
composer install

Step 2. Build the project

In magento2/dev/tests/acceptance, run the following command:

vendor/bin/robo build:project

To avoid typing vendor/bin every time, add your <absolute path to acceptance dir>/vendor/bin value to PATH. When added, you should be able to run the robo, codecept, and phpunit commands.

Step 3. Edit environment settings

In the magento2/dev/tests/acceptance directory, edit the .env file to match your system. Use the following parameters, which are required to launch tests.

  • MAGENTO_BASE_URL must contain a domain name of the Magento instance that will be tested. Example: MAGENTO_BASE_URL=http://magento.test

  • MAGENTO_BACKEND_NAME must contain the relative path to the Admin area. Example: MAGENTO_BACKEND_NAME=admin

  • MAGENTO_ADMIN_USERNAME must contain the username required for authorization in the Admin area. Example: MAGENTO_ADMIN_USERNAME=admin

  • MAGENTO_ADMIN_PASSWORD must contain the user password required for authorization in the Admin area. Example: MAGENTO_ADMIN_PASSWORD=123123q

The following self-descriptive variables have included default values.


Only change or specify SELENIUM_* values if you are not running Selenium locally, or if you have changed your Selenium Server configuration.

Your environment settings form the path to your running Selenium Server. Example:

Step 4. Make command.php visible in the Magento testing environment

In your Magento installation, navigate to the magento2/dev/tests/acceptance directory and run the following command to allow MFTF to send Magento CLI commands to your Magento instance.

cp .htaccess.sample .htaccess

If you do not have access to your Magento installation and cannot complete the above steps you will not be able to run tests using Magento CLI commands.

Step 5. Generate existing tests

In the magento2/dev/tests/acceptance directory, run the following command to generate tests as PHP classes from XML files:

vendor/bin/robo generate:tests

Step 6. Run tests

To run tests, you need a running Selenium server and a codecept or a robo command with required parameters.

Run the Selenium server

  1. Download the latest Selenium Server.

  2. Download a Selenium web driver for your web browser into the same directory that contains the Selenium server.

  3. Add the directory with the web driver to PATH.

  4. Run the Selenium server in terminal (or other command line interface):

java -jar <path_to_selenium_directory>/selenium-server-standalone-<version>.jar

Run all tests

vendor/bin/codecept run

See more commands in robo and codecept.

Step 7. Generate reports

Install Allure, a tool that generates testing reports in HTML. Testing reports are generated in a CLI during testing.

If you want to see the reports in a GUI, run:

vendor/bin/robo allure2:report

See also Allure robo commands and Report structure.