HI all, I am getting this error when running my tests against the local host-net::ERR_CONNECTION_REFUSED at http://172.19.0.3:3001/ error when trying to run tests against localhost
I can see that the server is started based on this output in the previous to running the tests step
Connecting to 172.19.0.3:3001… connected.
HTTP request sent, awaiting response… 200 OK
But then I get this error when trying to run my tests against the localhost net::ERR_CONNECTION_REFUSED at http://172.19.0.3:3001/
Also, I am not using docker
Any idea why is this happening?
Hi @alexkyrylenkoproven ,
Although I’m not sure at all if it’s related to the issue you’re having, I noticed a slight difference.
You mention that the previous step before running the tests says:
Connecting to 172.19.0.3:3002... connected
However, the error you’re getting references another port:
net::ERR_CONNECTION_REFUSED at http://172.19.0.3:3001/
Could this be a misconfiguration of your tests?
thank you @yannCI - you were correct I was trying to call on a wrong port. However, after switching to the correct port, I am still getting this error - net::ERR_CONNECTION_REFUSED at http://192.168.192.3:3002
this is the part of the yml file that starts the server and runs the tests:
steps:
- install-deps:
after-install-deps:
- run:
name: starting node server
command: mkdir logs && npm run start | tee logs/node_server.log
background: true
- run:
name: storing local IP address
command: node -p "require('ip').address()" > logs/ip.log
- run:
name: waiting for node server to start
command: wget --retry-connrefused --waitretry=2 -t 5 "http://$(cat logs/ip.log):3002" > /dev/null
- run: npx playwright install --with-deps
- run: npm run test:ui:ci
- store_artifacts:
path: ./playwright-report
destination: artifacts
And then, the base url is set like baseURL: http://${require('ip').address()}:3002
Blockquote