UNPKG

playwright-fluent

Version:
57 lines (56 loc) 1.89 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 - withDialogs', () => { let p; beforeEach(() => { p = new playwright_fluent_1.PlaywrightFluent(); }); afterEach(async () => { await p.close(); }); test('should record page dialogs - alert - chromium', async () => { // Given const browser = 'chromium'; const url = `file:${path_1.default.join(__dirname, 'with-dialogs-alert.test.html')}`; // When await p .withBrowser(browser) .withOptions({ headless: false }) .WithDialogs() .navigateTo(url) // Then .expectThatDialog() .isOfType('alert'); }); test('should record page dialogs - confirm - chromium', async () => { // Given const browser = 'chromium'; const url = `file:${path_1.default.join(__dirname, 'with-dialogs-confirm.test.html')}`; // When await p .withBrowser(browser) .withOptions({ headless: false }) .WithDialogs() .navigateTo(url) // Then .expectThatDialog() .isOfType('confirm'); }); test('should record page dialogs - prompt - chromium', async () => { // Given const browser = 'chromium'; const url = `file:${path_1.default.join(__dirname, 'with-dialogs-prompt.test.html')}`; // When await p .withBrowser(browser) .withOptions({ headless: false }) .WithDialogs() .navigateTo(url) // Then .expectThatDialog() .isOfType('prompt'); }); });