Can waitForResponse take a promise instead of function or url?
See original GitHub issueTell us about your environment:
- Puppeteer version: 1.14
- Platform / OS version: Windows
- Node.js version: 10
What steps will reproduce the problem?
try to pass a promise to await page.waitForResponse(response => condition)
instead of urlOrPredicate
.
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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:7 (3 by maintainers)
Top Results From Across the Web
page.click function does not wait till page.waitForResponse ...
I would try the page.waitForNavigation() in your Promise.all() as mentioned in the docs for page.click() .
Read more >Async and Await in JavaScript, the extension to a promise.
An async function simply implies that a promise will be returned and if a promise is not ... You cannot use the await...
Read more >Puppeteer documentation - DevDocs
Puppeteer 7.1.0 API documentation with instant search, offline support, keyboard shortcuts, mobile version, and more.
Read more >How to make JavaScript wait for a API request to return?
If no value is returned, it wraps the promise and resumes the normal execution. Await: It is used to wait for a promise...
Read more >How to wait for and intercept a particular HTTP request in ...
Use a promise to wait for the correct HTTP response (remove the await ... don't wait for waitForResponse, but continue by omitting await...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello Everyone, If you are an Appium tester and want to showcase your skills, here is an amazing opportunity for you! MOZARK’s online global app testing contest- QAppathon is now live! The contest is free to register, all you need to do is: • Sign up to MOZARK QAppAssure • Write an Appium script to measure the Home page load time of your app. • Run the script on at least 10 devices across the QAppAssure device cloud. • Ensure a minimum of 50 test runs. • Send in the logs and a brief description of your test methodology to aquamark-support@mozark.ai The first 10 testers to successfully complete the challenge will get an Amazon gift voucher worth INR 5k and MOZARK cloud vouchers worth INR 10k!
Register Now and be a MOZARK certified Appium tester
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’…