Skip to content
4 changes: 2 additions & 2 deletions source/api/commands/exec.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cy.exec('npm run build')

**{% fa fa-angle-right %} command** ***(String)***

The system command to be executed from the project root (the directory that contains `cypress.json`).
The system command to be executed from the project root (the directory that contains the default `cypress.json` configuration file).

**{% fa fa-angle-right %} options** ***(Object)***

Expand Down Expand Up @@ -156,7 +156,7 @@ A command must exit within the `execTimeout` or Cypress will kill the command's

# Command Log

***List the contents of cypress.json***
***List the contents of the default `cypress.json` configuration file***

```javascript
if (Cypress.platform === 'win32') {
Expand Down
4 changes: 2 additions & 2 deletions source/api/commands/readfile.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ cy.readFile('menu.json')

**{% fa fa-angle-right %} filePath** ***(String)***

A path to a file within the project root (the directory that contains `cypress.json`).
A path to a file within the project root (the directory that contains the default `cypress.json` configuration file).

**{% fa fa-angle-right %} encoding** ***(String)***

Expand Down Expand Up @@ -192,7 +192,7 @@ cy.readFile('some/nested/path/story.txt').should('eq', 'Once upon a time...')

# Command Log

***List the contents of cypress.json***
***List the contents of the default `cypress.json` configuration file***

```javascript
cy.readFile('cypress.json')
Expand Down
3 changes: 1 addition & 2 deletions source/api/commands/request.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ cy.visit('http://localhost:8080/app')
cy.request('users/1.json') // url is http://localhost:8080/users/1.json
```

2. If you make a `cy.request()` prior to visiting a page, Cypress uses the host configured as the `baseUrl` property inside of `cypress.json`.
2. If you make a `cy.request()` prior to visiting a page, Cypress uses the host configured as the `baseUrl` property inside of of your {% url "configuration file" configuration %}.

```json
// cypress.json

{
"baseUrl": "http://localhost:1234"
}
Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/task.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ If multiple task objects use the same key, the later registration will overwrite

# Command Log

***List the contents of `cypress.json`***
### List the contents of the default `cypress.json` configuration file

