I am trying to run my cypress tests when building a project through Travis CI. I am installing cypress fine, however, I was then getting the following error:
I have looked online and in cypress official documentation and the method that they recommend fixing this issue by adding the following into my package.json:
"test:ci": "start-server-and-test http://localhost:3000 cy:run"
cy:run
in this case being cypress run
. However, when I run this, it does build the server however it then does not seem to run the tests afterwards. It just freezes on the build.
I then call this script within my travis.yml
file as shown:
- npm run test:ci
I also have the following as my before_install and install object:
before_install:
- npm i -g npm@5
- npm i -g firebase-tools
- npm i -g @angular/cli
- npm cache verify
install:
- npm i
- npm ci
To clarify - the desired results is that when running Cypress through Travis, the local server (my baseUrl) is run and then the tests are carried out.