Repository navigation
Description
Context:
- Playwright Version: ^1.29.1
- Operating System: Windows11
- Node.js Version: v19.0.1
- Browser: Chromium
Code Snippet
test("repro", async ({ page, context }) => {
await page.goto('http://localhost:8080');
await page.locator('#theForceIsStrongWithThisOne').click({ timeout: 3000 });
});HTML:
<body id="divID">
<div id="container" class="container somethingPage" style="height: auto;">
<div class="banner" id="pageBanner">
<div id="bannerImageContainer" class="bannerImageLeftAlign" style="background: rgb(255, 255, 255);">
<img id="headerImage" src="./files/large-company-logo.png">
</div>
</div>
<main class="somethingInfo">
<div class="documentTitle" id="documentTitle">
<div class="filterIconContainer">
<span id="theForceIsStrongWithThisOne" class="filter"></span> <!-- This is the target -->
</div>
<p id="somethingHeader" class=""><b class="heading">Keep On Darthin' In The Free World</b></p>
</div>
<div id="readOnlyWarning">
<p><b>These are the blog articles you are looking for, if not, use the filter button above.</b></p>
</div>
</main>
</div>
</body>I also note that there is CSS for the "filter" class:
.filter:after {
position: absolute;
border-left: .25em solid;
left: -.125em;
top: -.2em;
height: .4em;
content: ' '
}Describe the bug
When running this (only) in Chromium, as you will see in the trace below, while playwright correctly highlights the filter control, it is going to perform the click elsewhere and so the error that is returned makes sense "</body> intercepts pointer events"

I have a feeling this is probably not playwright and more likely chromium itself but this is somewhat further than I know to go in the code to really get to the bottom of it.
Click here for the log produced:
waiting for locator('#theForceIsStrongWithThisOne')
locator resolved to visible <span class="filter" id="theForceIsStrongWithThisOne"></span>
attempting click action
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #1
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #2
waiting 20ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #3
waiting 100ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #4
waiting 100ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #5
waiting 500ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #6
waiting 500ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #7
waiting 500ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #8
waiting 500ms
waiting for element to be visible, enabled and stable
element is visible, enabled and stable
scrolling into view if needed
done scrolling
<body id="divID">…</body> intercepts pointer events
retrying click action, attempt #9
waiting 500msHere is the output from the console:
3 | test("repro", async ({ page, context }) => {
4 | await page.goto("http://localhost:8080");
> 5 | await page.locator("#theForceIsStrongWithThisOne").click({ timeout: 3000 });
| ^
6 | });
at c:\Users\DannyCrone\repos\click-repro\tests\repro.spec.ts:5:54This project contains a repro website to test against and 1 test
- website is in the folder "website"
- test is called "repro" in "repro.spec.ts"
In order to run the website so it renders the page correctly, I used http-server using the following command:
http-server website -c-1Also included it as an npm script:
"scripts": {
"start": "http-server website -c-1"
},Attached are the traces from chromium (failing) and webkit (passing):
chromiumtrace.zip
webkittrace.zip
Activity
gauravgandhi1315 commentedon Jan 5, 2023
Danny Crone (@dannycrone) I tried your website and the code below works for me. Instead of
clickuse this:I used selector
#theForceIsStrongWithThisOnedannycrone commentedon Jan 5, 2023
GG (@gauravgandhi1315), thanks for that, we already have workarounds which are:
But neither of these nor yours actually perform the mouse click which is what we would prefer (if that makes sense?).
gauravgandhi1315 commentedon Jan 5, 2023
Danny Crone (@dannycrone) ok, but it worked for me in my local.
mxschmitt commentedon Jan 5, 2023
I was able to create a minimal repro out of it:
mxschmitt commentedon Jan 5, 2023
Turns out this is a duplicate of #7642, folding into it.
For now we recommend await page.locator("#foobar").evaluate(element => element.click());
dannycrone commentedon Jan 6, 2023
Max Schmitt (@mxschmitt), great detective work! and while #7642 is closed and not fixed, it leads me to have a conversation with the dev team about replacing zoom with transform, so thank you :)
Bump @playwright/test from 1.49.1 to 1.63.0 to test whether it reduce…