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

Cypress.config() does not return the complete configuration #509

Closed
andreaazzara opened this issue May 24, 2017 · 3 comments
Closed

Cypress.config() does not return the complete configuration #509

andreaazzara opened this issue May 24, 2017 · 3 comments
Labels
pkg/driver This is due to an issue in the packages/driver directory type: enhancement Requested enhancement of existing feature
Milestone

Comments

@andreaazzara
Copy link

  • Operating System: macOS Sierra
  • Cypress Version: 0.19.2
  • Browser/Browser Version: Chrome 58

Are you requesting a feature or reporting a bug?

Possible bug

Current behavior:

My cypress.json is

{
  "projectId": "myId",
  "watchForFileChanges": false,
  "fileServerFolder": "www",
  "viewportWidth": 320,
  "viewportHeight": 568,
  "numTestsKeptInMemory": 5,
  "trashAssetsBeforeHeadlessRuns": false,
  "videoRecording": false,
  "defaultCommandTimeout": 30000,
  "pageLoadTimeout": 30000,
  "fixturesFolder": "/Users/some-custom-folder"
}

but Cypress.config() returns:

{
    "isHeadless": false,
    "numTestsKeptInMemory": 5,
    "waitForAnimations": true,
    "animationDistanceThreshold": 5,
    "defaultCommandTimeout": 30000,
    "pageLoadTimeout": 30000,
    "requestTimeout": 5000,
    "responseTimeout": 30000,
    "xhrUrl": "__cypress/xhrs/",
    "baseUrl": null,
    "viewportWidth": 320,
    "viewportHeight": 568,
    "execTimeout": 60000,
    "screenshotOnHeadlessFailure": true,
    "namespace": "__cypress"
}

where some keys are missing (fixturesFolder, videoRecording...)

@brian-mann
Copy link
Member

You are right, Cypress.config() does not return the whole set of configuration.

This is because we generally only provide you the mutable configuration that you can change at runtime (in the browser).

Something like fixturesFolder is not present because its static and cannot be dynamically changed. Even if we were to provide you the values, changing them in the browser at runtime would have no effect.

When Cypress boots up, the internal server interacts with these values and is not built to expect them to change.

@andreaazzara
Copy link
Author

I see, However accessing fixturesFolder variable (even if read-only) could be useful (for example to be used with cy.readFile. Maybe Cypress.config() could return all the env variables and trying to set a read-only one could throw an error.

@jennifer-shehane jennifer-shehane added pkg/driver This is due to an issue in the packages/driver directory type: enhancement Requested enhancement of existing feature labels May 25, 2017
@brian-mann brian-mann added this to the 1.2.0 milestone Dec 12, 2017
@brian-mann
Copy link
Member

Released in 1.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg/driver This is due to an issue in the packages/driver directory type: enhancement Requested enhancement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants