Skip to content

Commit

Permalink
test: add regression tests for clicking
Browse files Browse the repository at this point in the history
  • Loading branch information
aslushnikov committed Apr 5, 2023
1 parent bd698ef commit 7371fa2
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/page/locator-click.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,19 @@ it('should double click the button', async ({ page, server }) => {
expect(await page.evaluate('double')).toBe(true);
expect(await page.evaluate('result')).toBe('Clicked');
});

it('should click if the target element is removed in pointerup event', async ({ page, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21995' });
it.fixme(browserName === 'firefox');
await page.setContent(`<button id=clickme>Clickable</button>`);
await page.$eval('#clickme', element => element.addEventListener('pointerup', () => element.remove(), false));
await page.locator('#clickme').click();
});

it('should click if the target element is removed in pointerdown event', async ({ page, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21995' });
it.fixme(browserName === 'firefox');
await page.setContent(`<button id=clickme>Clickable</button>`);
await page.$eval('#clickme', element => element.addEventListener('pointerdown', () => element.remove(), false));
await page.locator('#clickme').click();
});

0 comments on commit 7371fa2

Please sign in to comment.