Repository navigation
test: make keyboard tests more reliable - #3659
Conversation
|
Kudos, SonarCloud Quality Gate passed!
|
| * @param {HTMLElement} overlayContent | ||
| */ | ||
| export async function waitForScrollToFinish(overlayContent) { | ||
| if (overlayContent._targetPosition) { |
There was a problem hiding this comment.
note: Didn't find any straightforward way of determining if the overlay content is scrolling except for using a protected property. Alternatively, it could check for the scroll events, but that would lead to a more complicated solution in the end.
There was a problem hiding this comment.
Seems reasonable. Introducing a private API like isScrolling, and adding tests for that would also be an option, though adding APIs just for tests is not ideal as well.
web-padawan
left a comment
There was a problem hiding this comment.
LGTM. Thanks a lot for fixing these tests 🙇♂️
|
This ticket/PR has been released with Vaadin 23.1.0.alpha2 and is also targeting the upcoming stable 23.1.0 version. |








Description
It was discovered that sometimes
await sendKeys(...)resolves after thescroll-animation-finishedevent is fired which results in date-picker test failures because they were written with the assumption that the event will be always fired before.The reason is likely related to the implementation of
sendKeys. There is no guarantee that the returned promise will resolve exactly at the moment you expect. It can take longer under some circumstances.This PR attempts to deal with such test failures by introducing a
waitForScrollToFinishtest helper that doesn't wait if the scroll has already finished.Part of #3538
Type of change
Checklist