Defect #44809
closedSystem tests fail with Chrome 158 because Capybara cannot reset sessions
Description
Since Chrome 158, many system tests fail, both locally and on GitHub Actions:
https://github.com/redmine/redmine/actions/runs/46119154831/job/140899606752
This is caused by an incompatibility between Capybara 3.40.0 and Chrome 158: https://github.com/teamcapybara/capybara/issues/2865
After each test, Capybara resets the session by sending Storage.clearDataForOrigin with the origin *. Chrome 158 rejects it with "invalid argument: * is not a valid URL". As a result, the cookies are not cleared, and the next test starts logged in.
A version of Capybara that fixes this has not been released yet. The attached patch works around the problem in ApplicationSystemTestCase. It clears the cookies with Network.clearBrowserCookies, and the other storage with the origin of the application. It has no effect once Capybara stops sending the origin *, and should be removed when a fixed version is released.
Files
Updated by Takenori TAKAKI 7 days ago
I tested the patch with Chrome 158, and it fixes the problem.
- GitHub Actions (Chrome 158.0.8127.36): all system tests pass.
https://github.com/takenory/redmine/actions/runs/46338305238 - Locally (Chrome 158.0.8127.89): all system tests pass.
- Locally with Chrome 157, the patch causes no new failures.
Updated by Marius BĂLTEANU 4 days ago
- Target version changed from 6.1.7 to 6.0.13