Topic: MTAF

Magento 2 Functional Testings (MTAF) 0

Magetno 2 comes with built in functional test framework.(MTAF) This is also available for Magento 1 too. Here is the quick step by step guide to how to run these functional test cases.


  • Working Magento 2 installation
  • Disable admin security key urls from magento admin panel. Store=>Config=>Advanced=>Admin=>Add security key url=NoSelection_003
  • Firefox or Google chrome web browser
  • Java runtime installed in your machine
  • PHP Composer

How to Run

  • Got to <magento root>/dev/tests/functional/.
  • Run composer install to install required dependancies. This will download mtaf, selinium RC etc to vendor folder. [composer install]
  • Run [php utils/generate/factory.php] after composer install to generate required factories.
  • Open phpunit.xml and update urls


<env name="app_frontend_url" value="" />

<env name="app_backend_url" value="" />

<env name="testsuite_rule" value="basic" />

<env name="testsuite_rule_path" value="Magento/Mtf/TestSuite/InjectableTests" />

<env name="log_directory" value="var/log" />

<env name="events_preset" value="base" />

<env name="module_whitelist" value="Magento_Install" />

<env name="basedir" value="var/log" />

<env name="credentials_file_path" value="./credentials.xml.dist" />

  • Open etc/config.xml and update login credentials

<config xmlns:xsi="" xsi:noNamespaceSchemaLocation="config.xsd">
















  • Those are the minimum configuration to get test cases runinng. You can find more descriptive configuration documents under vendor/magento/mtf/docs/
  • Start Selenium by [java -jar vendor/netwing/selenium-server-standalone/selenium-server-standalone-2.44.0.jar] your version may variy
  • Now run phpunit from <magento root>/dev/tests/functional/

Following are all the commands that used.

cd <magento root>/dev/tests/functional

composer install

vi phpunit.xml (change urls)

vi etc/config.xml (change urls/credentials)

java -jar vendor/netwing/selenium-server-standalone/selenium-server-standalone-2.44.0.jar