```javascript
cy.task('readJson', 'cypress.json')
Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/viewport.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ When hovering over each command, Cypress will automatically display the snapshot

By default, until you issue a `cy.viewport()` command, Cypress sets the width to `1000px` and the height to `660px` by default.

You can {% url 'change these default dimensions' configuration#Viewport %} by adding the following to your `cypress.json`:
You can {% url 'change these default dimensions' configuration#Viewport %} by adding the following to your configuration file (`cypress.json` by default):

```json
{
Expand Down
6 changes: 3 additions & 3 deletions source/api/commands/visit.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ cy.visit('127.0.0.1:3000') // Visits http://127.0.0.1:3000

### Cypress can optionally act as your web server

Cypress will automatically attempt to serve your files if you don't provide a host. The path should be relative to your project's root folder (where `cypress.json` is located).
Cypress will automatically attempt to serve your files if you don't provide a host. The path should be relative to your project's root folder (where the `cypress.json` file is generated by default).

Having Cypress serve your files is useful in simple projects and example apps, but isn't recommended for real apps. It is always better to run your own server and provide the url to Cypress.

Expand All @@ -222,9 +222,9 @@ cy.visit('app/index.html')

## Prefixes

### Visit is automatically prefixed with `baseUrl`.
### Visit is automatically prefixed with `baseUrl`

Configure `baseUrl` in the `cypress.json` file to prevent repeating yourself in every single `cy.visit()` command. Read more about {% url 'configuration' configuration %}.
Configure `baseUrl` in the your {% url 'configuration' configuration %} file (`cypress.json` by default) to prevent repeating yourself in every `cy.visit()` command.

```json
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/commands/writefile.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cy.writeFile('menu.json')

**{% fa fa-angle-right %} filePath** ***(String)***

A path to a file within the project root (the directory that contains `cypress.json`).
A path to a file within the project root (the directory that contains the default `cypress.json`).

**{% fa fa-angle-right %} contents** ***(String, Array, or Object)***

Expand Down
8 changes: 4 additions & 4 deletions source/api/cypress-api/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Set multiple configuration options with an object literal.

## No Arguments

### Get all configuration options
### Get all configuration options from {% url 'configuration' configuration %} file (`cypress.json` by default)

```json
{
Expand All @@ -62,7 +62,7 @@ Cypress.config() // => {defaultCommandTimeout: 10000, pageLoadTimeout: 30000, ..

## Name

### Return just a single configuration option value
### Return a single configuration option from {% url 'configuration' configuration %} file (`cypress.json` by default)

```json
{
Expand All @@ -76,7 +76,7 @@ Cypress.config('pageLoadTimeout') // => 60000

## Name and Value

### Change the values of your configuration options from within tests
### Change the values of configuration options from configuration file (`cypress.json` by default) from within your tests

{% note warning Scope %}
Remember, any changes that you make to configuration using this API will only be in effect for the remainder of the tests _in the same spec file._
Expand All @@ -97,7 +97,7 @@ Cypress.config('viewportWidth') // => 800

## Object

### Set multiple values by passing an object literal
### Override multiple options from configuration file (`cypress.json` by default) by passing an object literal

```json
{
Expand Down
2 changes: 1 addition & 1 deletion source/api/cypress-api/custom-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ Cypress.Commands.overwrite('visit', (originalFn, url, options) => {
{% note info %}
We see many of our users creating their own `visitApp` command. We commonly see that all you're doing is swapping out base urls for `development` vs `production` environments.

This is usually unnecessary because Cypress is already configured to swap out baseUrl's that both `cy.visit()` and `cy.request()` use. Just set the `baseUrl` config property in `cypress.json` and override it with environment variable `CYPRESS_BASE_URL`.
This is usually unnecessary because Cypress is already configured to swap out baseUrl's that both `cy.visit()` and `cy.request()` use. Set the `baseUrl` configuration property in your {% url "configuration" configuration %} file (`cypress.json` by default) and override it with environment variable `CYPRESS_BASE_URL`.

For more complex use cases feel free to overwrite existing commands.
{% endnote %}
Expand Down
24 changes: 11 additions & 13 deletions source/api/cypress-api/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ Set multiple environment variables with an object literal.

## No Arguments

**Get all environment variables.**
### Get all environment variables from configuration file (`cypress.json` by default)

```javascript
// cypress.json
```json
{
"env": {
"foo": "bar",
Expand All @@ -59,10 +58,9 @@ Cypress.env() // => {foo: "bar", baz: "quux"}

## Name

**Return a single environment variable value.**
### Return a single environment variable from configuration file (`cypress.json` by default)

```javascript
// cypress.json
```json
{
"env": {
"foo": "bar",
Expand All @@ -78,14 +76,13 @@ Cypress.env('baz') // => quux

## Name and Value

**Cypress allows you to change the values of your environment variables from within your tests.**
### Change environment variables from configuration file (`cypress.json` by default) from within your tests

{% note warning Scope %}
Remember, any changes that you make to environment variables using this API will only be in effect for the remainder of the tests _in the same spec file._
{% endnote %}

```javascript
// cypress.json
```json
{
"env": {
"foo": "bar",
Expand All @@ -102,7 +99,7 @@ Cypress.env('host') // => http://server.dev.local

## Object

**You can set multiple values by passing an object literal.**
### Override multiple values from configuration file (`cypress.json` by default) by passing an object literal.

```javascript
// cypress.json
Expand Down Expand Up @@ -140,6 +137,7 @@ module.exports = (on, config) => {
return config
}
```

```js
// cypress/integration/secrets_spec.js
describe('Environment variable set in plugin', () => {
Expand All @@ -158,17 +156,17 @@ describe('Environment variable set in plugin', () => {

# Notes

**Why would I ever need to use environment variables?**
## Why would I ever need to use environment variables?

The {% url 'Environment Variables' environment-variables %} guide explains common use cases.

**Can I pass in environment variables from the command line?**
## Can I pass in environment variables from the command line?

Yes. You can do that and much more.

The {% url 'Environment Variables' environment-variables %} guide explains the other ways you can set environment variables for your tests.

**Why is it `Cypress.env` and not `cy.env`?**
## Why is it `Cypress.env` and not `cy.env`?

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

Expand Down
2 changes: 1 addition & 1 deletion source/examples/examples/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ Recipe | Description
{% url 'Visual Regression Testing' https://github.com/mjhea0/cypress-visual-regression %} | Adding visual regression testing to Cypress
{% url 'Code coverage' https://github.com/paulfalgout/cypress-coverage-example %} | Cypress with Coverage reports
{% url 'Cucumber' https://github.com/TheBrainFamily/cypress-cucumber-example %} | Example usage of Cypress with Cucumber
{% url 'Jest' https://github.com/TheBrainFamily/jest-runner-cypress-example %} | Example for the jest-runner-cypress
{% url 'Jest' https://github.com/TheBrainFamily/jest-runner-cypress-example %} | Example for the jest-runner-cypress
6 changes: 3 additions & 3 deletions source/faq/questions/using-cypress-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,11 @@ Yes, you can pass configuration to Cypress via environment variables, CLI argume

## {% fa fa-angle-right %} Can I override or change the default user agent the browser uses?

Yes. {% url "You can override this with `userAgent` in `cypress.json`." configuration#Browser %}
Yes. {% url "You can override this with `userAgent` in your configuration file (`cypress.json` by default)." configuration#Browser %}

## {% fa fa-angle-right %} Can I block traffic going to specific domains? I want to block Google Analytics or other providers.

Yes. {% url "You can set this with `blacklistHosts` in `cypress.json`." configuration#Browser %}
Yes. {% url "You can set this with `blacklistHosts` in your configuration file (`cypress.json` by default)." configuration#Browser %}

Also, check out our {% url 'Stubbing Google Analytics Recipe' recipes#Stubbing-and-spying %}.

Expand Down Expand Up @@ -336,7 +336,7 @@ It is possible to upload files in your application but it's different based on h

## {% fa fa-angle-right %} What is the projectId for?

The `projectId` is a 6 character string that helps identify your project once you've {% url "set up your tests to record" runs %}. It's generated by Cypress and typically is found in your {% url `cypress.json` configuration %} file.
The `projectId` is a 6 character string that helps identify your project once you've {% url "set up your tests to record" runs %}. It's generated by Cypress and typically is found in your {% url "configuration file (`cypress.json` by default)" configuration %} file.

```json
{
Expand Down
16 changes: 8 additions & 8 deletions source/guides/core-concepts/writing-and-organizing-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ After adding a new project, Cypress will automatically scaffold out a suggested
- index.js
```

***Configuring Folder Structure***
## Configuring Folder Structure

While Cypress allows to configure where your tests, fixtures, and support files are located, if you're starting your first project, we recommend you use the above structure.

You can modify the folder configuration in your `cypress.json`. See {% url 'configuration' configuration#Folders-Files %} for more detail.
You can modify the folder configuration in your configuration file. See {% url 'configuration' configuration#Folders-Files %} for more detail.

{% note info "What files should I add to my '.gitignore file' ?" %}
Cypress will create a {% url `screenshotsFolder` configuration#Screenshots %} and a {% url `videosFolder` configuration#Videos %} to store the screenshots and videos taken during the testing of your application. Many users will opt to add these folders to their `.gitignore` file. Additionally, if you are storing sensitive environment variables in your `cypress.json` or {% url `cypress.env.json` environment-variables#Option-2-cypress-env-json %}, these should also be ignored when you check into source control.
Cypress will create a {% url `screenshotsFolder` configuration#Screenshots %} and a {% url `videosFolder` configuration#Videos %} to store the screenshots and videos taken during the testing of your application. Many users will opt to add these folders to their `.gitignore` file. Additionally, if you are storing sensitive environment variables in your configuration file (`cypress.json` by default) or {% url `cypress.env.json` environment-variables#Option-2-cypress-env-json %}, these should also be ignored when you check into source control.
{% endnote %}

## Fixture Files
Expand Down Expand Up @@ -335,14 +335,14 @@ Remember to use {% url `.only` writing-and-organizing-tests#Excluding-and-Includ

### Files

- {% url `cypress.json` configuration %}
- {% url `cypress.env.json` environment-variables %}
- {% url "Configuration file (`cypress.json`) by default" configuration %}
- {% url "`cypress.env.json`" environment-variables %}

### Folders

- `cypress/integration/`
- `cypress/support/`
- `cypress/plugins/`
- Integration directory (`cypress/integration/` by default)
- Support directory (`cypress/support/` by default)
- Plugins directory (`cypress/plugins/` by default)

The folder, the files within the folder, and all child folders and their files (recursively) are watched.

Expand Down
4 changes: 2 additions & 2 deletions source/guides/getting-started/testing-your-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ If you've started your server, then you should see your application loaded and w

If you think ahead, you'll quickly realize that you're going to be typing this URL a lot, since every test is going to need to visit some page of your application. Luckily, Cypress provides a {% url "configuration option" configuration %} for this. Let's leverage that now.

Open up `cypress.json`, which you will find in your project root (where you installed Cypress.) It starts out empty:
Open up your {% url "configuration file" configuration %} (`cypress.json` in your project directory, by default) It starts out empty:

```json
{}
Expand All @@ -113,7 +113,7 @@ Let's add the `baseUrl` option.
This will automatically **prefix** {% url `cy.visit()` visit %} and {% url `cy.request()` request %} commands with this baseUrl.

{% note info %}
Whenever you modify `cypress.json`, Cypress will automatically reboot itself and kill any open browsers. This is normal. Just click on the spec file again to relaunch the browser.
Whenever you modify your configuration file, Cypress will automatically reboot itself and kill any open browsers. This is normal. Just click on the spec file again to relaunch the browser.
{% endnote %}

We can now visit a relative path and omit the hostname and port.
Expand Down
Loading