Skip to content

Commit 9af3916

Browse files
DavertMikclaude
andcommitted
fix(test-data): derive cookie test URLs from siteUrl instead of hardcoded localhost
Cookies were set for http://localhost while the app runs on 127.0.0.1:8000 (TestHelper.siteUrl()), so CDP's origin-scoped cookie lookup never found them. Puppeteer/WebDriver have the same origin-scoping semantics and were exposed to the identical bug, just masked by the removed CDPBrowser-only skip guard. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent b551b9d commit 9af3916

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

test/helper/webapi.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,12 +1301,11 @@ export function tests() {
13011301
if (process.env.CI || process.env.GITHUB_ACTIONS) this.skip()
13021302
})
13031303
it('should do all cookie stuff', async function () {
1304-
if (isHelper('CDPBrowser')) this.skip() // cookie is set for domain "localhost" but the app runs on 127.0.0.1 here; Puppeteer fails the same way in this environment
13051304
await I.amOnPage('/')
13061305
await I.setCookie({
13071306
name: 'auth',
13081307
value: '123456',
1309-
url: 'http://localhost',
1308+
url: siteUrl,
13101309
})
13111310
await I.seeCookie('auth')
13121311
await I.dontSeeCookie('auuth')
@@ -1319,17 +1318,16 @@ export function tests() {
13191318
})
13201319

13211320
it('should grab all cookies', async function () {
1322-
if (isHelper('CDPBrowser')) this.skip() // cookie is set for domain "localhost" but the app runs on 127.0.0.1 here; Puppeteer fails the same way in this environment
13231321
await I.amOnPage('/')
13241322
await I.setCookie({
13251323
name: 'auth',
13261324
value: '123456',
1327-
url: 'http://localhost',
1325+
url: siteUrl,
13281326
})
13291327
await I.setCookie({
13301328
name: 'user',
13311329
value: 'davert',
1332-
url: 'http://localhost',
1330+
url: siteUrl,
13331331
})
13341332

13351333
const cookies = await I.grabCookie()
@@ -1343,7 +1341,7 @@ export function tests() {
13431341
await I.setCookie({
13441342
name: 'auth',
13451343
value: '123456',
1346-
url: 'http://localhost',
1344+
url: siteUrl,
13471345
})
13481346
await I.clearCookie()
13491347
await I.dontSeeCookie('auth')
@@ -1359,12 +1357,11 @@ export function tests() {
13591357
})
13601358

13611359
it('should wait for cookie', async function () {
1362-
if (isHelper('CDPBrowser')) this.skip() // cookie is set for domain "localhost" but the app runs on 127.0.0.1 here; Puppeteer fails the same way in this environment
13631360
await I.amOnPage('/')
13641361
await I.setCookie({
13651362
name: 'auth',
13661363
value: '123456',
1367-
url: 'http://localhost',
1364+
url: siteUrl,
13681365
})
13691366
await I.waitForCookie('auth')
13701367
})

0 commit comments

Comments
 (0)