https://cypress.io logo
Cypress fails to verify that server is running
# i-need-help
v
Hi everyone! I am trying to setup Cypress in our GitLab CI pipeline. Changes of a merge request should get deployed to a QA server and then Cypress tests should run against it. The
BASE_URL
is set correctly to the servers address. For the CI job I am using the
cypress/included
(
cypress/browsers
also works) image. I install npm dependencies and run cypress with
cypress run --e2e
via npm script. However Cypress fails to verify that the server is running. I can confirm that the QA server is running and accessible all the time. I attached a screenshot with the relevant GitLab CI job output (sensitive info blurred). The input also shows that that pinging the server before running Cypress is successful. The QA server is only accessible via VPN. Since the container can also ping the server it also should be able to access it. Running the command locally (with VPN enabled) works like a charm. How can I get Cypress to verify that the server is available?

https://cdn.discordapp.com/attachments/1099955930977808444/1099955931128791091/CleanShot_2023-04-24_at_08.46.072x.png

m
Hi @victorious-salesclerk-78076 `ping`may not give you the full picture. Did you try testing with
curl
with something like
curl -I https://qa-server
? Which version of Cypress are you running?
If
curl
does not help, then setting
DEBUG=cypress:*
as an environment variable may give you more information to help debug.
v
Hi @many-airline-45402. You were right
ping
does not show the full picture. I got mislead by it. Tried it with
curl
and indeed the page can not be accessed from within the container. So this is not a Cypress issue but more of a networking issue. Just to confirm with you: To access pages behind VPN I need to use
HTTP_PROXY
, correct?
m
Good to hear you made some progress! I'll have to pass on the VPN question. Hopefully somebody else will be able to jump in on that question.
v
I will play around a bit create a new post if I do not succeed. Huge thanks for getting me on the right path 🙏 🙂