Skip to content

Commit e618303

Browse files
test(webkit): cover tap after canceled pointerdown (#43757)
Co-authored-by: microsoft-playwright-automation[bot] <203992400+microsoft-playwright-automation[bot]@users.noreply.github.com>
1 parent addf6f7 commit e618303

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

‎tests/library/tap.spec.ts‎

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ import type { ElementHandle } from 'playwright-core';
1919

2020
it.use({ hasTouch: true });
2121

22-
it('TA-001 should send all of the correct events @smoke', async ({ page }) => {
22+
it('TA-001 should send all of the correct events @smoke', {
23+
annotation: { type: 'issue', description: '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/microsoft/playwright/issues/43569' },
24+
}, async ({ page }) => {
2325
await page.setContent(`
2426
<div id="a" style="background: lightblue; width: 50px; height: 50px">a</div>
2527
<div id="b" style="background: pink; width: 50px; height: 50px">b</div>
@@ -37,6 +39,14 @@ it('TA-001 should send all of the correct events @smoke', async ({ page }) => {
3739
'mousemove', 'mousedown',
3840
'mouseup', 'click',
3941
]);
42+
43+
await eventsHandle.evaluate(events => events.length = 0);
44+
await page.locator('#b').evaluate(target => {
45+
target.addEventListener('pointerdown', event => event.preventDefault(), { once: true });
46+
});
47+
await page.tap('#b');
48+
const events = (await eventsHandle.jsonValue()).filter(event => ['pointerdown', 'pointerup', 'mousedown', 'mouseup', 'click'].includes(event));
49+
expect(events).toEqual(['pointerdown', 'pointerup', 'click']);
4050
});
4151

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

0 commit comments

Comments
 (0)