- Issue created by @thinkingcap
- π¦πΊAustralia thinkingcap
I notice that this was being discussed on GitHub: https://github.com/cypress-io/cypress/issues/26398 and added my solution over there: https://github.com/cypress-io/cypress/issues/26398#issuecomment-1847112026
Copied here for convenience:
I got this working by intercepting the Set-Cookies header and enforcing SameSite=None; Secure.
cy.intercept('*', (req) => { req.on('response', (res) => { const setCookies = res.headers['set-cookie']; if (setCookies) { res.headers['set-cookie'] = ( Array.isArray(setCookies) ? setCookies : [setCookies] ) .map((cookie) => { // Override or add SameSite=None if (cookie.includes('SameSite')) { cookie = cookie.replace(/SameSite=(Lax|Strict|None)/i, 'SameSite=None'); } else { cookie = `${cookie}; SameSite=None`; } // Add Secure if not present if (!cookie.includes('Secure')) { cookie = `${cookie}; Secure`; } return cookie; }); } }); }); cy.origin('https://ethereal.email', { args: sentArgs }, ({ userEmail, userPassword, searchSubjectLine, }) => { . . .
- πΊπΈUnited States aangel
Thanks for this. I nudged the folks at Cypress about the issue a couple months back but that didn't help.
I'll nudge them again and point out your workaround. I'll also point to it on the Known Issues page:
https://performantlabs.com/automated-testing-kit/known-issues