I’m trying to get cypress testing running in our pipeline to test the server. Though cypress can’t seam to find the local server that I just started. Here’s my scripts / setup. I’ve also tried the cypress circlci-orb and get the same error, so was trying run things myself to help debug. Here’s the script details:
- run:
name: 'Run app tests'
command: |
cd app
yarn install --frozen-lockfile
yarn lint
yarn cypress:ci
Package.json
"cypress:ci": "CYPRESS_BASE_URL=http://localhost:3000 yarn start & wait-on http-get://localhost:3000 && cypress run"
Startup & Error:
$ craco start
ℹ 「wds」: Project is running at http://192.168.208.3/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /root/project/app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...
.....
react startup output...
......
We attempted to make an http request to this URL but the request failed without a response.
We received this error at the network level:
> Error: connect ECONNREFUSED 127.0.0.1:3000
What I know:
- The server starts, and its confirmed available
wait-on
package - Cypress tests run locally on machine completely fine with this command
What could be the problem:
- Is cypress being spun up in a separate js context for some reason?
- Are there permissions issues around accessing this port? (grasping a straws with this one)
I’ve spent a day or so spinning my wheels on this and I’m completely stumped atm. Anyone done something like this prior? We specifically want integration testing in our pipeline to prevent broken builds from being merged. Not after. Though it seams like most will test an external server after its deployed. There could be a world were we spin up a temporary external server to handle this, but really want to avoid that headache.
Thanks for any of yalls thoughts/insights.