mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 05:37:20 +03:00
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 } ],
|
||||
isMobile: [ undefined, { option: true } ],
|
||||
javaScriptEnabled: [ undefined, { option: true } ],
|
||||
locale: [ undefined, { option: true } ],
|
||||
locale: [ 'en-US', { option: true } ],
|
||||
offline: [ undefined, { option: true } ],
|
||||
permissions: [ 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 context.close();
|
||||
const log = JSON.parse(fs.readFileSync(harPath).toString())['log'];
|
||||
expect(log.pages.length).toBe(1);
|
||||
const pageEntry = log.pages[0];
|
||||
// Explicit locale emulation forces a new page creation when
|
||||
// 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.title).toBe('Hello');
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user