UNPKG

playwright-fluent

Version:
45 lines (44 loc) 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const path_1 = tslib_1.__importDefault(require("path")); const playwright_fluent_1 = require("../../playwright-fluent"); describe('Playwright Fluent - withTimezone', () => { let p; beforeEach(() => { p = new playwright_fluent_1.PlaywrightFluent(); }); afterEach(async () => { await p.close(); }); test('should set Timezone to Tokyo - chromium', async () => { // Given const browser = 'chromium'; const url = `file:${path_1.default.join(__dirname, 'with-timezone.test.html')}`; const selector = '#timedisplay'; // When await p .withBrowser(browser) .withOptions({ headless: false }) .withTimezone('Asia/Tokyo') .navigateTo(url) // Then .expectThatSelector(selector) .hasText('Sun Oct 11 2020 06:26:42 GMT+0900 (Japan Standard Time)'); }); test('should set Timezone to Paris - chromium', async () => { // Given const browser = 'chromium'; const url = `file:${path_1.default.join(__dirname, 'with-timezone.test.html')}`; const selector = '#timedisplay'; // When await p .withBrowser(browser) .withOptions({ headless: false }) .withTimezone('Europe/Paris') .navigateTo(url) // Then .expectThatSelector(selector) .hasText('Sat Oct 10 2020 23:26:42 GMT+0200 (Central European Summer Time)'); }); });