Link to the code that reproduces this issue
https://github.com/teamleaderleo/playground/tree/repro/next-playwright-origin-cookie/next-playwright-origin-cookie-repro
To Reproduce
- Clone the reproduction and switch to the
repro/next-playwright-origin-cookie branch.
- Open
next-playwright-origin-cookie-repro.
- Run:
npm install
npx playwright install chromium
npm test
The reproduction creates a Playwright BrowserContext, adds a next-instant-navigation-testing cookie for app-b.example, and then calls instant() for app A using baseURL: 'https://app-a.example/'.
The assertion inside instant() fails because app B's cookie has already been removed:
AssertionError: app B cookie was removed by instant() for app A
actual: undefined
expected: '[1,"app-b",null]'
Current vs. Expected behavior
Calling instant() for app A can remove a next-instant-navigation-testing cookie that applies to app B in the same Playwright BrowserContext.
I expect instant() to clean up testing cookies that apply to the application URL it is controlling, without removing cookies for other applications.
Provide environment information
Node.js: v22.23.1
@next/playwright: 16.3.1-canary.8
Playwright: 1.61.1
`next info` is not applicable to this reproduction due to isolating the `@next/playwright` package behavior.
Which area(s) are affected? (Select all that apply)
Cookies, Testing
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response
Link to the code that reproduces this issue
https://github.com/teamleaderleo/playground/tree/repro/next-playwright-origin-cookie/next-playwright-origin-cookie-repro
To Reproduce
repro/next-playwright-origin-cookiebranch.next-playwright-origin-cookie-repro.npm install npx playwright install chromium npm testThe reproduction creates a Playwright
BrowserContext, adds anext-instant-navigation-testingcookie forapp-b.example, and then callsinstant()for app A usingbaseURL: 'https://app-a.example/'.The assertion inside
instant()fails because app B's cookie has already been removed:Current vs. Expected behavior
Calling
instant()for app A can remove anext-instant-navigation-testingcookie that applies to app B in the same PlaywrightBrowserContext.I expect
instant()to clean up testing cookies that apply to the application URL it is controlling, without removing cookies for other applications.Provide environment information
Which area(s) are affected? (Select all that apply)
Cookies, Testing
Which stage(s) are affected? (Select all that apply)
next dev (local), next start (local)
Additional context
No response