Skip to content

Latest commit

 

History

History
264 lines (212 loc) · 11.3 KB

configuration.md

File metadata and controls

264 lines (212 loc) · 11.3 KB
layout group subgroup title menu_title menu_node version github_link
default
mtf-guide
55_Config
Functional Testing Framework Configuration
Configuration
parent
2.1
mtf/configuration.md

The Functional Testing Framework configuration settings are located in two XML files:

  • phpunit.xml
  • config.xml

phpunit.xml {#phpunit_xml}

The <magento2_root_dir>/dev/tests/functional/phpunit.xml contains PHPUnit configuration settings. Blocks of settings are described in PHPUnit documentation, except <php> that contains parameters described in the following table.

{% collapsible Show/hide the default phpunit.xml code %}

{% highlight xml %} {% remote_markdown https://raw.githubusercontent.com/magento/magento2/2.1/dev/tests/functional/phpunit.xml.dist %} {% endhighlight %} {% endcollapsible %}

Parameter Description value Usage
app_frontend_url URL to Magento storefront under test. http://<name>.<domain>/ Set URL for Magento storefront under test
app_backend_url URL to Magento Admin under test. "http://<name>.<domain>/<path to Admin>/" Set URL for Magento Admin URL under test
testsuite_rule Test suite name to be run. "<test suite name>" Set a test suite
testsuite_rule_path Path to a test suite. "<path to test suite>" Set a path to test suite
log_directory Path to a directory with testing reports. "<path to the reporting directory>" Set a reporting directory
events_preset Name of a reporting event preset. "<event preset name>" Set a preset
module_whitelist List of special FTF modules which are present in functional tests but are not enabled in the Magento application. "<names of modules>" Make listed modules (that are not enabled in Magento) visible for the FTF.
basedir A directory where PHPUnit reports are stored. "<directory for PHPUnit reports>"
credentials_file_path Path to the file with credentials required by services such as payment and shipment. "./credentials.xml.dist" Edit credentials.xml to work with Magento modules that require credentials
mage_mode Magento mode (About Magento modes). "default", "developer", "production" This parameter is intended to be used directly in a test. The FTF doesn't use it. Open an example
module_filter Applicable for test suites only. Enables you to select test cases for specific modules. Learn more about the <module> filter in a test suite. "Magento_<name_of_module>" Use it when you don't want to modify the test suite.
module_filter_strict Applicable for a tests suite only. It has the same effect as strict in the <module>. Learn more about strict parameter of the <module> filter in a test suite. "1", "0" Use it when you don't want to modify the test suite.

config.xml {#config_xml}

The FTF configuration settings are declared and specified in two places:

{% collapsible in the Framework %}

The file is located in <magento2_root_dir>dev/tests/functional/vendor/magento/mtf/etc

{% highlight xml %} {% remote_markdown https://raw.githubusercontent.com/magento/mtf/develop/etc/config.xml.dist%} {% endhighlight %}

image

Figure 1. - XML Schema for the <magento2_root_dir>dev/tests/functional/vendor/magento/mtf/etc/config.xml.

{%endcollapsible%}

{% collapsible in Magento functional tests %}

The file is located in <magento2_root_dir>dev/tests/functional/

{% highlight xml %} {% remote_markdown https://raw.githubusercontent.com/magento/magento2/2.1/dev/tests/functional/etc/config.xml.dist %} {% endhighlight %}

image

Figure 2. - XML Schema for the <magento2_root_dir>dev/tests/functional/vendor/magento/mtf/etc/config.xml.

{% endcollapsible %}

The FTF merges settings from both files with the following priority:

  • config.xml in Magento has higher priority then config.xml in the Framework
  • config.xml.dist is omitted if config.xml exists

Settings are grouped into the following blocks:

<application> {#application}

Description: Application configuration settings.

Parameter Description
<reopenBrowser> Determines that a browser is to be restarted after each test or testCase.
<backendLogin> Magento Admin username that is used during functional testing.
<backendPassword> Magento Admin password that is used during functional testing.
<appBackendUrl> Base URL of the Magento Admin. Not applicable currently.
<backendLoginUrl> Relative path to the Magento Admin login page.

<isolation> {#isolation}

Description: Settings of a script to be run during functional testing.

Parameter Description Values
<resetUrlPath> Relative path of a script to be run. The URL is opened as usual web page in a browser, so that corresponding permissions must be set to the file. <resetUrlPath>dev/tests/mtf/isolation.php</resetUrlPath>
<testSuite> When the script must be called relatively to test suite run. none, before, after, both
<testCase> When the script must be called relatively to test case run. none, before, after, both
<test> When the script must be called relatively to test run. none, before, after, both

Values description:

  • none - never run
  • before - run before the entity to which it concerns
  • after - run after the entity to which it concerns
  • both - run before and after the entity to which it concerns

<server> {#server}

Description: Selenium server settings. Open settings declarations in Selenium repository

Parameter Description Values
name Name of an item. "selenium"
type Required Selenium setting. The FTF doesn't use it. "default"
browser A browser full name to be displayed where you needed it. The FTF doesn't use it.
browserName A browser that can be used for functional testing. android, chrome, firefox, htmlunit, internet explorer, iPhone, iPad, opera, safari
host and port Address of a Selenium Server.
seleniumServerRequestsTimeout A specified period of time to process a request.
sessionStrategy Standard Selenium Server parameter that sets a session strategy. Recommended to use "shared" only. "shared", "isolated"

<desiredCapabilities>

Learn about desiredCapabilities in Selenium official documentation.

<handler> {#handler}

Specifies priorities for different types of handlers. The lower the value, the higher the priority. The highest priority has value 0. token contains access token (used by WebAPI handlers only). Learn more about handlers.

Parameter Description Values
<webapi> priority value of a WebAPI handler. Integer
<curl> priority value of a curl handler priority. Integer
<ui> priority value of a UI handler priority. Integer

<install> {#install}

Set of parameters to be used for installation test case.

Parameter Description
<host> Magento database host name or IP address.
<user> Magento database user name.
<password> Magento database user password.
<dbName> Name of a database.
<baseUrl> Magento application base URL, starting with the scheme (http:// or https://) and ending with a slash character (/).
<backendName> Admin URI (following the base URL).

Learn more about installation parameters

*[FTF]: Functional Testing Framework