Hi all, is it possible to `alias` a specific value...
# help
s
Hi all, is it possible to
alias
a specific value returned from
cy.session()
? Seen in my code as
.as('jwtToken')
, when I do this the whole response is aliased and not just the cookie I need for later usage.
Copy code
cy.session('session caching', () => {
      cy.request({
        method: 'POST',
        url: `${urlUnderTest.origin}/auth/`,
        failOnStatusCode: false,
        body: {
          password: Cypress.env('AUTH_PASSWORD'),
        },
        headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
        },
      }).then(({ allRequestResponses }) => {
        cy.wrap(allRequestResponses[0]['Response Headers']['set-cookie'][0]).as('jwtToken');
      });
    });
cy.visit(urlUnderTest.toString());