-
Notifications
You must be signed in to change notification settings - Fork 240
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
[Feature] Allow async predicates for RunAndWaitFor methods #2576
Comments
I have created a PR for this: #2577 |
We strongly try to avoid breaking changes. Would calling Could you share code which demonstrates the issue you are trying to solve? |
Let's assume this kind of snippet:
The |
The more high level question which I wanted to ask was, what data from the Response object do you try to access in PageRunAndWaitForRequestFinished? In this example its just Request.Url and Request.Method which seems already working fine for your use-case? |
I haven't been precise enough. We need to additionally access StatusCode in the Predicate. |
So I've created an additional PR for possibly less breaking effect: |
But I don't like that solution, even for compatibilities sake. |
Instead of coming up with new APIs or PRs, lets first try to understand the actual problem better. Could you please share more information what you are trying to do? For what kind of network requests do you wait for, what triggers it, is it a normal navigation or after some page interaction like click? Would Would it be possible to share a minimal reproduction which shows whats not working? |
The requests/responses are triggered by a normal application operation. The app is somewhat talkative, and it does some async requests for new data. I hope it is intelligible. Awaiting all the questions and suggestions. I'd like to contribute good code :) |
Sorry for the late response, was out of office.
This sounds like web-first assertions should just work for you.
I was looking at Node.js, and how we do it there. Turns out, there we have async predicate support. So we would be more than happy to make the predicate async as well in the RunAndWaitFor methods, e.g. here. Are you fine if I change this issue title accordingly to that? |
Of course. Be my guest. |
Given RequestFinished events already contain
Response
object it would be more flexible for thePredicate<T>
that is passed by options ofRunAndWaitForRequestFinished
(andWaitForRequestFinished
) methods to use theIReponse
object instead ofIRequest
.I can make the changes in code-base but I'd like to discuss architecture here - before committing to these changes.
The text was updated successfully, but these errors were encountered: