Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically setting baseUrl with TestConfigOverrides #22072

Closed
PepijnSenders opened this issue Jun 3, 2022 · 5 comments · Fixed by #22445
Closed

Dynamically setting baseUrl with TestConfigOverrides #22072

PepijnSenders opened this issue Jun 3, 2022 · 5 comments · Fixed by #22445
Labels
type: bug type: typings Issue related to Cypress types (for TypeScript) v10.0.0 🐛 Issue present since 10.0.0

Comments

@PepijnSenders
Copy link

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

interface TestConfigOverrides extends Partial<Pick<ConfigOptions, 'animationDistanceThreshold' | 'blockHosts' | 'defaultCommandTimeout' | 'env' | 'execTimeout' | 'includeShadowDom' | 'numTestsKeptInMemory' | 'pageLoadTimeout' | 'redirectionLimit' | 'requestTimeout' | 'responseTimeout' | 'retries' | 'screenshotOnRunFailure' | 'slowTestThreshold' | 'scrollBehavior' | 'taskTimeout' | 'viewportHeight' | 'viewportWidth' | 'waitForAnimations' | 'experimentalSessionAndOrigin'>> {

Cypress Version

10.0.2

Other

No response

@jennifer-shehane jennifer-shehane added v10.0.0 🐛 Issue present since 10.0.0 type: typings Issue related to Cypress types (for TypeScript) stage: ready for work The issue is reproducible and in scope labels Jun 3, 2022
@cypress-bot cypress-bot bot added stage: investigating Someone from Cypress is looking into this and removed stage: ready for work The issue is reproducible and in scope labels Jun 3, 2022
@mschile
Copy link
Contributor

mschile commented Jun 3, 2022

The baseUrl option was removed with #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?

@cypress-bot cypress-bot bot added stage: awaiting response Potential fix was proposed; awaiting response and removed stage: investigating Someone from Cypress is looking into this labels Jun 3, 2022
@cypress-bot cypress-bot bot added stage: fire watch and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jun 6, 2022
@mjhenkes mjhenkes added stage: awaiting response Potential fix was proposed; awaiting response E2E-core and removed stage: routed to e2e-core labels Jun 6, 2022
@cypress-bot cypress-bot bot added stage: backlog and removed stage: awaiting response Potential fix was proposed; awaiting response labels Jun 6, 2022
@jennifer-shehane
Copy link
Member

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.

@PepijnSenders
Copy link
Author

@jennifer-shehane @mschile what's the status on this? We still need to add baseUrl to the type.

@mschile
Copy link
Contributor

mschile commented Jun 24, 2022

@PepijnSenders, there is a PR open to fix this issue #22445. Once that PR merges it will go in the next release.

@cypress-bot cypress-bot bot added stage: needs review The PR code is done & tested, needs review and removed stage: backlog labels Jun 27, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 28, 2022

Released in 10.3.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.3.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: needs review The PR code is done & tested, needs review label Jun 28, 2022
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug type: typings Issue related to Cypress types (for TypeScript) v10.0.0 🐛 Issue present since 10.0.0
Projects
None yet
4 participants