mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: default and overriden locale isolation between contexts (#3308)
This commit is contained in:
parent
e582cc678c
commit
aa2ec09e97
@ -138,3 +138,28 @@ it('should be isolated between contexts', async({browser, server}) => {
|
|||||||
context2.close()
|
context2.close()
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it.fail(FFOX)('should not change default locale in another context', async({browser, server}) => {
|
||||||
|
async function getContextLocale(context) {
|
||||||
|
const page = await context.newPage();
|
||||||
|
return await page.evaluate(() => (new Intl.NumberFormat()).resolvedOptions().locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
let defaultLocale;
|
||||||
|
{
|
||||||
|
const context = await browser.newContext();
|
||||||
|
defaultLocale = await getContextLocale(context);
|
||||||
|
await context.close();
|
||||||
|
}
|
||||||
|
const localeOverride = defaultLocale === 'ru-RU' ? 'de-DE' : 'ru-RU';
|
||||||
|
{
|
||||||
|
const context = await browser.newContext({ locale: localeOverride});
|
||||||
|
expect(await getContextLocale(context)).toBe(localeOverride);
|
||||||
|
await context.close();
|
||||||
|
}
|
||||||
|
{
|
||||||
|
const context = await browser.newContext();
|
||||||
|
expect(await getContextLocale(context)).toBe(defaultLocale);
|
||||||
|
await context.close();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user