Can we disable baseUrl from the command line
See original GitHub issueCypress v4.8.0
Imagine we have cypress.json
with baseUrl
(and lots of other settings)
{
"baseUrl": "http://localhost:5005"
}
We want to run component tests, they don’t require baseUrl
, but attempting to run them hits the base URL check
Cypress could not verify that this server is running:
> http://localhost:5005
We are verifying this server because it has been configured as your `baseUrl`.
Cypress automatically waits until your server is accessible before running tests.
We will try connecting to it 3 more times...
We will try connecting to it 2 more times...
We will try connecting to it 1 more time...
Cypress failed to verify that your server is running.
Please start this server and then run Cypress again.
I can try blanking baseUrl
using CLI but
$ yarn cypress:run --spec 'src/**/*_spec.jsx' --config baseUrl=
yarn run v1.22.4
$ cross-env TZ=America/New_York node ../../scripts/cypress run --project . --spec 'src/**/*_spec.jsx' --config baseUrl=
We found an invalid configuration value:
Expected `baseUrl` to be a fully qualified URL (starting with `http://` or `https://`). Instead the value was: `""`
I tried disabling it using false
like some other settings allow, but no success
$ yarn cypress:run --spec 'src/**/*_spec.jsx' --config baseUrl=false
yarn run v1.22.4
$ cross-env TZ=America/New_York node ../../scripts/cypress run --project . --spec 'src/**/*_spec.jsx' --config baseUrl=false
We found an invalid configuration value:
Expected `baseUrl` to be a fully qualified URL (starting with `http://` or `https://`). Instead the value was: `false`
Proposal
Allow ignoring baseUrl
by using --config baseUrl=false
to override cypress.json
value
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:6 (2 by maintainers)
Top Results From Across the Web
How to change the baseUrl via command line with Cypress
Learn a simple technique to perform automated tests in different environments, overwriting the Cypress configuration.
Read more >In Playwright, how to pass a baseUrl via command line so my ...
Currently, in Playwright Test v1. 12.0 there is no baseUrl property as we have in Protractor. But you can accomplish it with a...
Read more >Configuration - Cypress Documentation
When running Cypress from the command line you can pass a --config flag to override individual config options. For example, to override viewportWidth...
Read more >Magento 2: change the base-url using the command line
Can happen that the above command doesn't works as expected and you still have some url pointing to the old base-url . In...
Read more >passing baseUrl from gradle commandline - Google Groups
baseUrl")). } You can also use project properties instead of system properties when passing the build url from the command line to save...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@timharsch Have you tried the new Component Testing in Cypress 7.0? There’s a separate run command now for component tests,
cypress run-ct
, that should address confusion between e2e and component tests.Try to unset the Cypress variable : $ unset CYPRESS_baseUrl you will no longer have this test done : Cypress could not verify that this server is running Then you can use baseUrl at cypress.json or even add some more variables to prefix your cy.visit()