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.

Dynamically setting baseUrl with `TestConfigOverrides`

See original GitHub issue

Current behavior

In v9 we were able to set the baseUrl but it has disappeared from the TestConfigOverrides type.

Desired behavior

Add the e2e key to the TestConfigOverrides type.

Test code to reproduce

https://github.com/cypress-io/cypress/blob/e6b2466f7b219a86da46c1ac720432ef75193ca4/cli/types/cypress.d.ts#L3006

Cypress Version

10.0.2

Other

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jennifer-shehanecommented, Jun 8, 2022

We want to support setting baseUrl at the root level in the testConfigOverrides, as we always know at this point which testing type we’re in.

1reaction
mschilecommented, Jun 3, 2022

The baseUrl option was removed with https://github.com/cypress-io/cypress/pull/20589. However, it is still listed as a test configuration option in the docs.

Setting the baseUrl at the root succeeds:

  it('should visit', { baseUrl: 'http://127.0.0.1:8080' }, () => {
    cy.visit('/')
  })
Screen Shot 2022-06-03 at 4 36 19 PM

However, setting baseUrl within e2e fails:

  it('should visit', { e2e: { baseUrl: 'http://127.0.0.1:8080' }}, () => {
    cy.visit('/')
  })
Screen Shot 2022-06-03 at 4 32 40 PM

@estrada9166, do you know if we are intending to support baseUrl at the root level or within e2e for the per-test configuration?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dynamically set baseUrl in cypress.json - Stack Overflow
I have a laravel app and have brought in Cypress testing. In my cypress.json file I have the baseUrl value set to a...
Read more >
Configuration - Cypress Documentation
This guide is for Cypress 10 and the new JavaScript configuration file format. If you are on an older version of Cypress that...
Read more >
How can I change the baseUrl in Cypress dynamically?
we can change baseUrl dynamically by passing baseUrl in command line. This is how baseurl is defined in cypress.json file
Read more >
rouch/Cypress: Fast, easy and reliable testing for anything that runs ...
... scripts/support; package-lock.json; binary-url.json; # Allows us to dynamically create eslint rules that override the default for Decaffeinate scripts ...
Read more >
Dynamic Multiple Base URL with Annotations | Android
Now we need a flag to manipulate base urls for each retrofit call. We can define an annotation class and set it to...
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