mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: add a test for clicking a label with pointer-events: none (#2412)
This commit is contained in:
parent
767f6bfeb9
commit
4bd9b30376
@ -524,6 +524,17 @@ describe('Page.click', function() {
|
|||||||
await clickPromise;
|
await clickPromise;
|
||||||
expect(await page.evaluate(() => window.__CLICKED)).toBe(true);
|
expect(await page.evaluate(() => window.__CLICKED)).toBe(true);
|
||||||
});
|
});
|
||||||
|
it('should wait for LABEL to be clickable when it has pointer-events:none', async({page, server}) => {
|
||||||
|
await page.setContent('<label onclick="javascript:window.__CLICKED=true;" style="pointer-events:none"><span>Click target</span></label>');
|
||||||
|
const clickPromise = page.click('text=Click target');
|
||||||
|
// Do a few roundtrips to the page.
|
||||||
|
for (let i = 0; i < 5; ++i)
|
||||||
|
expect(await page.evaluate(() => window.__CLICKED)).toBe(undefined);
|
||||||
|
// remove `pointer-events: none` css from button.
|
||||||
|
await page.evaluate(() => document.querySelector('label').style.removeProperty('pointer-events'));
|
||||||
|
await clickPromise;
|
||||||
|
expect(await page.evaluate(() => window.__CLICKED)).toBe(true);
|
||||||
|
});
|
||||||
it('should update modifiers correctly', async({page, server}) => {
|
it('should update modifiers correctly', async({page, server}) => {
|
||||||
await page.goto(server.PREFIX + '/input/button.html');
|
await page.goto(server.PREFIX + '/input/button.html');
|
||||||
await page.click('button', { modifiers: ['Shift'] });
|
await page.click('button', { modifiers: ['Shift'] });
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user