playwright-fluent
Version:
Fluent API around playwright
44 lines (43 loc) • 1.74 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const playwright_1 = require("playwright");
const __1 = require("..");
const SUT = tslib_1.__importStar(require("./index"));
describe('show-mouse-position', () => {
let browser = undefined;
// eslint-disable-next-line @typescript-eslint/no-empty-function
beforeEach(() => { });
afterEach(async () => {
if (browser) {
await browser.close();
}
});
test('should show cursor on the page on firefox', async () => {
// Given
const url = 'https://reactstrap.github.io/components/form';
browser = await playwright_1.firefox.launch({ headless: true });
const context = await browser.newContext({ viewport: null });
const page = await context.newPage();
// When
await SUT.showMousePosition(page);
await page.goto(url);
// Then
const cursorExists = await (0, __1.exists)('playwright-mouse-pointer', page);
expect(cursorExists).toBe(true);
});
test('should show cursor on navigating to another page on firefox', async () => {
// Given
const url = 'https://reactstrap.github.io/components/form';
browser = await playwright_1.firefox.launch({ headless: true });
const context = await browser.newContext({ viewport: null });
const page = await context.newPage();
// When
await SUT.showMousePosition(page);
await page.goto(url);
await page.goto('https://google.com');
// Then
const cursorExists = await (0, __1.exists)('playwright-mouse-pointer', page);
expect(cursorExists).toBe(true);
});
});
;