Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Can waitForResponse take a promise instead of function or url? #4323
Comments
|
@techsin why do you need to return a promise? Can you share an example? |
|
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'....
|
|
there is no way to do this for example
|
|
@techsin Well, that's very fair! |
|
Any update on this? What about...
|
|
@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. |
|
Hello Everyone, Register Now and be a MOZARK certified Appium tester |
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