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

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

Closed
2 tasks
jennifer-shehane opened this issue Feb 11, 2019 · 3 comments
Closed
2 tasks
Labels
type: duplicate This issue or pull request already exists

Comments

@jennifer-shehane
Copy link
Member

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

@jennifer-shehane jennifer-shehane added type: unexpected behavior User expected result, but got another pkg/driver This is due to an issue in the packages/driver directory difficulty: 1️⃣ labels Feb 11, 2019
@cypress-bot cypress-bot bot added the stage: needs information Not enough info to reproduce the issue label Feb 11, 2019
@cypress-bot cypress-bot bot added stage: backlog and removed stage: needs information Not enough info to reproduce the issue labels Feb 11, 2019
@aurium
Copy link

aurium commented Oct 15, 2019

Hi, i want to solve this issue.

I console.loged the extended state inside set() at setter_getter.coffee and the screenshotsFolder value was updated in it (as expected) using Cypress.config in a test. How can i know which key it can or can't change?

@aurium

This comment has been minimized.

@jennifer-shehane
Copy link
Member Author

jennifer-shehane commented Aug 3, 2020

Closing as Duplicate of #6407

@jennifer-shehane jennifer-shehane added type: duplicate This issue or pull request already exists and removed difficulty: 1️⃣ pkg/driver This is due to an issue in the packages/driver directory stage: ready for work The issue is reproducible and in scope type: unexpected behavior User expected result, but got another labels Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants