Cypress provides two options to override the configuration while
the tests are running -
suite-specific or test-specific configuration overrides.
Before version 9.2.0, it was not documented which config options are readonly and which ones are writable at the runtime, which created a lot of confusion.
If we were to change screenshotsFolder during test using
The test mentioned above passes, but Cypress does not change the location of the screenshotsFolder, nor does it throw an error telling that the screenshotsFolder was not set.
Cypress will throw an error when a user attempts to set these
non-writable config values using
If we wanted to change screenshotsFolder during test now using
The above test run will throw a validation error mentioning it is a read-only property.
List of config options which ‘can’ be updated on runtime
List of config options which ‘cannot’ be updated and are ‘read-only’ on runtime
- autoOpen (internal)
- clientRoute (internal)
- configFile (internal)
- devServerPublicPathRoute (internal)
- morgan (internal)
- namespace (internal)
- reporterRoute (internal)
- socketId (internal)
- socketIoCookie (internal)
- socketIoRoute (internal)
- xhrRoute (internal)
To know more about this, check out the PR and Cypress-Documentation.