Relative Content

Tag Archive for cypresscypress-intercept

Cypress cannot intercept network request for external js file

I’m working on a testing project where I use Cypress. I would like to intercept a network request for a javascript file and make a small change before I send the response back to the application. When I run my cypress test file (UI mode), I can see in the browser dev tools that the network request is made successfully.

Cypress – Matching a query with a wildcard or regex

Consider the below code to intercept an API call. It checks if query parameter cliendId = 36. I want to make this code only consider the query param clientId and NOT its value of 36. So, I tried to use “*” instead of ’36’ and it did not work. I could not find the answer in existing stack overflow questions. How do I make cypress only intercept based on the query param name and not its value ?

Getting Page-load Timeouts when running cypress tests

When I run cypress test I am getting Page load timeout at the end of the test and even after increasing the timeout to 40000 I am still getting the error.I dont know if it’s because the test is long or what might be the cause.

Cypress – Make assertions before letting the interception return the fixture

Situation I am working on a page which has a form. When the button in the form is clicked, a request is sent to the backend and the page changes to show that it’s performing the operation (a progress bar appears, the background color changes, the button is disabled). When the response arrives, the changes […]