【发布时间】:2019-06-25 18:17:12
【问题描述】:
从 Cypress 版本 3.1.0 升级到 3.3.1 并开始在每次运行测试时看到以下错误。
cy.visit() 尝试加载失败
我们在网络级别收到此错误:
错误:无法解析或设置名为“cookie-name”的 cookie。
堆栈跟踪如下:
铬 75:
未定义
电子 61:
错误:设置 cookie 失败
有谁知道从 3.1.0 版开始有哪些变化可能导致此问题,除了恢复之外还有其他解决方法吗?
Edit: Zach correctly deduced the problem stemming from the server trying to set a secure cookie on a site that is not secure. This presents a problem since the server cannot be changed and securing the domain in question is not really an option. Aside from being perpetually stuck on version 3.1.0 any ideas for workarounds or reverting the change would be appreciated.
【问题讨论】:
-
你能分享设置cookie的代码吗?
-
cookie是服务器设置的,所以没有这方面的代码分享。
-
是的,那个代码。 :) 我只在您尝试在非 HTTPS 来源上设置
securecookie 时看到此错误,是这样吗? -
抱歉我误解了。您是正确的,因为 cookie 是安全的,而域不是。 “设置 Cookie:键=值;路径=/;安全;HttpOnly”。感谢您提供进一步调查的途径。
标签: cypress