The *.env
file provides additional configuration for the Magento Functional Testing Framework (MFTF).
To run the MFTF on your Magento instance, specify the basic configuration values.
Advanced users can create custom configurations based on requirements and environment.
These basic configuration values are required and must be set by the user before the MFTF can function correctly.
The root URL of the Magento application under test.
Example:
MAGENTO_BASE_URL=http://magento2.vagrant251
The path to the Magento Admin page.
Example:
MAGENTO_BACKEND_NAME=admin_12346
(Optional) If you are running the Admin Panel on separate a domain, specify this value:
Example:
MAGENTO_BACKEND_BASE_URL=https://admin.magento2.test
The username that tests can use to access the Magento Admin page
Example:
MAGENTO_ADMIN_USERNAME=admin
The password that tests will use to log in to the Magento Admin page.
Example:
MAGENTO_ADMIN_PASSWORD=1234reTyt%$7
Depending on the environment you use, you may need to configure the MFTF more precisely by setting more configuration parameters then for basic configuration. This section describes available configuration parameters and their default values (where applicable).
Sets a default value for the timezone
attribute of a generateDate
action.
This value is applied when a test step does not specify a time zone.
For the complete list of available time zones, refer to List of Supported Timezones.
Default: America/Los_Angeles
.
Example:
DEFAULT_TIMEZONE=UTC
The SELENIUM_*
values form the URL of a custom Selenium server for running testing.
Default Selenium URL: http://127.0.0.1:4444/wd/hub
And the default configuration:
SELENIUM_HOST=127.0.0.1
SELENIUM_PORT=4444
SELENIUM_PROTOCOL=http
SELENIUM_PATH=/wd/hub
Override the default Selenium server host.
Example:
SELENIUM_HOST=user:[email protected]
Override the default Selenium server port.
Example:
SELENIUM_PORT=443
Override the default Selenium server protocol.
Example:
SELENIUM_PROTOCOL=https
Override the default Selenium server path.
Example:
SELENIUM_PATH=/wd/hub
These MAGENTO_RESTAPI_*
values are optional and can be used in cases when your Magento instance has a different API path than the one in MAGENTO_BASE_URL
.
MAGENTO_RESTAPI_SERVER_HOST
MAGENTO_RESTAPI_SERVER_PORT
The protocol and the host of the REST API server path.
Example:
MAGENTO_RESTAPI_SERVER_HOST=http://localhost
The port part of the API path.
Example:
MAGENTO_RESTAPI_SERVER_PORT=5000
Settings to override base paths for the framework. You can use it when the MFTF is applied as a separate tool. For example, when you need to place the MFTF and the Magento codebase in separate projects.
MAGENTO_BP
TESTS_BP
FW_BP
TESTS_MODULES_PATH
The path to a local Magento codebase.
It enables the bin/mftf
commands such as run
and generate
to parse all modules of the Magento codebase for MFTF tests.
MAGENTO_BP=~/magento2/
BP is an acronym for Base Path. The path to where MFTF supplementary files are located in the Magento codebase.
Example:
TESTS_BP=~/magento2ce/dev/tests/acceptance
The path to MFTF. FW_BP is an acronym for FrameWork Base Path.
Example:
FW_BP=~/magento/magento2-functional-testing-framework
The path to where the MFTF modules mirror Magento modules.
Example:
TESTS_MODULE_PATH=~/magento2/dev/tests/acceptance/tests/functional/Magento/FunctionalTest
Use for a new module.
When adding a new directory at Magento/FunctionalTest
, add the directory name to MODULE_ALLOWLIST
to enable the MFTF to process it.
Example:
MODULE_ALLOWLIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch
Path to the Magento CLI command entry point.
Default: dev/tests/acceptance/utils/command.php
.
It points to MAGENTO_BASE_URL
+ dev/tests/acceptance/utils/command.php
Modify the default value:
- for non-default Magento installation
- when use a subdirectory in the
MAGENTO_BASE_URL
Example: dev/tests/acceptance/utils/command.php
Override the default browser performing the tests.
Default: Chrome
Example:
BROWSER=firefox
The Api address for a vault server.
Default: http://127.0.0.1:8200
Example:
# Default api address for local vault dev server
CREDENTIAL_VAULT_ADDRESS=http://127.0.0.1:8200
Vault secret engine base path.
Default: secret
Example:
# Default base path for kv secret engine in local vault dev server
CREDENTIAL_VAULT_SECRET_BASE_PATH=secret
The region that AWS Secrets Manager is located.
Example:
# Region of AWS Secrets Manager
CREDENTIAL_AWS_SECRETS_MANAGER_REGION=us-east-1
The profile used to connect to AWS Secrets Manager.
Example:
# Profile used to connect to AWS Secrets Manager.
CREDENTIAL_AWS_SECRETS_MANAGER_PROFILE=default
Determines if passed tests should still have all their Allure artifacts. These artifacts include .txt
attachments for dontSee
actions and createData
actions.
If enabled, all tests will have all of their normal Allure artifacts.
If disabled, passed tests will have their Allure artifacts trimmed. Failed tests will still contain all their artifacts.
This is set false
by default.
VERBOSE_ARTIFACTS=true
Enables addition of browser logs to Allure steps
ENABLE_BROWSER_LOG=true
Forces MFTF to close all Selenium sessions after running a suite.
Use this if you're having issues with sessions hanging in an MFTF suite.
SELENIUM_CLOSE_ALL_SESSIONS=true
Blocklists types of browser log entries from appearing in Allure steps.
Denoted in browser log entry as "SOURCE": "type"
.
BROWSER_LOG_BLOCKLIST=other,console-api
Global MFTF configuration for the default amount of time (in seconds) that a test will wait while loading a page.
WAIT_TIMEOUT=30