Close [x]

Quick start with the Magento Testing Framework

Edit this page on GitHub

Prepare environment for test run

Run the Selenium Server

The Selenium Server will drive a browser to execute your tests. You can download the Selenium Server from Selenium project website.

聽聽聽聽

Install Java to work with Selenium.

Specific versions of the Selenium Server are compatible with specific versions of browsers. Read more about compatibility of browser version and Selenium server version.

Enter in terminal:

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

Run tests on non-default browser

If the Selenium Server does not work directly with your browser, find the corresponding WebDriver.

In config.xml define the browser that the MTF will use for tests.

Run the Selenium Server with an additional argument.

Example for Google Chrome:

java -jar <path_to_selenium_directory>/selenium-server.jar -Dwebdriver.chrome.driver=<path_to_chrome_driver>/chromedriver.exe

Run generator

Generator generates fixtures, repositories, and page objects. Once the MTF is initialized, all classes must be pre-generated to facilitate creating and running the tests. Modules in the MTF are processed by generator in the same order that they are processed during Magento loading.

Enter in terminal:

cd <magento2>/dev/tests/functional/utils
php generate.php

Next Steps

<< Adjust configuration | Test run >>