Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upCan waitForResponse take a promise instead of function or url? #4323
Comments
This comment has been minimized.
This comment has been minimized.
|
@techsin why do you need to return a promise? Can you share an example? |
This comment has been minimized.
This comment has been minimized.
|
i wanted to do response.text() which returns a promise. I wanted to return true or false based on what's inside text(). can't wait for promise to be resolved if original function isn't promise based. eventually had to go with page.on('response'....
|
This comment has been minimized.
This comment has been minimized.
|
there is no way to do this for example
|
This comment has been minimized.
This comment has been minimized.
|
@techsin Well, that's very fair! |
This comment has been minimized.
This comment has been minimized.
|
Any update on this? What about...
|
This comment has been minimized.
This comment has been minimized.
|
@aslushnikov I would love to give this one a try. It would be great if you could guide me (files to work upon) as I'm new to the code-base. |
Tell us about your environment:
What steps will reproduce the problem?
try to pass a promise to
await page.waitForResponse(response => condition)instead ofurlOrPredicate.What is the expected result?
expect async function to work
What happens instead?
no waiting as promise gets eval to truthy.
response object has text method which is a promise to use that i need callback to be promise as well.. but if i make callback to be promise it breaks the waitForResponse function