I have my code set up like this
1. await page.click(selectors.login.submit)
2. await page.waitForNavigation({waitUntil:'networkidle0'})
3. await page.click(selectors.transation.navLink)
4. await page.waitForResponse(response => response.ok())
5. await page.click(selectors.transation.addNew)
Here, line 5 does not wait till line 4 completes all the response.
I have already tried using
Promise.all([
page.click(selectors.transation.navLink)
await page.waitForResponse(response => response.ok())
])
thinking that all the scripts inside promise executes first before going to line 5 but due to some reason it just doesn't happens as it supposed to happen.
I even tried using the await page.waitForNavigation({waitUntil:'networkidle0'}) instead of await page.waitForResponse(response => response.ok()) thinking that would help but it acts exactly as same
The expected result should be executing the page.waitfor function first, let all the request complete and then go on the page.click function.
Aucun commentaire:
Enregistrer un commentaire