Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tests/library/tap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import type { ElementHandle } from 'playwright-core';

it.use({ hasTouch: true });

it('TA-001 should send all of the correct events @smoke', async ({ page }) => {
it('TA-001 should send all of the correct events @smoke', {
annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/43569' },
}, async ({ page }) => {
await page.setContent(`
<div id="a" style="background: lightblue; width: 50px; height: 50px">a</div>
<div id="b" style="background: pink; width: 50px; height: 50px">b</div>
Expand All @@ -37,6 +39,14 @@ it('TA-001 should send all of the correct events @smoke', async ({ page }) => {
'mousemove', 'mousedown',
'mouseup', 'click',
]);

await eventsHandle.evaluate(events => events.length = 0);
await page.locator('#b').evaluate(target => {
target.addEventListener('pointerdown', event => event.preventDefault(), { once: true });
});
await page.tap('#b');
const events = (await eventsHandle.jsonValue()).filter(event => ['pointerdown', 'pointerup', 'mousedown', 'mouseup', 'click'].includes(event));
expect(events).toEqual(['pointerdown', 'pointerup', 'click']);
});

it('TA-002 trial run should not tap', async ({ page }) => {
Expand Down
Loading