Magento 2.1.18 is the final 2.1.x release. After June 2019, Magento 2.1.x will no longer receive security patches, quality fixes, or documentation updates.
To maintain your site's performance, security, and PCI compliance, upgrade to the latest version of Magento.

Quick start. Adjust configuration

Edit phpunit.xml to configure PHPUnit

Find phpunit.xml in <magento2_root_dir>/dev/tests/functional, and open it in editor.

If you cannot find phpunit.xml, create it from phpunit.xml.dist.

Set URL for Magento storefront under test

Find <php> element. For name="app_frontend_url" set value that is your actual URL for Magento storefront under test.

Example: <env name="app_frontend_url" value="http://example.com/magento2/"/>

Set URL for Magento Admin URL under test

For name="app_backend_url" set value that is your actual URL for Magento Admin URL under test.

Example: <env name="app_backend_url" value="http://example.com/magento2/admin/"/>

Edit config.xml to configure Functional Testing Framework

The default configuration is set in <magento2>/dev/tests/functional/etc/config.xml.dist. It should be copied as config.xml for further changes.

Find config.xml in <magento2_root_dir>/dev/tests/functional/etc, and open it in editor.

Set credentials for Magento Admin under test

In <application> element find elements <backendLogin> and <backendPassword>. Change content of these elements to your actual credentials for Magento Admin URL.

Set browser that the FTF will use for tests

The default browser is Mozilla Firefox.

If you want to use another browser for tests you have to specify it in config.xml.

Copy <server> element from <magento2_root_dir>/dev/tests/functional/vendor/magento/mtf/etc/config.xml> and paste it in <magento2_root_dir>/dev/tests/functional/etc/config.xml after <install> element.

Enter actual data in <browserName> and <browser> attributes.

Example for Google Chrome:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<server>
<item name="selenium"
      type="default"
      browser="Google Chrome"
      browserName="chrome"
      host="localhost"
      port="4444"
      seleniumServerRequestsTimeout="90"
      sessionStrategy="shared">
    <desiredCapabilities>
        <platform>ANY</platform>
    </desiredCapabilities>
</item>
</server>

Edit credentials.xml to work with Magento modules that requires credentials

Find credentials.xml in <magento2_root_dir>/dev/tests/functional, and open it in editor.

If you cannot find credentials.xml, create it from credentials.xml.dist.

Set credentials for Magento modules under test

Open credentials.xml.

Find block of elements for the Magento module you want to test.

Enter actual data in value attribute of corresponding field element.

Next Steps

Prepare Magento application >>

Updated