Cypress.io 关于 Chrome 问题 "SameSite by default cookies"

Cypress.io on Chrome with "SameSite by default cookies" issue

我们在 运行 Cypress.io 本地通过 http:// 使用 Chrome,当 "SameSite by default cookies" 开启时(他们开始向所有用户),我们的登录测试失败,因为无法设置会话 cookie(因为连接不安全而被阻止)。关于解决方法的任何建议?我研究了根据以下内容设置 Chrome 标志:

https://docs.cypress.io/api/plugins/browser-launch-api.html#Examples

带有标志:

https://peter.sh/experiments/chromium-command-line-switches/#unsafely-treat-insecure-origin-as-secure

但找不到合适的标志。谢谢。

我最终通过简单地将我的 local/test 环境的会话 cookie 的 samesite 属性从需要 securenone 更改为 lax 来解决这个问题].希望这对其他人有帮助!

我 运行 遇到了同样的问题。

我的解决方案是 chrome://flags(在 运行 chrome 来自 cypress 之后)并默认将 SameSite cookie 设置为禁用。