在没有cysession()的情况下将饼干保存在柏树中
我正在寻找通过整个测试用例将精确饼干保存在柏树中的方法。
正在使用
cypress.cookies.defaults({preserve:'cookie_name'})
和
cypress.cookies.preserveonce('cookie_name'')
,
但这不再起作用。而新的cy.session()
对我不起作用,因为我每个用户和每个新表单都使用自定义地址。
有谁知道任何比cy.session()
更好的工作?
I am looking for some way how to save exact cookie in Cypress through whole test case.
Was using
Cypress.Cookies.defaults({ preserve: 'cookie_name' })
and
Cypress.Cookies.preserveOnce('cookie_name')
but this doesn't work anymore. And the new cy.session()
is not working for me, because I use custom addresses per user and per new form.
Does anyone know of anything that works better than cy.session()
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
cy.session()
的使用模式有点不透明,但是由于它取代了旧的cookie配置,因此可能可以使其工作。我在某个地方看到了会议很快就会进行修改。
由于
cypress.cookies.preserveonce('cookie_name')
已弃用但仍然可用,也许可以使用该,直到会话标记2出现为止。The use pattern of
cy.session()
is a bit opaque, but since it replaces the older cookie config it probably can be made to work.I have seen a note somewhere that session is likely to be revamped shortly.
Since
Cypress.Cookies.preserveOnce('cookie_name')
is deprecated but still available, maybe use that until session mark 2 comes along.