Open muhqu opened 2 weeks ago
What is your use-case for hover
with trial: true
?
The issue with trial: true
in click for keydown
events is definitely valid, but there can be scenarios that the target element e.g. changes / disappears / remounts on keydown events, hence having a semantically correct trial
. In order to not have a potential regression there and break users we would hold back for now.
My usecase for hover with trial was that I was trying solve a timing issue with the regular hover in our application. The problematic scenario is that on hover over a card an overlay with a button appears. Here locator.hover() fails as it tries to validate that the element under the mouse is still the card but it fails as the overlay intercepts the pointer events… (which might be a bug on its own)
I wanted to use hover({ force:true }) as it skips that check, but then I need to wait until the element is ready to be hoverable… that’s why I wanted to use trial with hover.
It doesn’t have to be fixed by changing the behavior… it’s also okay to simply adjust the documentation.
Version
1.47.1
Steps to reproduce
npm install
npx playwright test
Expected behavior
locator.click({ trial: true })
click
event.locator.hover({ trial: true })
mouseover
event.locator.click({ trial: true, modifiers: ['Shift'] })
click
eventkeydown
eventActual behavior
locator.click({ trial: true })
click
event.locator.hover({ trial: true })
mouseover
event.locator.click({ trial: true, modifiers: ['Shift'] })
click
event.keydown
eventAdditional context
The documentation for
trial
option…As the action should be skipped, I would assume that no mousover events should be triggered.
Environment