cy.origin() is such a huge win! Can't wait to try it out with AWS Cognito login.
Why do we need the args in cy.session([email, password]..?
I definitely love order independence push in tests while using cy.session, it is the right thing to do, but having to re-login via session for every test is not very nice.
I will try to combo cy.origin with cy.session vs cypress-data-session (everything I wish cy.session was) and let you know how it goes.
Google Developer Expert (GDE), Developer Experience (DX) Engineer at Cypress. CEO & Co-Founder of Dream On: Global, Christian, Husband, Father, & Cleveland Sports Fan.
Thanks for the feedback Murat! The reason you need the args:
The args object is the only mechanism via which data may be injected into the callback, the callback is not a closure and does not retain access to the JavaScript context in which it was declared. Values passed into args must be serializable.
Essentially think of cy.session like you would an HTTP request. Any data you will need on either end of the request/response you need to pass in the request (which then gets serialized) so it needs passed in as an arg so that the callback function has a reference to. Hope that helps bring some clarification
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
cy.origin() is such a huge win! Can't wait to try it out with AWS Cognito login.
Why do we need the args in
cy.session([email, password]..
?I definitely love order independence push in tests while using cy.session, it is the right thing to do, but having to re-login via session for every test is not very nice.
I will try to combo cy.origin with cy.session vs cypress-data-session (everything I wish cy.session was) and let you know how it goes.
Thanks for the feedback Murat! The reason you need the args:
The args object is the only mechanism via which data may be injected into the callback, the callback is not a closure and does not retain access to the JavaScript context in which it was declared. Values passed into args must be serializable.
Essentially think of
cy.session
like you would an HTTP request. Any data you will need on either end of the request/response you need to pass in the request (which then gets serialized) so it needs passed in as an arg so that the callback function has a reference to. Hope that helps bring some clarification