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

Use local files for testing ui.interactive_image #3118

Merged
merged 1 commit into from
May 24, 2024
Merged

Conversation

falkoschindler
Copy link
Contributor

This PR tries to fix our flaky pytests for ui.interactive_image. It seems like most failures came from fetching dummy images from a remote server, which could even block requests with a rate limit. Therefore I replaced those images with locally served copies.

I also overloaded the screen.wait_for method to allow waiting for a condition. This is handy when waiting for events in test_loaded_event.

Furthermore I noticed a minor bug in screen.should_not_contain:

self.selenium.implicitly_wait(wait)
with pytest.raises(AssertionError):
    self.find(text)
self.selenium.implicitly_wait(self.IMPLICIT_WAIT)

In case pytest.raises itself raised, the implicit wait hasn't been set back to IMPLICIT_WAIT. I fixed it with a try-finally block.

@falkoschindler falkoschindler requested a review from rodja May 23, 2024 08:42
@falkoschindler falkoschindler added the enhancement New feature or request label May 23, 2024
@falkoschindler falkoschindler added this to the 1.4.26 milestone May 23, 2024
Copy link
Member

@rodja rodja left a comment

Choose a reason for hiding this comment

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

Great!

@rodja rodja merged commit 061242c into main May 24, 2024
7 checks passed
@rodja rodja deleted the interactive-image-test branch May 24, 2024 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants