Project

General

Profile

Actions

Defect #44809

open

System tests fail with Chrome 158 because Capybara cannot reset sessions

Defect #44809: System tests fail with Chrome 158 because Capybara cannot reset sessions

Added by Go MAEDA about 21 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Code cleanup/refactoring
Resolution:
Affected version:

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

No data to display

Actions

Also available in: PDF Atom