Skip to content
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

Fix Out of Bounds error during testing. #447

Merged
merged 2 commits into from
Dec 6, 2024
Merged

Conversation

JoeZiminski
Copy link
Member

@JoeZiminski JoeZiminski commented Dec 5, 2024

Often in testing we were getting errors like:

FAILED test_tui_create_folders.py::TestTuiCreateFolders::test_create_folders_formatted_names - textual.pilot.OutOfBounds: Target offset is outside of currently-visible screen region.

This is due to the screen not being large enough, as discussed here. They provided the very useful information that there is a function app.save_screenshot() that allows you to see the state of the screen at the test time.

It turned out at the issue (in this case) was that when clicking onto the project selector screen, it was completely blank. This led the terminal size of shrink and nothing was clicked on when the app tried to click on the project name.

The issue was that I forgot to add pilot.pause() after the call to click on the project selector screen

 await pilot.click("#mainwindow_existing_project_button")

so the test was moving directly onto the next step (clicking the project button) before the screen had loaded.

[EDIT]

Also, this fixed a case I found where forgot to add assert to a check. It was just easier to include on this PR.

@JoeZiminski
Copy link
Member Author

Hey @niksirbi tests are failing because all PRs tests are failing in different ways 😆 we can merge this one next and I'll rebase the other PRs onto main and hopefully the situation will be resolved!

@JoeZiminski JoeZiminski requested a review from niksirbi December 5, 2024 18:53
@JoeZiminski
Copy link
Member Author

actually scratch that, I saw you approved the others cheers! we can just merge them all and things should be fixed

@JoeZiminski JoeZiminski force-pushed the fix_out_of_bounds_errors branch from be140da to 5b02877 Compare December 5, 2024 18:59
Copy link
Member

@niksirbi niksirbi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job hunting down this one, and a very satisfying 1-line fix.

@JoeZiminski JoeZiminski merged commit aa588c1 into main Dec 6, 2024
16 checks passed
@JoeZiminski JoeZiminski deleted the fix_out_of_bounds_errors branch December 6, 2024 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants