Skip to content

Commit

Permalink
BREAKING: 13.0 Docs (#5315)
Browse files Browse the repository at this point in the history
* BREAKING: update documentation by setting default video: false for v13.0.0 (#5300)

* BREAKING: update documentation by setting default video: false

* Update docs/guides/overview/why-cypress.mdx

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* Update docs/guides/end-to-end-testing/migration/protractor-to-cypress.mdx

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* Update docs/guides/continuous-integration/introduction.mdx

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* Update docs/guides/guides/screenshots-and-videos.mdx

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* chore: re-order video bits

* Update docs/guides/end-to-end-testing/migration/protractor-to-cypress.mdx

* chore: linting

---------

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* breaking: update documentation by setting videoCompression: false (#5301)

* BREAKING: update documentation by setting default video: false

* BREAKING: update documentation by setting videoCompression: false

* Update docs/guides/guides/screenshots-and-videos.mdx

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>

* apply suggestion from code review

* chore: attempt to rework the video encoding section

* Update docs/guides/guides/screenshots-and-videos.mdx

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* chore: address comments in code review

* chore: update video encoding guide to flow a bit more evenly

---------

Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* BREAKING: remove the videoUploadOnPasses configuration option (#5306)

* BREAKING: remove the videoUploadOnPasses configuration option

* chore: add history entry of removed videoUploadOnPasses config option

* .readFile() is now a query (#5017) (#5316)

* .readFile() is now a query

* Add section on new .readFile() superpowers

* Fix page slug for readFile

* Prettier run

Co-authored-by: Blue F <blue@everblue.info>

* Update guides for Cy 13, where assertions are now commands (#5081)

* .readFile() is now a query (#5017)

* .readFile() is now a query

* Add section on new .readFile() superpowers

* Fix page slug for readFile

* Prettier run

* Update guides to better support users in Cy 13, where assertions are now commands

* Review updates

* Apply suggestions from code review

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>

* Partial review feedback (more to come)

* Review updates

* Prettier run

* fix: update retry ability guide and migration guide now that should() and and() will not be queries in v13. see cypress-io/cypress#25738

* chore: correct number of queries in example

* revert: images changes due to should() and and() being queries, which is no longer applicable due to cypress-io/cypress#25738

* chore: lint guides

---------

Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Apply suggestions from code review

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* Remove nodeVersion documentation (#5318)

* Remove reference to 'nodeVersion'

* added history, removed changes to legacy

* docs: v13 video and TR migration info (#5383)

* added video config migration info

* added tr migration info

* PR feedback

* PR feedback

* PR feedback

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Update docs/guides/references/migration-guide.mdx

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* Update results for module API and after:spec handler (#5379)

* docs: adding documentation for runner-ui cli flags (#5424)

* docs: test replay docs (#5349)

* sidebar content shuffle

* main feature content & link updates

* add screenshots

* add url to vpn whitelist

* add TR banner

* add & reorder faq

* build test replay partial

* add TR partial to related content

* add TR link to related "see more" sections

* content tweaks

* include TR content in body copy

* add troubleshooting

* remove old images

* add PR feedback

* add command log notes

* remove dead link

* update images

* replace runs page screenshots

* Apply suggestions from code review

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Bill Glesias <bglesias@gmail.com>

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* add more faqs

* restore missing partial export

* fix links

* swap in screenshot of new network panel

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* fix command line merge issue

* lint

* Update docs/guides/cloud/debugging/recorded-runs.mdx

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Bill Glesias <bglesias@gmail.com>

* Fix JavaScript caps

* Fix caps of JavaScript

* Fix typo

* Write a document around Cloud data storage and controls (#5425)

Co-authored-by: Paul Jaffre <jaffrepaul@gmail.com>
Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* add changelog, remove node 16 support, and update docker image refere… (#5434)

* add changelog, remove node 16 support, and update docker image reference to be on at least node 18

* Update docs/guides/references/changelog.mdx

* docs: minor v13 updates (#5438)

* match data callout with data storage page

* remove mention from artifacts panel

* remove submitting feature requests callout

* build & insert cloud free plan partial

* docs: update v13 content urls (#5428)

* update content urls

* add todo

* replace v13 changelog urls

* docs: v13 changelog summary (#5441)

* changelog summary

* Update docs/guides/references/changelog.mdx

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* tweak verbaige & lint

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>

* Apply suggestions from code review

Co-authored-by: Bill Glesias <bglesias@gmail.com>

* lint

* Update docs/faq/questions/cloud-faq.mdx

Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>

* include TR note in cypress screenshot api options (#5445)

* docs: additional test replay content (#5447)

* add TR cost faq

* add centos troubleshooting

* sync up changelog

* Update _cloud_free_plan.mdx

minor text update

---------

Co-authored-by: Bill Glesias <bglesias@gmail.com>
Co-authored-by: Emily Rohrbough <emilyrohrbough@users.noreply.github.com>
Co-authored-by: Chris Breiding <chrisbreiding@users.noreply.github.com>
Co-authored-by: Blue F <blue@everblue.info>
Co-authored-by: Mike McCready <66998419+MikeMcC399@users.noreply.github.com>
Co-authored-by: Paul Jaffre <jaffrepaul@gmail.com>
Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Matt Schile <mschile@cypress.io>
Co-authored-by: Chris Breiding <chrisbreiding@gmail.com>
Co-authored-by: Paul Jaffre <paul@cypress.io>
  • Loading branch information
11 people committed Aug 29, 2023
1 parent 47865db commit deb58d6
Show file tree
Hide file tree
Showing 56 changed files with 980 additions and 377 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
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
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
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
@@ -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)

0 comments on commit deb58d6

Please sign in to comment.