Questions tagged [cypress-intercept]
111 questions
1
vote
2 answers
Waiting for an intercepted request is not working as expected
I need to check the status of the email verification token changed after verifying the email.
First I create a user, then I get the email verification URL sent to the user and finally access this link.
When accessing the app link, it sends the auth…

Matheus Toniolli
- 438
- 1
- 7
- 16
1
vote
2 answers
Cypress intercept all image requests with regex url
I want to intercept all image GET requests and check if they have 200 status code. My try so far.
cy.intercept({ method: 'GET' , url:…

Erenn
- 625
- 6
- 18
1
vote
1 answer
How can I assert query params in cypress using form data?
I am testing search functionality in one of my Cypress tests and having trouble getting to all parts of the request url. On my page, I have a form that a user can enter a number to search for. When a user clicks "Search", the system makes an ajax…

Damon
- 4,151
- 13
- 52
- 108
1
vote
1 answer
Get canceled request with cypress
I'm looking for a way to expect a canceled request with cypress. Any idea? :)
I cancel the previous requests if the user sends too many requests and I want to test it.
I tried to intercept POST requests with the alias, counted requests,...

Dogma Plowx
- 13
- 3
1
vote
2 answers
How to validate json in payload for a specific url in network calls in cypress
In Network Calls we have a request url https://xyz.com.testqa.com/site/v3/userPref/
There is a different tab for payload where i want to validate action id in below json
c: 5232
d: {noticeId: 32029, companyId: 5232, actionId: 11, regulationId: 2,…

Manish B
- 389
- 1
- 4
- 19
1
vote
2 answers
How to wait for children to be greater than X in Cypress
I'm writing a test for a page, that loads the content via an AJAX-call. Here is the events:
Step 1: Page loads
Step 2: AJAX-call fetches content
Step 3: AJAX-call retrieves status 200
Step 4: X seconds passes
Step 5: Content is displayed on the…

Zeth
- 2,273
- 4
- 43
- 91
1
vote
2 answers
How to modify a fixture and intercept a response with the modified fixture
I am trying to modify an existing fixture and then override a response with the modified fixture.
I'm able to override the response with predefined fixture or modify the actual response, but I cant do them both at the same time.
For example the…

Nikolay Zotev
- 11
- 1
1
vote
1 answer
Cypress intercept does not match route with status 204
I am implementing cypress tests in our Angular application and have a problem waiting for a request to finish. I am guessing it has to do with the status of the Request being 204 instead of 200.
This is the function/command I am calling in my…

PhilipAllStar
- 120
- 1
- 9
1
vote
1 answer
[cypress]How to check that request has not been sent
I need to check that after the second click on the same button, an HTTP request is not sent. Is there a way to do it? I've already tried intercept and wait for this purpose, but can't make it work

YevS
- 11
- 2
1
vote
2 answers
Why does not cypress alias work on Github CI?
I have a problem in github ci, it cannot find the alias, and think it even doesn't define that, but all is well on local. I tested on both cypress:open and cypress:run
this is the command I defiend:
Cypress.Commands.add("byPassLogin", () => {
…

Hamid Shoja
- 3,838
- 4
- 30
- 45
1
vote
1 answer
Cypress test - Do not intercept api request
I need to test some pages on a project and this project do some APIs call to external services.
I need to make sure that these calls are made and check if my page change accordingly to the response.
This is my test:
describe('A logged in user', ()…

Christian Giupponi
- 7,408
- 11
- 68
- 113
1
vote
1 answer
Cypress - Passing fixture alias to intercept method in version 9 and above
Could someone please help me with passing fixture alias to intercept method in Cypress v 9.0. I remember using the following syntax in Cypress ~4 with route method as
cy.route("GET", "**/users/*", "@users") where @users is a fixture defined as…

shashank hr
- 23
- 6
1
vote
2 answers
Cypress Intercept, refining url
I'm intercepting a request with Cypress and I'm trying not to hardcode something. To make it work correctly, I have to add a "1" since I'm trying to intercept something like this:
/api/v1/contacts/cfs:12345/forms/144543
The problem is that there…

Ignis Abbot
- 73
- 5
0
votes
1 answer
cy.intercept() in a loop till response of API call has expected value
I'm trying to intercept API call which is autorefreshed each 10s by using cy.intercept() in a loop. The loop should break when the status is set to "completed". Unfortunately cy.intercept() is called only once, I tried to debug it and I can see in…

deanthe
- 35
- 1
- 1
- 6
0
votes
0 answers
How can I call cloud functions (Firebase) to my cypress tests?
I'm working on e2e testing on cypress.
During generating user account details, I need to switch to admin mode from user mode to accept the request of account details request.
I want to switch user between the test. We're using firebase.
I've tried…