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

Added a note to config.md re: some values cannot be changed at run-time. #1681

Merged
merged 3 commits into from
May 15, 2019
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion source/api/cypress-api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ Configuration set using `Cypress.config` _is only in scope for the current spec
Cypress runs each spec file in isolation: the browser is exited between specs. Configuration changed in one spec won't be visible in other specs.
{% endnote %}

{% note warning Note %}
Not all configuration values can be changed during runtime. See {% urlHash Notes #Notes %} below for details.
{% endnote %}


# Syntax

```javascript
Expand Down Expand Up @@ -122,7 +127,11 @@ Cypress.config() // => {defaultCommandTimeout: 10000, viewportHeight: 900, ...}

# Notes

**Why is it `Cypress.config` and not `cy.config`?**
## Not all config values can be changed at all times

Some configuration values cannot be changed while running a test. Anything that's not directly under Cypress's control - like timeouts, `userAgent`, or environment variables - will be ignored at run-time.

## Why is it `Cypress.config` and not `cy.config`?

As a rule of thumb anything you call from `Cypress` affects global state. Anything you call from `cy` affects local state.

Expand Down