在没有cysession()的情况下将饼干保存在柏树中

发布于 2025-02-08 18:48:29 字数 316 浏览 2 评论 0原文

我正在寻找通过整个测试用例将精确饼干保存在柏树中的方法。

正在使用

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蝶…霜飞 2025-02-15 18:48:29

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文