Issue
I am using Cypress to test Mageto2.
Problem: Whenever I navigate to different parts of the back end I am requested to log in (And Magento redirects to a certain set page after login instead of the requested page)
Question: Is there a way to remember my session when testing with Cypress so I don't have to log in for any redirection to a part of the backed?
Solution
Cypress clears all cookies before each test
Cypress.Cookies.defaults({
preserve: "adminhtml"
})
fyi: adminhtml cookie stores admin's session id
EDIT
It appears that in magento 2 admin session id is stored in a cookie named "admin"
Cypress.Cookies.defaults({
preserve: "admin"
})
Answered By - Vladimir Samsonov Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.