fix: default to en-US locale in all browsers in Playwright Test (#11133)
It makes sense to default to en-US by default across all our browsers in Playwright Test. Fixes #11127
This commit is contained in:
parent
d31f13468a
commit
7b1fecc009
|
|
@ -96,7 +96,7 @@ export const test = _baseTest.extend<TestFixtures, WorkerFixtures>({
|
||||||
ignoreHTTPSErrors: [ undefined, { option: true } ],
|
ignoreHTTPSErrors: [ undefined, { option: true } ],
|
||||||
isMobile: [ undefined, { option: true } ],
|
isMobile: [ undefined, { option: true } ],
|
||||||
javaScriptEnabled: [ undefined, { option: true } ],
|
javaScriptEnabled: [ undefined, { option: true } ],
|
||||||
locale: [ undefined, { option: true } ],
|
locale: [ 'en-US', { option: true } ],
|
||||||
offline: [ undefined, { option: true } ],
|
offline: [ undefined, { option: true } ],
|
||||||
permissions: [ undefined, { option: true } ],
|
permissions: [ undefined, { option: true } ],
|
||||||
proxy: [ undefined, { option: true } ],
|
proxy: [ undefined, { option: true } ],
|
||||||
|
|
|
||||||
|
|
@ -82,8 +82,11 @@ it('should have pages in persistent context', async ({ launchPersistent }, testI
|
||||||
await page.waitForLoadState('domcontentloaded');
|
await page.waitForLoadState('domcontentloaded');
|
||||||
await context.close();
|
await context.close();
|
||||||
const log = JSON.parse(fs.readFileSync(harPath).toString())['log'];
|
const log = JSON.parse(fs.readFileSync(harPath).toString())['log'];
|
||||||
expect(log.pages.length).toBe(1);
|
// Explicit locale emulation forces a new page creation when
|
||||||
const pageEntry = log.pages[0];
|
// doing a new context.
|
||||||
|
// See https://github.com/microsoft/playwright/blob/13dd41c2e36a63f35ddef5dc5dec322052d670c6/packages/playwright-core/src/server/browserContext.ts#L232-L242
|
||||||
|
expect(log.pages.length).toBe(2);
|
||||||
|
const pageEntry = log.pages[1];
|
||||||
expect(pageEntry.id).toBeTruthy();
|
expect(pageEntry.id).toBeTruthy();
|
||||||
expect(pageEntry.title).toBe('Hello');
|
expect(pageEntry.title).toBe('Hello');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue