Skip to content

Commit

Permalink
MDL-68525 behat: chrome/switches caps not allowed in Chrome > 81
Browse files Browse the repository at this point in the history
Now we need to use extra_capabilities/chromeOptions/args instead

The former was deprecated long ago, it seems that Chrome 81 has
stopped accepting it. The later seems to be working at very least
since Chrome 76 (haven't gone further back).
  • Loading branch information
stronk7 authored and andrewnicols committed Apr 28, 2020
1 parent a6f315c commit 7d599ae
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lib/behat/classes/behat_config_util.php
Original file line number Diff line number Diff line change
Expand Up @@ -637,14 +637,17 @@ protected function get_behat_profile($profile, $values) {
if (!isset($values['capabilities'])) {
$values['capabilities'] = [];
}
if (!isset($values['capabilities']['chrome'])) {
$values['capabilities']['chrome'] = [];
if (!isset($values['capabilities']['extra_capabilities'])) {
$values['capabilities']['extra_capabilities'] = [];
}
if (!isset($values['capabilities']['chrome']['switches'])) {
$values['capabilities']['chrome']['switches'] = [];
if (!isset($values['capabilities']['extra_capabilities']['chromeOptions'])) {
$values['capabilities']['extra_capabilities']['chromeOptions'] = [];
}
$values['capabilities']['chrome']['switches'][] = '--unlimited-storage';
$values['capabilities']['chrome']['switches'][] = '--disable-web-security';
if (!isset($values['capabilities']['extra_capabilities']['chromeOptions']['args'])) {
$values['capabilities']['extra_capabilities']['chromeOptions']['args'] = [];
}
$values['capabilities']['extra_capabilities']['chromeOptions']['args'][] = '--unlimited-storage';
$values['capabilities']['extra_capabilities']['chromeOptions']['args'][] = '--disable-web-security';

// If the mobile app is enabled, check its version and add appropriate tags.
if ($mobiletags = $this->get_mobile_version_tags()) {
Expand Down

0 comments on commit 7d599ae

Please sign in to comment.