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

BREAKING: 13.0 Docs #5315

Merged
merged 30 commits into from
Aug 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
610348c
BREAKING: update documentation by setting default video: false for v1…
AtofStryker Jun 15, 2023
c94c9b3
Merge branch 'main' into v13.0.0
mjhenkes Jun 15, 2023
48c2a95
breaking: update documentation by setting videoCompression: false (#5…
AtofStryker Jun 20, 2023
8f1fc89
BREAKING: remove the videoUploadOnPasses configuration option (#5306)
AtofStryker Jun 20, 2023
674419f
.readFile() is now a query (#5017) (#5316)
mjhenkes Jun 20, 2023
7d78203
Update guides for Cy 13, where assertions are now commands (#5081)
BlueWinds Jul 12, 2023
dcea3ed
Apply suggestions from code review
mjhenkes Jul 12, 2023
a0fcdf8
Remove nodeVersion documentation (#5318)
mjhenkes Jul 19, 2023
dd27a62
docs: v13 video and TR migration info (#5383)
jaffrepaul Jul 24, 2023
9eb430c
Update results for module API and after:spec handler (#5379)
chrisbreiding Aug 16, 2023
f391fef
Merge branch 'main' into v13.0.0
jennifer-shehane Aug 18, 2023
fc9304f
docs: adding documentation for runner-ui cli flags (#5424)
mschile Aug 18, 2023
7829170
docs: test replay docs (#5349)
jaffrepaul Aug 22, 2023
f99749f
Merge branch 'main' into v13.0.0
jennifer-shehane Aug 22, 2023
5051c43
Fix JavaScript caps
jennifer-shehane Aug 22, 2023
939111a
Fix caps of JavaScript
jennifer-shehane Aug 22, 2023
2929a65
Fix typo
jennifer-shehane Aug 22, 2023
2348408
Write a document around Cloud data storage and controls (#5425)
jennifer-shehane Aug 24, 2023
0eb47b4
add changelog, remove node 16 support, and update docker image refere…
AtofStryker Aug 25, 2023
f877204
docs: minor v13 updates (#5438)
jaffrepaul Aug 25, 2023
0b7948d
docs: update v13 content urls (#5428)
jaffrepaul Aug 25, 2023
79fe056
docs: v13 changelog summary (#5441)
jaffrepaul Aug 25, 2023
ff326c4
Merge branch 'main' into v13.0.0
jaffrepaul Aug 25, 2023
2ec3eb4
Apply suggestions from code review
jaffrepaul Aug 25, 2023
009f44b
lint
jaffrepaul Aug 25, 2023
e683686
Update docs/faq/questions/cloud-faq.mdx
jaffrepaul Aug 28, 2023
6e0e27c
include TR note in cypress screenshot api options (#5445)
jaffrepaul Aug 28, 2023
4b850a4
docs: additional test replay content (#5447)
jaffrepaul Aug 28, 2023
cc14939
sync up changelog
chrisbreiding Aug 29, 2023
e09fac2
Update _cloud_free_plan.mdx
jaffrepaul Aug 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ orbs:
executors:
node-executor:
docker:
- image: cimg/node:16.15.1
- image: cimg/node:18.15.0
with-chrome-and-firefox:
resource_class: medium+
docker:
- image: 'cypress/browsers:node16.13.2-chrome97-ff96'
- image: 'cypress/browsers:node18.12.0-chrome106-ff106'

commands:
docs-build:
Expand Down
35 changes: 18 additions & 17 deletions docs/api/commands/screenshot.mdx

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions docs/api/cypress-api/screenshot-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ Cypress.Screenshot.defaults(options)

An object containing one or more of the following:

| Option | Default | Description |
| ---------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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. |
| `capture` | `'fullPage'` | Which parts of the Cypress Test Runner to capture. This value is ignored for element screenshot captures. Valid values are `viewport`, `fullPage`, or `runner`. When `viewport`, your application under test is captured in the current viewport. When `fullPage`, your 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`. |
| `disableTimersAndAnimations` | `true` | When true, prevents JavaScript timers (`setTimeout`, `setInterval`, etc) and CSS animations from running while the screenshot is taken. |
| `scale` | `false` | Whether to scale the app to fit into the browser viewport. This is always coerced to `true` for `runner` captures. |
| `screenshotOnRunFailure` | `true` | When true, automatically takes a screenshot when there is a failure during `cypress run`. |
| `overwrite` | `false` | Whether to overwrite duplicate screenshot files with the same file name when saving. |
| `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`. |
| `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. |
| Option | Default | Description |
| ---------------------------- | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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. |
| `capture` | `'fullPage'` | Which parts of the Cypress Test Runner to capture. This value is ignored for element screenshot captures. Valid values are `viewport`, `fullPage`, or `runner`. When `viewport`, your application under test is captured in the current viewport. When `fullPage`, your 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`. When [Test Replay](/guides/cloud/debugging/test-replay) is enabled and the Runner UI is hidden, a `runner` screenshot will not include the Runner UI and will instead capture the application under test only in the current viewport. |
| `disableTimersAndAnimations` | `true` | When true, prevents JavaScript timers (`setTimeout`, `setInterval`, etc) and CSS animations from running while the screenshot is taken. |
| `scale` | `false` | Whether to scale the app to fit into the browser viewport. This is always coerced to `true` for `runner` captures. |
| `screenshotOnRunFailure` | `true` | When true, automatically takes a screenshot when there is a failure during `cypress run`. |
| `overwrite` | `false` | Whether to overwrite duplicate screenshot files with the same file name when saving. |
| `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`. |
| `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. |

## Examples

Expand Down
1 change: 0 additions & 1 deletion docs/api/plugins/after-spec-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ on('after:spec', (spec, results) => {
// {
// title: ['login', 'logs user in'],
// state: 'passed',
// body: 'function () {}',
// // ...more properties...
// }
// ],
Expand Down
16 changes: 14 additions & 2 deletions docs/api/commands/readfile.mdx → docs/api/queries/readfile.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: readFile
slug: /api/commands/readfile
---

Read a file and yield its contents.
Expand Down Expand Up @@ -62,8 +63,8 @@ Pass in an options object to change the default behavior of `cy.readFile()`.
### Yields [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Subject-Management) {#Yields}

- `cy.readFile()` yields the contents of the file.
- The file will not be read from disk again if the results are stored in an
alias.
- The file will be read from disk again if any upcoming command (such as an
assertion) in the chain fails.

## Examples

Expand Down Expand Up @@ -195,6 +196,15 @@ assertions.
cy.readFile('some/nested/path/story.txt').should('eq', 'Once upon a time...')
```

Starting in Cypress `v13`, `cy.readFile()` is a query, and will continue to read
the file until all chained commands of any type pass, not just assertions.

```javascript
// will retry until the json file has a `users[123].name` field, and
// the assertion passes
cy.readFile('users.json').its('users.123.name').should('eq', 'John Doe')
```

## Rules

### Requirements [<Icon name="question-circle"/>](/guides/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements}
Expand Down Expand Up @@ -247,6 +257,7 @@ outputs the following:

| Version | Changes |
| --------------------------------------------- | ----------------------------------------- |
| [13.0.0](/guides/references/changelog#13-0-0) | `cy.readFile()` became a query |
| [9.0.0](/guides/references/changelog#9-0-0) | Changed `null` encoding to read as Buffer |
| [0.17.2](/guides/references/changelog#0-17-2) | Improved error messaging |
| [0.17.1](/guides/references/changelog#0-17-1) | `cy.readFile()` command added |
Expand All @@ -255,5 +266,6 @@ outputs the following:

- [`cy.exec()`](/api/commands/exec)
- [`cy.fixture()`](/api/commands/fixture) for a similar command with caching
that does not retry
- [`cy.task()`](/api/commands/task)
- [`cy.writeFile()`](/api/commands/writefile)