'Pipeline failed

I am trying to run cypress test scripts on Gitlab CICD Pipeline but this error occured enter image description here

Here is my code on gitlab-ci.yml file

image: docker:18.09
stages:
  - test

test:
  stage: test
  script:
    - npm install
    - npm run test


Solution 1:[1]

Cypress provide some custom docker image to use to avoid dependencies issues. You can check for them here cypress docker images

I also faced many weird issues with the implementation of a cypress job to run in CI. In order to not reinvent the wheel, you can use the cypress run job I shared in this opensource community hu for CI/CD jobs.It's customizable, you just need to include the job url in your pipeline and override some little varaiables, as mentioned in the related documentation of the job.

You should have something like that:

include:
   - remote: 'https://api.r2devops.io/job/r/r2devops-bot/cypress_run/latest.yaml'
cypress_run:
   variables:
       BASE_URL: '<your_server_url>

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 Guy NANA