tests: fixed OS-locale specific failing test (#3863)
This commit is contained in:
parent
1d8d89dcfa
commit
d7f3812123
|
|
@ -19,25 +19,25 @@ import { it, expect } from './playwright.fixtures';
|
|||
it('should work', async ({ browser }) => {
|
||||
const func = () => new Date(1479579154987).toString();
|
||||
{
|
||||
const context = await browser.newContext({ timezoneId: 'America/Jamaica' });
|
||||
const context = await browser.newContext({ locale: 'en-US', timezoneId: 'America/Jamaica' });
|
||||
const page = await context.newPage();
|
||||
expect(await page.evaluate(func)).toBe('Sat Nov 19 2016 13:12:34 GMT-0500 (Eastern Standard Time)');
|
||||
await context.close();
|
||||
}
|
||||
{
|
||||
const context = await browser.newContext({ timezoneId: 'Pacific/Honolulu' });
|
||||
const context = await browser.newContext({ locale: 'en-US', timezoneId: 'Pacific/Honolulu' });
|
||||
const page = await context.newPage();
|
||||
expect(await page.evaluate(func)).toBe('Sat Nov 19 2016 08:12:34 GMT-1000 (Hawaii-Aleutian Standard Time)');
|
||||
await context.close();
|
||||
}
|
||||
{
|
||||
const context = await browser.newContext({ timezoneId: 'America/Buenos_Aires' });
|
||||
const context = await browser.newContext({ locale: 'en-US', timezoneId: 'America/Buenos_Aires' });
|
||||
const page = await context.newPage();
|
||||
expect(await page.evaluate(func)).toBe('Sat Nov 19 2016 15:12:34 GMT-0300 (Argentina Standard Time)');
|
||||
await context.close();
|
||||
}
|
||||
{
|
||||
const context = await browser.newContext({ timezoneId: 'Europe/Berlin' });
|
||||
const context = await browser.newContext({ locale: 'en-US', timezoneId: 'Europe/Berlin' });
|
||||
const page = await context.newPage();
|
||||
expect(await page.evaluate(func)).toBe('Sat Nov 19 2016 19:12:34 GMT+0100 (Central European Standard Time)');
|
||||
await context.close();
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ it('should support colorScheme option', async ({launchPersistent}) => {
|
|||
});
|
||||
|
||||
it('should support timezoneId option', async ({launchPersistent}) => {
|
||||
const {page} = await launchPersistent({timezoneId: 'America/Jamaica'});
|
||||
const {page} = await launchPersistent({locale: 'en-US', timezoneId: 'America/Jamaica'});
|
||||
expect(await page.evaluate(() => new Date(1479579154987).toString())).toBe('Sat Nov 19 2016 13:12:34 GMT-0500 (Eastern Standard Time)');
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue