https://cypress.io logo
Hi, everyone and have a good day! Maybe it was dis...
# help
f
Hi, everyone and have a good day! Maybe it was discussed here already. I have the following question. 1. For a long time I was using the Cookies.preserveOnce logic in
beforeEach
to preserve the particular cookies between the
it
blocks:
Cypress.Cookies.preserveOnce('SESSION', 'CSRF-TOKEN', 'trustToken');
2. One line did the job, these are the only cookies I need, and I don't need any other info between the test steps. 3. So, now this code is deprecated and should be replaced by
cy.session
4. What is the best way to preserve the same logic with
cy.session
if the only thing I need is to preserve these particular cookies without visiting the pages or performing any requests?