-
Notifications
You must be signed in to change notification settings - Fork 593
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
Quick proposal to fix .wait method #742
base: main
Are you sure you want to change the base?
Quick proposal to fix .wait method #742
Conversation
@JustasL makes more sense to extend extension Async {
func delay(by timeInterval: TimeInterval) -> Async<Value> {
return Async<Value> { callback in
self.run { value in
DispatchQueue.main.asyncAfter(deadline: .now() + timeInterval) {
callback(value)
}
}
}
}
} then you can chain: addImagesForRenderedViews(view).sequence().delay(by: 1.0).run { views in |
@JustasL can you make amends to bring in these changes? markst@029c66a Also make it clear to mention that this delay needs to occur between presentation to window |
@markst updated PR, although was not sure where to put comment about:
|
SwiftUI View does not work also with wait strategy, and requires this workaround here
And i confirm that adding this delay solves it with SwiftUI |
Thanks @JustasL, the new .delay function solved my issue when a view required to load mock network data on @stephencelis possible to take a look this PR? Thanks. |
Is there any timeline for fixing it? The problem affects our test workflows |
We are currently putting our tests to Sleep in order to wait for loading to finish, would be helpful if this fix would get released :) |
Thanks @JustasL for this workaround. I can confirm that works in our SwiftUI views too. |
@stephencelis, would you mind taking a peek at this? I'd hate to have to fork the project just to pull this 🙃 |
Hello! Thank you in advance! |
Hi! |
@stephencelis is it posible to merge this fix? |
Also waiting for a fix on this, what is the status? |
Can we get an ETA on this fix ? :) |
As mentioned in this issue
Snapshotting.wait
does not workUIViewController
ifview
property is not accessedFrom quick debugging it seems it's because view is created, then snapshotting waits for delay period, and only then it setups views and quickly disposes them
My proposed work-a-round is to actually delays test assertion from being ran