test(modal): change click to mouse down in flaky test#6131
Closed
TomJGooding wants to merge 1 commit into
Closed
Conversation
`test_modal_pop_screen()` is apparently still flaky in CI even after increasing the pauses in #6116. Try changing the Footer `click` to `mouse_down` instead to avoid the `NoWidget` error in the pilot mouse events.
willmcgugan
reviewed
Sep 28, 2025
| await app.wait_for_refresh() | ||
| # Check clicking the footer brings up the quit screen | ||
| await pilot.click(Footer) | ||
| await pilot.mouse_down(Footer) |
Member
There was a problem hiding this comment.
Doesn't this change the nature of the test significantly? IIRC a click occurs on mouse up.
Member
There was a problem hiding this comment.
Scratch that. I see that the Footer reacts to MouseDown, not Click.
Member
|
I'm hoping that #6137 will provide a better solution to avoiding jank in the footer that doesn't introduce flakiness to the tests. |
Member
|
I think #6137 resolves this. |
Contributor
Author
|
My thinking is that the |
Contributor
Author
|
@willmcgugan Since this still doesn't look fixed, can I suggest at least trying this? [EDIT: Exploring this in new PR #6142] async with app.run_test() as pilot:
# Pause to ensure the footer is fully composed to avoid flakiness in CI
await pilot.pause(0.4)
await app.wait_for_refresh()
# Check clicking the footer brings up the quit screen
footer_key_clicked = await pilot.mouse_down("FooterKey")
assert footer_key_clicked is True # Sanity check
await pilot.pause()
assert isinstance(pilot.app.screen, QuitScreen) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_modal_pop_screen()is apparently still flaky in CI even after increasing the pauses in #6116.Try changing the Footer
clicktomouse_downinstead to avoid theNoWidgeterror in the pilot mouse events.Please review the following checklist.