can't resolve 404-error.cypress-component-test Vue3 in bitbucket-pipeline

44 views Asked by At

application summary

  • cypress v13.6.3
  • vue v3.1.0

I am trying to create a CI environment that creates component tests in cypress and automatically runs the tests each time they are pushed to bitbucket.

In the local environment, it works fine, but when I run the test on bitbucket-pipeline, I get a 404 error. enter image description here

The error occurs in the process of getting data from the API. The process of acquiring data from the API is to intercept and return mock data as shown in the code below.

// test.cy.ts
cy.intercept('GET', '/api/v1/test*',{fixture:'test/test.json' }).as('test') // 
cy.wait('@test')

The flow to obtain data is as follows.

exec fetch(Test.vue)ー>Vuex action ー> client axios get ー> Vuex mutation ー>Test.vue get Data

# bitbucket-pipeline.yml
    - step:
        name: Test
        image: cypress/base:14.16.0
        caches:
          - node
        script:
          - npm ci
          - npm run test

I tried Debug pipelines locally with Docker. But It worked properly. https://ja.confluence.atlassian.com/bitbucket/debug-your-pipelines-locally-with-docker-838273569.html

I tried script below.

  • cypress run --browser chrome --headless →404 error
  • start-server-and-test start http://localhost:8080 cypress run --component
0

There are 0 answers