'Cypress run on Gitlab CI/CD always failed but work properly on local run using Chrome image & node

I have configured my cypress test in the GitLab CI/CD pipeline, However, in my local environment, it runs perfectly with no errors, however, when the pipeline job runs, only 2 specs are successful and the rest are in errors.

Cypress version: 7.7.0

Chrome version: 97

Running mode: headless

Here are the parameters of my file

dev_e2e_test:
  image: cypress/browsers:node16.5.0-chrome97-ff96
  stage: test-e2e
  when: always
  script:
    - echo "Starting cypress test"
    - cd client/cypress-automation/cypress
    - npm install cypress
    - npm run testEndToEnd
    paths:
      - node_modules/
    expire_in: 1 day

I don't know if anyone has ever seen this error? thank you for your help



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source