playwright-fluent
Version:
Fluent API around playwright
40 lines (39 loc) • 1.44 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const playwright_fluent_1 = require("../../playwright-fluent");
describe.skip('Playwright Fluent - withOptions', () => {
let p;
beforeEach(() => {
p = new playwright_fluent_1.PlaywrightFluent();
});
afterEach(async () => {
await p.close();
});
test('should target webkit in headfull mode', async () => {
// Given
const browser = 'webkit';
// When
await p.withBrowser(browser).withOptions({ headless: false });
// Then
const browserInstance = p.currentBrowser();
const pageInstance = p.currentPage();
expect(browserInstance).toBeDefined();
expect(pageInstance).toBeDefined();
const userAgent = pageInstance && (await pageInstance.evaluate(() => window.navigator.userAgent));
expect(userAgent).toContain('Safari');
});
test('should target webkit in headfull mode with custom window size', async () => {
// Given
const browser = 'webkit';
const options = {
headless: false,
args: ['--window-size=888,666'],
};
// When
await p.withBrowser(browser).withOptions(options);
// Then
const windowState = await p.getCurrentWindowState();
expect(windowState.outerWidth).toBe(888);
expect(windowState.outerHeight).toBe(666);
});
});
;