test: clicking hidden input should not crash/timeout (#18410)

References #18183.
This commit is contained in:
Dmitry Gozman 2022-10-28 11:13:24 -07:00 committed by GitHub
parent 445404abb7
commit 90cf2b87b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -77,3 +77,12 @@ it('should scroll into view display:contents with position', async ({ page, brow
await page.click('text=click me', { position: { x: 5, y: 5 }, timeout: 5000 });
expect(await page.evaluate('window._clicked')).toBe(true);
});
it('should not crash when force-clicking hidden input', async ({ page, browserName }) => {
it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/18183' });
it.fixme(browserName === 'chromium');
await page.setContent(`<input type=hidden>`);
const error = await page.locator('input').click({ force: true, timeout: 2000 }).catch(e => e);
expect(error.message).toContain('Element is not visible');
});