Hi, I am trying to do an e2e test on my VueJS app...
# e2e-testing
w
Hi, I am trying to do an e2e test on my VueJS app that uses axios for API calls. In my vue component, in the mounted, i do an API call. My idea would be to mock this call with
cy.intercept
and
cy.wait
, however i can't make it work. On my local environment when i launch my frontend and backend servers, my test passes as the API call is made. However, the call is not silenced and the
cy.wait('@apiCall')
does not work. Also my test does not work in Github Actions, i have this error :
AxiosError: The following error originated from your application code, not from Cypress. It was caused by an unhandled promise rejection.
. I have the impression that github actions need a special ci environment file but i don't know where to tell cypress to look into those env variables when in continous integration. Anyone had the same issue or knows about cypress X axios X github actions combined ? Some of my code :
test.cy.js
Copy code
cy.intercept('GET', '/coaches/coach-informations/30283', {
            data: {
                email: 'hello@hello.com',
            },
        }).as('getCoach')

 cy.visit('/hello?coach=30283')

cy.wait('@getCoach')