question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we disable baseUrl from the command line

See original GitHub issue

Cypress 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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
jennifer-shehanecommented, Apr 26, 2021

@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.

1reaction
ConfiDevelopercommented, Dec 30, 2020

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()

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found