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: update documentation by setting videoCompression: false #5301

Merged
merged 12 commits into from
Jun 20, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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 docs/api/commands/screenshot.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ Another potential problem to be aware of is that our own Command Log is using
React under the hood and only rendering asynchronously during an animation
frame. It is possible you will see screenshots taken before our Command Log is
done rendering. This means you may not see the **error displayed** in the
screenshot. But this is also why we take a video - to show you the complete
failure.
screenshot. But this is also why we allow taking a video - to show you the
complete failure.

We make our best effort to synchronize taking a screenshot with our renderer,
but the current state of your application under test could have changed in the
Expand Down
4 changes: 3 additions & 1 deletion docs/guides/continuous-integration/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ insight into what happened when your tests ran.
- Get the entire stack trace of failed tests.
- View screenshots taken when tests fail and when using
[`cy.screenshot()`](/api/commands/screenshot).
- Watch a video of your entire test run or a clip at the point of test failure.
- If enabled, watch a video of your entire test run or a clip at the point of
test failure.
- See which machines ran each test when
[parallelized](/guides/guides/parallelization).

Expand Down Expand Up @@ -376,6 +377,7 @@ values in the Cypress configuration.
**_Typical use cases would be modifying things like:_**

- `CYPRESS_BASE_URL`
- `CYPRESS_VIDEO`
- `CYPRESS_VIDEO_COMPRESSION`
- `CYPRESS_REPORTER`
- `CYPRESS_INSTALL_BINARY`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ the state of the app UI at the point of failure or see the events that led up to
the failure.

Cypress assists with debugging in headless mode, by automatically taking a
screenshot of the app UI and command log at the exact point of test failure. To
help see everything that happened prior to test failure, Cypress provides a
video recording (as an MP4 file) of a full test spec run by default.
screenshot of the app UI and command log at the exact point of test failure. If
enabled, to help see everything that happened prior to test failure, Cypress
provides a video recording (as an MP4 file) of a full test spec run by default.

### Test Retries

Expand Down
31 changes: 20 additions & 11 deletions docs/guides/guides/screenshots-and-videos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,27 @@ to clear your screenshots folder before a run, you can set

## Videos

Cypress records a video for each spec file when running tests during
`cypress run`. Videos are _not_ automatically recorded during `cypress open`.
If enabled, Cypress records a video for each spec file when running tests during
`cypress run`. Videos are _not_ recorded during `cypress open`.

Video recording can be turned off entirely by setting
[`video`](/guides/references/configuration#Videos) to `false` from within your
Video recording can be turned on by setting
[`video`](/guides/references/configuration#Videos) to `true` from within your
configuration.

:::cypress-config-example

```ts
{
video: true
}
```

Videos are stored in the
[`videosFolder`](/guides/references/configuration#Videos) which is set to
`cypress/videos` by default.

After `cypress run` completes, Cypress automatically compresses the video in
order to save on file size. By default it compresses to a `32 CRF`, but this is
configurable with the
After `cypress run` completes, Cypress compresses the video in order to save on
file size. By default videos do not compress, but this is configurable with the
[`videoCompression`](/guides/references/configuration#Videos) property.

When using the `--record` flag while running your tests, videos are processed,
Expand Down Expand Up @@ -98,20 +105,22 @@ make the encoding a little bit faster. Here are some common scenarios:
A lower `videoCompression` value will spend less time compressing and result in
a bigger video file size.

**Disable compression**
**Enabling compression**

:::cypress-config-example

```ts
{
videoCompression: false
videoCompression: true
}
```

:::

The compression step will be skipped completely, so the video will be large, but
the processing should be faster.
Compression is disabled by default, meaning this step will be skipped
completely, so the video will be large, but the processing should be faster.
AtofStryker marked this conversation as resolved.
Show resolved Hide resolved
Setting to `true` will coerce the value to 32 CRF, which takes longer to
process, but results in a smaller video.

:::info

Expand Down
4 changes: 2 additions & 2 deletions docs/guides/overview/why-cypress.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ do that no other testing framework can:
- **Consistent Results:** Our architecture doesn't use Selenium or WebDriver.
Say hello to fast, consistent and reliable tests that are flake-free.
- **Screenshots and Videos:** View screenshots taken automatically on failure,
or videos of your entire test suite when run from the CLI. Record to
[Cypress Cloud](/guides/cloud/introduction) to store them with your test
or videos, if enabled, of your entire test suite when run from the CLI. Record
to [Cypress Cloud](/guides/cloud/introduction) to store them with your test
results for zero-configuration debugging.
- **Cross Browser Testing:** Run tests within Firefox and Chrome-family browsers
(including Edge and Electron) locally and
Expand Down
4 changes: 2 additions & 2 deletions docs/guides/references/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ For more options regarding screenshots, view the
| Option | Default | Description |
| ----------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `trashAssetsBeforeRuns` | `true` | Whether Cypress will trash assets within the `downloadsFolder`, `screenshotsFolder`, and `videosFolder` before tests run with `cypress run`. |
| `videoCompression` | `32` | The quality setting for the video compression, in Constant Rate Factor (CRF). The value can be `false` to disable compression or a value between `0` and `51`, where a lower value results in better quality (at the expense of a higher file size). |
| `videoCompression` | `false` | The quality setting for the video compression, in Constant Rate Factor (CRF). The value can be `false` to disable compression or a value between `0` and `51`, where a lower value results in better quality (at the expense of a higher file size). |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also mention that true is valid and sets the value to 32 CRF.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is handled in the release-12.15.0 branch. It just hasn't made its way into main yet. Once released, we will need to merge main into the v13 docs branch to make sure the language makes sense

| `videosFolder` | `cypress/videos` | Where Cypress will automatically save the video of the test run when tests run with `cypress run`. |
| `video` | `true` | Whether Cypress will capture a video of the tests run with `cypress run`. |
| `video` | `false` | Whether Cypress will capture a video of the tests run with `cypress run`. |
| `videoUploadOnPasses` | `true` | Whether Cypress will process, compress, and upload videos to [Cypress Cloud](/guides/cloud/introduction) even when all tests in a spec file are passing. This only applies when recording your runs to Cypress Cloud. Turn this off if you'd like to only upload the spec file's video when there are failing tests. |

### Downloads
Expand Down