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

Timeout Error During Snapshot Testing with WKWebView #805

Open
stephan-vivie-rb opened this issue Nov 8, 2023 · 3 comments
Open

Timeout Error During Snapshot Testing with WKWebView #805

stephan-vivie-rb opened this issue Nov 8, 2023 · 3 comments

Comments

@stephan-vivie-rb
Copy link

Environment

  • Xcode Version: 15.0.1
  • Swift Version: 5.9
  • SnapshotTesting Version: 1.14.0
  • iOS Version: 17.0.1
  • Devices/Emulators: iPhone 15 iOS 17.0.1

Description

We are experiencing a timeout error when performing snapshot tests on a UIViewController which contains a WKWebView. Our tests consistently fail with the following error message:

failed - Exceeded timeout of 5.0 seconds waiting for snapshot.

This can happen when an asynchronously rendered view (like a web view) has not loaded. Ensure that every subview of the view hierarchy has loaded to avoid timeouts, or, if a timeout is unavoidable, consider setting the "timeout" parameter of "assertSnapshot" to a higher value.

I have tried to increase the timeout but that doesn't help.

Is there a recommended approach for ensuring the WKWebView has fully rendered before the snapshot is taken? If that's not possible. It would be great just to be able to run the snapshot tests on the rest of the screen as the content of the WKWebView is out of our hands anyway, but the other elements on screen are not.

@haemi
Copy link

haemi commented Nov 8, 2024

did you find a solution for this? I'm experiencing the same

@pewkachu
Copy link

yay, at least I'm not alone with this 🎉

@stephan-vivie-rb
Copy link
Author

did you find a solution for this? I'm experiencing the same

Unfortunately not.

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

No branches or pull requests

3 participants