mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
MDL-77944 behat: Rename chrome options for w3c support
From Selenium 4.8.0, support for non-w3c browser control has ended. We only use W3C browser control these days, and this was missed as part of the move to W3C. All browser options must be vendor-prefixed.
This commit is contained in:
parent
38c35247e9
commit
bc85007834
@ -666,7 +666,7 @@ class behat_config_util {
|
||||
[
|
||||
'capabilities' => [
|
||||
'extra_capabilities' => [
|
||||
'chromeOptions' => [
|
||||
'goog:chromeOptions' => [
|
||||
'args' => [
|
||||
'unlimited-storage',
|
||||
'disable-web-security',
|
||||
@ -678,6 +678,16 @@ class behat_config_util {
|
||||
$values
|
||||
);
|
||||
|
||||
// Selenium no longer supports non-w3c browser control.
|
||||
// Rename chromeOptions to goog:chromeOptions, which is the W3C variant of this.
|
||||
if (array_key_exists('chromeOptions', $values['capabilities']['extra_capabilities'])) {
|
||||
$values['capabilities']['extra_capabilities']['goog:chromeOptions'] = array_merge_recursive(
|
||||
$values['capabilities']['extra_capabilities']['goog:chromeOptions'],
|
||||
$values['capabilities']['extra_capabilities']['chromeOptions'],
|
||||
);
|
||||
unset($values['capabilities']['extra_capabilities']['chromeOptions']);
|
||||
}
|
||||
|
||||
// If the mobile app is enabled, check its version and add appropriate tags.
|
||||
if ($mobiletags = $this->get_mobile_version_tags()) {
|
||||
if (!empty($values['tags'])) {
|
||||
@ -687,13 +697,13 @@ class behat_config_util {
|
||||
}
|
||||
}
|
||||
|
||||
$values['capabilities']['extra_capabilities']['chromeOptions']['args'] = array_map(function($arg): string {
|
||||
$values['capabilities']['extra_capabilities']['goog:chromeOptions']['args'] = array_map(function($arg): string {
|
||||
if (substr($arg, 0, 2) === '--') {
|
||||
return substr($arg, 2);
|
||||
}
|
||||
return $arg;
|
||||
}, $values['capabilities']['extra_capabilities']['chromeOptions']['args']);
|
||||
sort($values['capabilities']['extra_capabilities']['chromeOptions']['args']);
|
||||
}, $values['capabilities']['extra_capabilities']['goog:chromeOptions']['args']);
|
||||
sort($values['capabilities']['extra_capabilities']['goog:chromeOptions']['args']);
|
||||
}
|
||||
|
||||
// Fill tags information.
|
||||
|
Loading…
x
Reference in New Issue
Block a user