UNPKG

playwright-fluent

Version:
34 lines (33 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const playwright_fluent_1 = require("../../playwright-fluent"); const devices_1 = require("../../../devices"); describe.skip('Playwright Fluent - withWindowSize', () => { let p; beforeEach(() => { p = new playwright_fluent_1.PlaywrightFluent(); }); afterEach(async () => { await p.close(); }); test('should target chrome in headfull with windowsize 800x600', async () => { // Given const browser = 'chrome'; const options = { headless: false, }; const url = 'https://reactstrap.github.io'; const size = devices_1.sizeOf._800x600; // When // prettier-ignore await p .withBrowser(browser) .withOptions(options) .withWindowSize(size) .navigateTo(url); // Then const windowState = await p.getCurrentWindowState(); expect(Math.abs(windowState.outerWidth - size.width)).toBeLessThanOrEqual(10); expect(Math.abs(windowState.outerHeight - size.height)).toBeLessThanOrEqual(10); }); });