Skip to content

Throw error when trying to set Cypress.config() for non-mutable config values #3422

@jennifer-shehane

Description

@jennifer-shehane

Current behavior:

When trying to set Cypress.config() for non-mutable configurations which are ignored from inside of the tests, Cypress does not perform the action as expected and does not throw an error.

Example:

The test below passes, but Cypress does not indeed change the location of the screenshotsFolder, nor does it throw an error telling you that the screenshotsFolder was not set.

it('screenshots folder not settable', () => {
  Cypress.config('screenshotsFolder', 'cypress/screenshots/desktop')
  expect(Cypress.config('screenshotsFolder')).to.eq('cypress/screenshots/desktop')
  cy.screenshot('homepage_desktop')
})

Actual saved screenshot location

screen shot 2019-02-11 at 11 52 28 am

Related issues:

Desired behavior:

  • Cypress should throw an error when trying to set non-mutable configuration values.
  • Make list of all config values that are mutable vs non-mutable. Maybe add to documentation.

Versions

Cypress 3.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions