https://cypress.io logo
Hi, I am facing a problem when trying to intercep...
# e2e-testing
r
Hi, I am facing a problem when trying to intercept api calls. I have already searched the internet, but I somehow don't understand. I am new to cypress and I am using cypress10 within a react app where a express server runs next to it. The e2e test works locally but on Github Actions CI, I have the following problem: The intercepted request
/rpc/dags/int
is not found. Here a log from my server docker container. I noticed that there is no statusCode for the request and in the video, the request never resolves and timeouts as "No request occured". I am not sure if this happens becase the express server has a middleware on this route or not. Other API calls on the server worked, like
/fire/auth/sign
Copy code
(another request before, worked)
 request http: #######  Server API Request #######
 request http: OPTIONS /fire/auth/sign 204

 request http: #######  Server API Request #######
 request http: POST /fire/auth/sign 200

 (the failing request)
 request http: #######  Server API Request #######
 request http: POST /rpc/dags/int -
I am doing a: in before:
Copy code
cy.intercept({
      method: "POST",
      path: "/rpc/dags/int",
    }).as("trigger")
in the body:
Copy code
cy.wait("@trigger").then(({ response }) => {
        expect(response.statusCode).to.eq(200)
})
But somehow the intercepted call is not found. Maybe someone knows the issue. Locally the request resolves:
Copy code
request http: ####### Server API Request #######
request http: POST /rpc/dags/int 200
I am not sure what's wrong, I have boot up the same environment as in github actions. Best, Minh