-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: Use real mouse events with Chromium in the shell #21419
test: Use real mouse events with Chromium in the shell #21419
Conversation
18e9f45
to
1ce54dd
Compare
First attempt had many random pixel failures due to the mouse being in a random place and highlighting UI elements. Plus the HostSwitching regression. With moving the mouse away it looks better -- networking and storage pass, and some other and expensive failures. |
1ce54dd
to
abd3b3f
Compare
Now it's down to host switcher failures, the rest passes. This is due to the animations -- see that utterly compressed menu in the screenshot. We need to wait for that to settle. |
abd3b3f
to
7ba1bd2
Compare
The precise combination of affected retries here brings back this tracer crash (second instance). While that's unrelated, it makes this PR unbecomingly red, looking. Handled by cockpit-project/bots#7210 |
You can't open the session menu to log out while the dialog is still open. That cheat only works with our Chromium test driver which directly inserts `MouseEvent`s. We are about to move these to real clicks.
Replace the static sleep with a polling loop.
Opening the host switcher and the host edit view animates (expands) the hosts menu for about half a second. When doing real clicks instead of MouseEvent injection, this causes the target elements to move around underneath the test, resulting in mis-clicks. Avoid that by waiting for the animation to be over. Unfortunately `ph_count_animations()` doesn't quite catch it completely in all cases, so add an extra sleep for robustness. This is similar to what we do in the pixel tests.
BiDi mouse events work fine on the top-level document (i.e. not in frames). So let's use them to test the shell. Generalize the "move mouse position to a harmless place" hack from commit b5b8c6d, so that we make the pixel snapshots without focusing a random element on the page. We can also run `TestPages.testPageStatus` again (reverts commit 529e334). This just needs one little tweak in TestHostSwitching.testBasic's pixel test. Our current reference does not expect any dialog item to be highlighted (when the mouse is over it), so move the mouse out of the dialog.
7ba1bd2
to
c7bdffc
Compare
Looking good! This is a known flake, I sent cockpit-project/bots#7211 to fix it. This failure is an unrelated known flaky pixel test, #21422 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
BiDi mouse events work fine on the top-level document (i.e. not in frames). So let's use them to test the shell.