Skip to content

Commit 37ffc4b

Browse files
committed
Merge branch '9.2.0-release' into typesctipt-commands
2 parents d074ff7 + 4b6b3cf commit 37ffc4b

File tree

11 files changed

+60
-53
lines changed

11 files changed

+60
-53
lines changed

content/_changelogs/5.4.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ _Released 10/14/2020_
2727
[#8624](https://github.com/cypress-io/cypress/issues/8624)
2828
- When there is a new version of Cypress available, the update modal has a new
2929
design with 'copy to clipboard' buttons to copy the upgrade commands.
30-
Addressed in [#8751](https://github.com/cypress-io/cypress/issues/8751).
30+
Addressed in [#8751](https://github.com/cypress-io/cypress/pull/8751).
3131
- The [Command Log](/guides/core-concepts/test-runner#Command-Log) can be hidden
3232
by passing the `CYPRESS_NO_COMMAND_LOG=1` environment variable during
3333
`cypress open` or `cypress run` to be used as a tool to debug performance

content/_changelogs/5.5.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ _Released 10/26/2020_
1313
**Bugfixes:**
1414

1515
- Updated the Cypress proxy layer to proxy HTTPS traffic from non-AUT origins.
16-
Addressed in [#8827](https://github.com/cypress-io/cypress/issues/8827).
16+
Addressed in [#8827](https://github.com/cypress-io/cypress/pull/8827).
1717
- This fixed an issue with [`cy.route2()`](http) where HTTPS requests to a
1818
non-AUT origin would not be intercepted as expected.
1919
- [`cy.route2()`](http) now properly handles passing a method as its first

content/_changelogs/6.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ deprecations.
6262
support for `cy.server()` and `cy.route()` will be removed. We encourage you
6363
to use [cy.intercept()](/api/commands/intercept) instead. See our guide on
6464
[Migrating `cy.route()` to `cy.intercept()`](/guides/references/migration-guide#Migrating-cy-route-to-cy-intercept).
65-
Addressed in [#9185](https://github.com/cypress-io/cypress/issues/9185).
65+
Addressed in [#9185](https://github.com/cypress-io/cypress/pull/9185).
6666
- `experimentalFetchPolyfill` has been deprecated. We encourage you to use
6767
[cy.intercept()](/api/commands/intercept) to intercept requests using the
6868
Fetch API instead.

content/_changelogs/6.1.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ _Released 12/07/2020_
3535
[#8999](https://github.com/cypress-io/cypress/issues/8999).
3636
- We fixed an issue where HTTP redirects could not be awaited using
3737
[cy.intercept()](/api/commands/intercept) unless dynamically intercepted.
38-
Addressed in [#9097](https://github.com/cypress-io/cypress/issues/9097).
38+
Addressed in [#9097](https://github.com/cypress-io/cypress/pull/9097).
3939
- Tests will no longer hang in certain situations when there's an error in a
4040
`before()` hook. Fixes
4141
[#9162](https://github.com/cypress-io/cypress/issues/9162).

content/_changelogs/6.2.0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ _Released 12/21/2020_
1111
[`after:run`](/api/plugins/after-run-api),
1212
[`before:spec`](/api/plugins/before-spec-api) and
1313
[`after:spec`](/api/plugins/after-spec-api) docs for more information.
14-
Addressed in [#9646](https://github.com/cypress-io/cypress/issues/9646),
15-
[#14178](https://github.com/cypress-io/cypress/issues/14178)
16-
[#14238](https://github.com/cypress-io/cypress/issues/14238) and
17-
[#14263](https://github.com/cypress-io/cypress/issues/14263).
14+
Addressed in [#9646](https://github.com/cypress-io/cypress/pull/9646),
15+
[#14178](https://github.com/cypress-io/cypress/pull/14178)
16+
[#14238](https://github.com/cypress-io/cypress/pull/14238) and
17+
[#14263](https://github.com/cypress-io/cypress/pull/14263).
1818
- The `Timed out retrying` error message now displays the amount of time Cypress
1919
retried. Addresses [#5781](https://github.com/cypress-io/cypress/issues/5781).
2020
- The RouteMatcher argument for [cy.intercept()](/api/commands/intercept) has a

content/_changelogs/6.7.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ _Released 3/15/2021_
1212
[`after:run`](/api/plugins/after-run-api),
1313
[`before:spec`](/api/plugins/before-spec-api) and
1414
[`after:spec`](/api/plugins/after-spec-api) docs for more information.
15-
Addressed in [#15276](https://github.com/cypress-io/cypress/issues/15276).
15+
Addressed in [#15276](https://github.com/cypress-io/cypress/pull/15276).
1616
- When canceling a run from the Dashboard, previously only parallelized runs
1717
would cancel correctly. Now all recorded runs will respect cancelation and
1818
exit early. Addresses
@@ -25,7 +25,7 @@ _Released 3/15/2021_
2525
upfront. Addressed in
2626
[#14925](https://github.com/cypress-io/cypress/issues/14925).
2727
- The full stack trace from errors thrown in the preprocessor are now displayed.
28-
Addressed in [#15198](https://github.com/cypress-io/cypress/issues/15198).
28+
Addressed in [#15198](https://github.com/cypress-io/cypress/pull/15198).
2929
- Configuration values which are changed at runtime prior to tests running are
3030
now properly shown as resolved from the spec code within the Module API to
3131
indicate where the change originated from. Addresses

content/_changelogs/7.0.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ in more detail and how to change your code to migrate to Cypress 7.0.**
7575
[`redirectionLimit`](guides/references/configuration#Global) config. Addresses
7676
[#14445](https://github.com/cypress-io/cypress/issues/14445).
7777
- The default preprocessor now targets a more modern version of ECMAScript.
78-
Addressed in [#15274](https://github.com/cypress-io/cypress/issues/15274).
78+
Addressed in [#15274](https://github.com/cypress-io/cypress/pull/15274).
7979
- We now enable
8080
[`contextIsolation`](https://www.electronjs.org/docs/tutorial/context-isolation)
8181
by default in the Electron browser. You can override this option if needed

content/_changelogs/8.3.0.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _Released 08/16/2021_
55
**Features:**
66

77
- The instructions for recording a run have been updated for some users.
8-
Addressed in [#17317](https://github.com/cypress-io/cypress/issues/17317).
8+
Addressed in [#17317](https://github.com/cypress-io/cypress/pull/17317).
99

1010
**Performance:**
1111

content/api/commands/readfile.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ supported:
4646
- `'utf-16le'`
4747
- `null`
4848

49-
Using `null` explicitly will return the file as a `Buffer`, regardless of file extension.
49+
Using `null` explicitly will return the file as a `Buffer`, regardless of file
50+
extension.
5051

5152
**<Icon name="angle-right"></Icon> options** **_(Object)_**
5253

@@ -59,7 +60,7 @@ Pass in an options object to change the default behavior of `cy.readFile()`.
5960

6061
### Yields [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Subject-Management)
6162

62-
<List><li>`cy.readFile()` yields the contents of the file.</li></List>
63+
- `cy.readFile()` yields the contents of the file.
6364

6465
## Examples
6566

@@ -195,21 +196,21 @@ cy.readFile('some/nested/path/story.txt').should('eq', 'Once upon a time...')
195196

196197
### Requirements [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
197198

198-
<List><li>`cy.readFile()` requires being chained off of
199-
`cy`.</li><li>`cy.readFile()` requires the file must
200-
exist.</li><li>`cy.readFile()` requires the file be successfully read from
201-
disk.</li></List>
199+
- `cy.readFile()` requires being chained off of `cy`.
200+
- `cy.readFile()` requires the file must exist.
201+
- `cy.readFile()` requires the file be successfully read from disk.
202202

203203
### Assertions [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Assertions)
204204

205-
<List><li>`cy.readFile()` will automatically
206-
[retry](/guides/core-concepts/retry-ability) until all chained assertions have
207-
passed</li></List>
205+
- `cy.readFile()` will automatically
206+
[retry](/guides/core-concepts/retry-ability) until all chained assertions have
207+
passed.
208208

209209
### Timeouts [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Timeouts)
210210

211-
<List><li>`cy.readFile()` can time out waiting for assertions you've added to
212-
pass.</li></List>
211+
- `cy.readFile()` can time out waiting for assertions you've added to pass.
212+
- `cy.readFile()` can time out when the content being read takes a significant
213+
amount of time to encode.
213214

214215
## Command Log
215216

@@ -228,6 +229,14 @@ outputs the following:
228229

229230
<DocsImage src="/img/api/readfile/console-log-shows-content-from-file-formatted-as-javascript.png" alt="Console Log readFile" ></DocsImage>
230231

232+
## History
233+
234+
| Version | Changes |
235+
| --------------------------------------------- | ----------------------------------------- |
236+
| [9.0.0](/guides/references/changelog#9-0-0) | Changed `null` encoding to read as Buffer |
237+
| [0.17.2](/guides/references/changelog#0-17-2) | Improved error messaging |
238+
| [0.17.1](/guides/references/changelog#0-17-1) | `cy.readFile()` command added |
239+
231240
## See also
232241

233242
- [`cy.exec()`](/api/commands/exec)

content/api/commands/writefile.md

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ cy.writeFile('menu.json')
2828
A path to a file within the project root (the directory that contains the
2929
default `cypress.json`).
3030

31-
**<Icon name="angle-right"></Icon> contents** **_(String, Array, Object or Buffer)_**
31+
**<Icon name="angle-right"></Icon> contents** **_(String, Array, Object or
32+
Buffer)_**
3233

3334
The contents to be written to the file.
3435

@@ -57,11 +58,12 @@ first encoding it as a string.
5758

5859
Pass in an options object to change the default behavior of `cy.writeFile()`.
5960

60-
| Option | Default | Description |
61-
| ---------- | ------- | --------------------------------------------------------------------------------------------------- |
62-
| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/test-runner#Command-Log) |
63-
| `flag` | `w` | File system flag as used with [`fs.writeFile`](https://nodejs.org/api/fs.html#fs_file_system_flags) |
64-
| `encoding` | `utf8` | The encoding to be used when writing to the file |
61+
| Option | Default | Description |
62+
| ---------- | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
63+
| `log` | `true` | Displays the command in the [Command log](/guides/core-concepts/test-runner#Command-Log) |
64+
| `flag` | `w` | File system flag as used with [`fs.writeFile`](https://nodejs.org/api/fs.html#fs_file_system_flags) |
65+
| `encoding` | `utf8` | The encoding to be used when writing to the file |
66+
| `timeout` | [`defaultCommandTimeout`](/guides/references/configuration#Timeouts) | Time to wait for `.writeFile()` to resolve before [timing out](#Timeouts) |
6567

6668
<Alert type="info">
6769

@@ -73,8 +75,7 @@ parameter and include encoding there. This is the same behavior as
7375

7476
### Yields [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Subject-Management)
7577

76-
<List><li>`cy.writeFile()` yields the value of the <code>contents</code>
77-
argument.</li></List>
78+
- `cy.writeFile()` yields `null`.
7879

7980
## Examples
8081

@@ -193,6 +194,7 @@ cy.readFile(filename).then((list) => {
193194
### Buffer
194195

195196
#### Write a buffer directly without encoding as a string
197+
196198
```javascript
197199
const filename = '/path/to/file.png'
198200

@@ -207,7 +209,6 @@ cy.readFile(filename, null).then((obj) => {
207209
### Requirements [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands)
208210

209211
- `cy.writeFile()` requires being chained off of `cy`.
210-
211212
- `cy.writeFile()` requires the file be successfully written to disk. Anything
212213
preventing this such as OS permission issues will cause it to fail.
213214

@@ -218,15 +219,8 @@ cy.readFile(filename, null).then((obj) => {
218219

219220
### Timeouts [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Timeouts)
220221

221-
- `cy.writeFile()` should never time out.
222-
223-
<Alert type="warning">
224-
225-
Because `cy.writeFile()` is asynchronous it is technically possible for there to
226-
be a timeout while talking to the internal Cypress automation APIs. But for
227-
practical purposes it should never happen.
228-
229-
</Alert>
222+
- `cy.writeFile()` can time out when the content being written takes a
223+
significant amount of time to encode.
230224

231225
## Command Log
232226

@@ -249,6 +243,7 @@ outputs the following:
249243

250244
| Version | Changes |
251245
| ------------------------------------------- | -------------------------------------------------------- |
246+
| [9.2.0](/guides/references/changelog#9-2-0) | Added `timeout` option |
252247
| [4.0.0](/guides/references/changelog#4-0-0) | `cy.writeFile()` now yields `null` instead of `contents` |
253248
| [3.1.1](/guides/references/changelog#3-1-1) | Added `flag` option and appending with `a+` |
254249
| [1.0.0](/guides/references/changelog#1.0.0) | `cy.writeFile()` command added |

0 commit comments

Comments
 (0)