Skip to content

MQE-1520: Consolidate WAIT_TIMEOUT in .env and pageload_timeout #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion dev/tests/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
'MAGENTO_BACKEND_NAME' => 'admin',
'MAGENTO_ADMIN_USERNAME' => 'admin',
'MAGENTO_ADMIN_PASSWORD' => 'admin123',
'DEFAULT_TIMEZONE' => 'America/Los_Angeles'
'DEFAULT_TIMEZONE' => 'America/Los_Angeles',
'WAIT_TIMEOUT' => '10'
];

foreach ($TEST_ENVS as $key => $value) {
Expand Down
5 changes: 4 additions & 1 deletion dev/tests/functional/standalone_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@

defined('DEFAULT_TIMEZONE') || define('DEFAULT_TIMEZONE', 'America/Los_Angeles');
$env->setEnvironmentVariable('DEFAULT_TIMEZONE', DEFAULT_TIMEZONE);


defined('WAIT_TIMEOUT') || define('WAIT_TIMEOUT', 30);
$env->setEnvironmentVariable('WAIT_TIMEOUT', 30);

try {
new DateTimeZone(DEFAULT_TIMEZONE);
} catch (\Exception $e) {
Expand Down
8 changes: 8 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,14 @@ Denoted in browser log entry as `"SOURCE": "type"`.
BROWSER_LOG_BLACKLIST=other,console-api
```

### WAIT_TIMEOUT

Global MFTF configuration for the default amount of time (in seconds) that a test will wait while loading a page.

```conf
WAIT_TIMEOUT=30
```

<!-- Link definitions -->

[`MAGENTO_CLI_COMMAND_PATH`]: #magento_cli_command_path
Expand Down
2 changes: 1 addition & 1 deletion etc/config/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ MODULE_WHITELIST=Magento_Framework,ConfigurableProductWishlist,ConfigurableProdu
#ALLOW_SKIPPED=true

#*** Default timeout for wait actions
#WAIT_TIMEOUT=10
#WAIT_TIMEOUT=30

#*** Uncomment and set to enable browser log entries on actions in Allure. Blacklist is used to filter logs of a specific "source"
#ENABLE_BROWSER_LOG=true
Expand Down
2 changes: 1 addition & 1 deletion etc/config/functional.suite.dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ modules:
window_size: 1280x1024
username: "%MAGENTO_ADMIN_USERNAME%"
password: "%MAGENTO_ADMIN_PASSWORD%"
pageload_timeout: 30
pageload_timeout: "%WAIT_TIMEOUT%"
host: "%SELENIUM_HOST%"
port: "%SELENIUM_PORT%"
protocol: "%SELENIUM_PROTOCOL%"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class ActionObject
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PARAMETER = '/\(.+\)/';
const ACTION_ATTRIBUTE_VARIABLE_REGEX_PATTERN = '/({{[\w]+\.[\w\[\]]+}})|({{[\w]+\.[\w]+\((?(?!}}).)+\)}})/';
const STRING_PARAMETER_REGEX = "/'[^']+'/";
const DEFAULT_WAIT_TIMEOUT = 10;
const ACTION_ATTRIBUTE_USERINPUT = 'userInput';
const ACTION_TYPE_COMMENT = 'comment';

Expand Down Expand Up @@ -167,7 +166,7 @@ public function __construct(
*/
public static function getDefaultWaitTimeout()
{
return getenv('WAIT_TIMEOUT') ?: self::DEFAULT_WAIT_TIMEOUT;
return getenv('WAIT_TIMEOUT');
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Magento/FunctionalTestingFramework/_bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
defined('DEFAULT_TIMEZONE') || define('DEFAULT_TIMEZONE', 'America/Los_Angeles');
$env->setEnvironmentVariable('DEFAULT_TIMEZONE', DEFAULT_TIMEZONE);

defined('WAIT_TIMEOUT') || define('WAIT_TIMEOUT', 30);
$env->setEnvironmentVariable('WAIT_TIMEOUT', 30);

try {
new DateTimeZone(DEFAULT_TIMEZONE);
} catch (\Exception $e) {
Expand Down