Skip to content

Commit 73d805d

Browse files
more minor changes to pages
1 parent c62054f commit 73d805d

File tree

8 files changed

+32
-33
lines changed

8 files changed

+32
-33
lines changed

source/api/commands/screenshot.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
title: screenshot
3-
43
---
54

65
Take a screenshot of the application under test and, optionally, the {% url "Cypress Command Log" test-runner#Command-Log %}.
@@ -42,15 +41,15 @@ Pass in an options object to change the default behavior of `.screenshot()`.
4241

4342
Option |Default | Description
4443
--- | --- | ---
45-
`log` | `true` | {% usage_options log %}
4644
`blackout` | `[]` | Array of string selectors used to match elements that should be blacked out when the screenshot is taken. Does not apply to `runner` captures.
4745
`capture` | `'fullPage'` | Which parts of the Test Runner to capture. This value is ignored for element screenshot captures. Valid values are `viewport`, `fullPage`, or `runner`. When `viewport`, the application under test is captured in the current viewport. When `fullPage`, the application under test is captured in its entirety from top to bottom. When `runner`, the entire browser viewport, including the Cypress Command Log, is captured. For screenshots automatically taken on test failure, capture is always coerced to `runner`.
4846
`clip` | `null` | Position and dimensions (in pixels) used to crop the final screenshot image. Should have the following shape: `{ x: 0, y: 0, width: 100, height: 100 }`
4947
`disableTimersAndAnimations` | `true`| When true, prevents JavaScript timers (`setTimeout`, `setInterval`, etc) and CSS animations from running while the screenshot is taken.
50-
`scale` | `false` | Whether to scale the app to fit into the browser viewport. This is always coerced to `true` when `capture` is `runner`.
51-
`timeout` | {% url `responseTimeout` configuration#Timeouts %} | {% usage_options timeout .screenshot %}
48+
`log` | `true` | {% usage_options log %}
5249
`onBeforeScreenshot` | `null` | A callback before a (non-failure) screenshot is taken. For an element capture, the argument is the element being captured. For other screenshots, the argument is the `$el`.
5350
`onAfterScreenshot` | `null` | A callback after a (non-failure) screenshot is taken. For an element capture, the first argument is the element being captured. For other screenshots, the first argument is the `$el`. The second argument is properties concerning the screenshot, including the path it was saved to and the dimensions of the saved screenshot.
51+
`scale` | `false` | Whether to scale the app to fit into the browser viewport. This is always coerced to `true` when `capture` is `runner`.
52+
`timeout` | {% url `responseTimeout` configuration#Timeouts %} | {% usage_options timeout .screenshot %}
5453

5554
For more details on these options and to set some as defaults across all uses of `.screenshot()`, see the {% url 'Cypress.Screenshot API doc' screenshot-api %}.
5655

source/api/events/configuration-event.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ Whenever you return an object from your `backgroundFile`, Cypress will take this
4141

4242
If you don't return an object, then configuration will not be modified.
4343

44-
Resolved values will show up in your Settings tab.
44+
Resolved values will show up in your Settings tab in the Test Runner.
4545

4646
{% img /img/guides/background-configuration.png %}
4747

@@ -69,7 +69,7 @@ module.exports = (on, config) => {
6969
}
7070
```
7171

72-
You could now swap out configuration + environment variables like so:
72+
You could now swap out configuration and environment variables like so:
7373

7474
```shell
7575
cypress run

source/api/events/file-preprocessor-event.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: file:preprocessor Event
33
---
44

5-
The `file:preprocessor` event allows you to modify how your spec files and support file are preprocessed for the browser.
5+
The `file:preprocessor` event allows you to modify how your spec files and support files are preprocessed for the browser.
66

77
A preprocessor is the plugin responsible for preparing a {% url "support file" writing-and-organizing-tests#Support-file %} or a {% url "test file" writing-and-organizing-tests#Test-files %} for the browser.
88

@@ -16,7 +16,7 @@ Occurs only in the {% url "background process" background-process %}.
1616

1717
# Examples
1818

19-
We've created three preprocessors as examples for you to look at. These are fully functioning preprocessors.
19+
We've have three preprocessors as examples. These are fully functioning preprocessors.
2020

2121
The code contains comments that explain how it utilizes the preprocessor API.
2222

@@ -26,7 +26,7 @@ The code contains comments that explain how it utilizes the preprocessor API.
2626

2727
# Recipes
2828

29-
We've also added some recipes showing how to utilize these preprocessors.
29+
We've also have some recipes showing how to utilize these preprocessors.
3030

3131
Here are two recipes using both webpack and browserify to write your tests in TypeScript.
3232

@@ -46,9 +46,7 @@ The Browserify Preprocessor handles:
4646

4747
The exact default configuration options {% url 'can be found here' https://github.com/cypress-io/cypress-browserify-preprocessor#browserifyoptions %}.
4848

49-
{% note info %}
50-
Are you looking to change the **default options** for Browserify?
51-
{% endnote %}
49+
{% note info "Are you looking to change the default options for Browserify?" %}
5250

5351
Changing the Browserify options lets you:
5452

@@ -57,10 +55,11 @@ Changing the Browserify options lets you:
5755
- Add support for CoffeeScript `2.x.x`
5856

5957
Please read this link in the {% url 'browserify preprocessor' https://github.com/cypress-io/cypress-browserify-preprocessor#modifying-default-options %} repo for instructions on modifying these.
58+
{% endnote %}
6059

6160
# Usage
6261

63-
To use a preprocessor, you should bind to the `file:preprocessor` event in your {% url "`backgroundFile`" configuration#Folders-Files %}:
62+
To use a preprocessor, you should bind to the `file:preprocessor` event in your {% url "`backgroundFile`" configuration#Folders-Files %}.
6463

6564
```javascript
6665
// background file
@@ -82,7 +81,8 @@ module.exports = (on, config) => {
8281

8382
> \*\* The built file is the file that is created by the preprocessor that will eventually be served to the browser.
8483
85-
> If, for example, the source file is `spec.coffee`, the preprocessor should:
84+
If, for example, the source file is `spec.coffee`, the preprocessor should:
85+
8686
1. Compile the CoffeeScript into JavaScript `spec.js`
8787
2. Write that JavaScript file to disk (example: `/Users/foo/tmp/spec.js`)
8888
3. Resolve with the absolute path to that file: `/Users/foo/tmp/spec.js`
@@ -114,7 +114,6 @@ The `file` object passed to the callback function is an {% url "Event Emitter" h
114114
When the running spec, the project, or the browser is closed while running tests, the `close` event will be emitted. The preprocessor should do any necessary cleanup in this function, like closing the watcher when watching.
115115

116116
```javascript
117-
// example
118117
const watcher = fs.watch(filePath, /* ... */)
119118

120119
file.on('close', () => {
@@ -127,7 +126,6 @@ file.on('close', () => {
127126
If watching for file changes, emit `rerun` after a file has finished being processed to let Cypress know to rerun the tests.
128127

129128
```javascript
130-
// example
131129
fs.watch(filePath, () => {
132130
file.emit('rerun')
133131
})
@@ -147,4 +145,4 @@ Use the following npm keywords:
147145
]
148146
```
149147

150-
Feel free to submit your published plugins to our {% url "list of plugins" plugins %}.
148+
Feel free to submit your published plugin to our {% url "list of plugins" plugins %}.

source/guides/core-concepts/writing-and-organizing-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ To start writing tests for your app, simply create a new file like `app_spec.js`
9393

9494
## Background file
9595

96-
Cypress runs a background Node.js process that you can utilize via the the background file (`cypress/background/index.js` by default).
96+
Cypress runs a background Node.js process that you can utilize via the the {% url "background file" configuration#Folders-Files %} (`cypress/background/index.js` by default).
9797

9898
{% url "Read more about using the background process to extend Cypress behavior." background-process %}
9999

source/guides/references/configuration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Option | Default | Description
5050
`fileServerFolder` | root project folder |Path to folder where application files will attempt to be served from
5151
`fixturesFolder` | `cypress/fixtures` | Path to folder containing fixture files (Pass `false` to disable)
5252
`integrationFolder` | `cypress/integration` | Path to folder containing integration test files
53-
`backgroundFile` | `cypress/background/index.js` | Path to background file. (Pass `false` to disable)
53+
`backgroundFile` | `cypress/background/index.js` | Path to {% url "background file" background-process %}. (Pass `false` to disable)
5454
`screenshotsFolder` | `cypress/screenshots` | Path to folder where screenshots will be saved from {% url `cy.screenshot()` screenshot %} command or after a test fails during `cypress run`
5555
`supportFile` | `cypress/support/index.js` | Path to file to load before test files load. This file is compiled and bundled. (Pass `false` to disable)
5656
`videosFolder` | `cypress/videos` | Path to folder where videos will be saved during `cypress run`
@@ -123,9 +123,9 @@ cypress run --record --config viewportWidth=1280,viewportHeight=720
123123

124124
## Background Process
125125

126-
As of {% url `1.2.0` changelog#1-2-0 %} you can programmatically modify configuration values using Node.js code via the {% url "background process" background-process %}. This enables you to do things like use `fs` and read off configuration values and dynamically change them.
126+
As of {% url `1.2.0` changelog#1-2-0 %} you can programmatically modify configuration values using Node.js code via the {% url "background process" background-process %}. This enables you to do things like use `fs` or read and dynamically change configuration values.
127127

128-
While this may take a bit more work than other options - it yields you the most amount of flexibility and the ability to manage configuration however you'd like.
128+
While this may take a bit more work than other options - it yields you the most amount of flexibility to manage configuration however you'd like.
129129

130130
{% url "We've fully documented how to do this here." configuration-event %}
131131

source/guides/references/error-messages.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,4 +526,4 @@ This error likely appeared because:
526526

527527
WIP. We'll be adding more here soon.
528528

529-
For now, please view the {% url 'details on the `uncaught-exception` event' uncaught-exception-event %} for examples how to turn off catching uncaught exceptions.
529+
For now, please view the {% url 'details on the `uncaught-exception` event' uncaught-exception-event %} for examples on how to turn off catching uncaught exceptions.

source/guides/references/migration-guide.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ title: Migration Guide
66

77
## pluginsFile renamed to backgroundFile
88

9-
The `pluginsFile` configuration property has been renamed to `backgroundFile`.
9+
The `pluginsFile` configuration property has been renamed to {% url "`backgroundFile`" configuration#Folders-Files %}. In your `cypress.json` file...
1010

1111
```json
1212
{
1313
"pluginsFile": "path/to/file.js"
1414
}
1515
```
1616

17-
should become:
17+
...should be changed to:
1818

1919
```json
2020
{
@@ -24,7 +24,7 @@ should become:
2424

2525
## Default background file path changed
2626

27-
The default path of the {% url 'background file' background-process %} (previously known as the plugins file) has been changed from `cypress/plugins/index.js` to `cypress/background/index.js`. If you don't explicitly set the `backgroundFile` to a custom path, you'll need to move your background file to the new default path.
27+
The default path of the {% url 'background file' background-process %} (previously known as the plugins file) has been changed from `cypress/plugins/index.js` to `cypress/background/index.js`. If you don't explicitly set the `backgroundFile` to a custom path, you'll need to move your background file to the new default path. In your `cypress` folder...
2828

2929
```text
3030
/cypress
@@ -35,7 +35,7 @@ The default path of the {% url 'background file' background-process %} (previous
3535
- index.js
3636
```
3737

38-
should become:
38+
...should be changed to:
3939

4040
```text
4141
/cypress
@@ -48,12 +48,14 @@ should become:
4848

4949
## Events renamed
5050

51-
Various events have been renamed to a more consistent format. If you listen for any of the following events in your test code, you'll need to rename them.
51+
Various events have been renamed to maintain a more consistent format. If you listen for any of the following events in your test code, you'll need to rename them.
5252

53-
- `test:before:run` renamed to `before:test:run`
54-
- `test:after:run` renamed to `after:test:run`
55-
- `window:before:load` renamed to `before:window:load`
56-
- `window:before:unload` renamed to `before:window:unload`
53+
- Rename `test:before:run` to `before:test:run`
54+
- Rename `test:after:run` to `after:test:run`
55+
- Rename `window:before:load` to `before:window:load`
56+
- Rename `window:before:unload` to `before:window:unload`
57+
58+
In your test code...
5759

5860
```javascript
5961
Cypress.on('test:before:run', () => {
@@ -65,7 +67,7 @@ cy.on('window:before:load', () => {
6567
})
6668
```
6769

68-
should become:
70+
...should become:
6971

7072
```javascript
7173
Cypress.on('before:test:run', () => {

source/guides/references/trade-offs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ In case you missed it before - Cypress tests run inside of the browser! This mea
5353

5454
But what this also means is that your test code **is being evaluated inside the browser**. Test code is not evaluated in Node.js, or any other server side language. The **only** language we will ever support is the language of the web: JavaScript.
5555

56-
This trade-off means it makes it a little bit harder to communicate with the backend - like your server or database. You will not be able to connect or import those server-side libraries or modules directly. Although you can of course require `node_modules` which can be used in the browser. Additionally, you have the ability to use Node.js to import or talk directly to your backend scripts using {% url "`cy.task()`" task %} in {% url "the background process" background-process %}.
56+
This trade-off means it makes it a little bit harder to communicate with the backend - like your server or database. You will not be able to connect or import those server-side libraries or modules directly. Although you can require `node_modules` which can be used in the browser. Additionally, you have the ability to use Node.js to import or talk directly to your backend scripts using {% url "`cy.task()`" task %} in the {% url "background process" background-process %}.
5757

5858
To talk to your database or server you need to use the {% url `cy.exec()` exec %}, {% url `cy.task()` task %}, or {% url `cy.request()` request %} commands. That means you will need to expose a way to seed and setup your database. This really is not that hard, but it might take a bit more elbow grease than other testing tools written in your backend language.
5959

0 commit comments

Comments
 (0)