Affects Version/s: 3.5.7, 3.6.5, 3.7.1, 3.8
Component/s: Automated functional tests (behat)
Affected Branches:MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
Fixed Branches:MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE
Pull from Repository:
Pull Master Branch:
Pull Master Diff URL:
- Update the CI testrunner to stop pinning to the -mercury release
- Ensure that it has been deployed
- Kick off behat runs
On my system (Windows 10), Behat has stopped working since upgrading to Chrome/ChromeDriver 76 (Selenium 3.141.59).
In Chrome 76 they moved to using W3C by default.
It is possible to tell it not to but that requires a modification to the upstream webdriver project and they’ve gone largely silent.
I’m actively working on moving us to the Facebook webdriver project which I’m also actively working on getting to support W3C browsers natively. Whenthat happens, hopefully in the next few weeks, we will be able to run behatin Safari, Edge, Firefox Quantum, and Chrome 76+.
In the meantime I’m thinking we should patch the instaclick webdriver wecurrently use to make it stop using W3C in chrome 76.
In our CI infra we’ve hard coded use of the Selenium 3.141.59-mercury Docker image which is chrome 75.
I tracked down the problem and was able to 'fix' it by inserting the following 3 lines at the start of the webDriverElement function in Behat, vendor/instaclick/php-webdriver/lib/WebDriver/Container.php:
The reason this fix works is that a return value containing elements from Selenium WebDriver, as defined here https://w3c.github.io/webdriver/#elements , has the array key 'element-6066-11e4-a52e-4f735466cecf' but the code here is expecting the array ky 'ELEMENT'.
I confirmed this in the code by basically adding in print lines all over, so that I could output the result from Selenium, like this:
I had also been experimenting by directly posting things to the WebDriver endpoint without using Moodle/Behat code, with similar results.
Anyway, obviously if this is a problem it would be a problem upstream, but I am not at all clear it is an actual problem vs. me screwing up, because I don't see how the code would have worked before.
I'll attach the change as a patch.