How to don't wait for new page to load when wait and intercept an API response #15849
Unanswered
szanelato
asked this question in
Questions and Help
Replies: 2 comments 4 replies
-
So you are trying to confirm the page loads BUT do not want to wait for the entire body of the page to load? The server is responding with the page, that's the slow part, not the load after that in the browser. |
Beta Was this translation helpful? Give feedback.
4 replies
-
hi @szanelato szanelato, have you find the solution ?? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm facing with a behavior that's messing my assertions and my tests is failing.
I'm intercepting a API call and gave him a alias so at some point in my code I'm waiting for this alias and intercepting the POST call to validate the http status code and a value from a specific path inside the response body.
The problem is: I don't ask to wait for a new page to load and Cypress is waiting for that. In my CI environment the page that I'm getting the redirect in this scenario is too slow, so I do this by intercept the request to validate the response instead wait for redirect and assert the redirection url.
The question is: how can I verify what I want inside a API response without wait for a new page to load?
I decided to use Cypress instead Selenium because of the Cypress cy.wait() and cy.intercept() features for verify responses from API calls instead to wait a page to load. I'm desapointed to be stucked in the same problem that I have using Selenium.
My code:
Beta Was this translation helpful? Give feedback.
All reactions