I'm trying to run my Cypress tests using Github Actions. I have everything set up but I have a problem with baseURL variable which is set during GitubActions process and then passed to Cypress. In my case it is an ip and port address to the server on which the tested application will be running (it can be running on different servers). This baseURL is then used to check if the server is running and also it is used in tests as a URL for API requests. The problem is that I need to send some API requests to an address with different port number. I think my problem would be solved if one of the following things would be possible:
- Cypress would skip verifying if server configured as baseURL is running
- I could change (slice) baseURL once server verification is over (either during Github Actions process or in Cypress code)
Does anyone know if one of the things above is possible and if so how to do it?
I've tried to search how to skip cypress server verification or change baseURL passed from GithubActions process to Cypress but I couldn't find an answer
The details of your test are missing, but three things you can do wrt to this are
change
baseUrlanywhere in the test suite withCypress.config('baseUrl', newUrl)omit
baseUrlfromcypress.config.jsto skip the server checkuse
envsection of config to set the API url (fully qualified) to stopcy.request()usingbaseUrlREF: request
baseUrl in YML
If you're doing something like this (from Cypress' repo example)
don't do that either.
As I mentioned already, set the
baseUrlonly after the test suite has started - that will avoid the error on server check.