mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-64967 Behat: Mobile app testing does not load CSS files
Some files cannot be loaded due to CORS restrictions.
This commit is contained in:
parent
07203d34f1
commit
7514557426
@ -634,6 +634,8 @@ class behat_config_util {
|
||||
|
||||
// Automatically add Chrome command line option to skip the prompt about allowing file
|
||||
// storage - needed for mobile app testing (won't hurt for everything else either).
|
||||
// We also need to disable web security, otherwise it can't make CSS requests to the server
|
||||
// on localhost due to CORS restrictions.
|
||||
if (!empty($values['browser']) && $values['browser'] === 'chrome') {
|
||||
if (!isset($values['capabilities'])) {
|
||||
$values['capabilities'] = [];
|
||||
@ -645,6 +647,7 @@ class behat_config_util {
|
||||
$values['capabilities']['chrome']['switches'] = [];
|
||||
}
|
||||
$values['capabilities']['chrome']['switches'][] = '--unlimited-storage';
|
||||
$values['capabilities']['chrome']['switches'][] = '--disable-web-security';
|
||||
|
||||
// If the mobile app is enabled, check its version and add appropriate tags.
|
||||
if ($mobiletags = $this->get_mobile_version_tags()) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user