diff --git a/content/_changelogs/8.6.0.md b/content/_changelogs/8.6.0.md new file mode 100644 index 0000000000..3327cce41b --- /dev/null +++ b/content/_changelogs/8.6.0.md @@ -0,0 +1,45 @@ +## 8.6.0 + +_Released 10/11/2021_ + +**Features:** + +- `cy.screenshot()` now accepts `overwrite: true` as an option to overwrite + existing screenshots with the same file name. Addresses + [#7955](https://github.com/cypress-io/cypress/issues/7955). +- `cy.select([])` can now be used to clear any selected options in a multi-value + select. Addresses [#4318](https://github.com/cypress-io/cypress/issues/4318). +- Using `cy.pause()` when using `cypress run --headed --no-exit` will now pause + a test. Addresses [#4044](https://github.com/cypress-io/cypress/issues/4044). + +**Bugfixes:** + +- Fixed a regression introduced in [8.2.0](#8-2-0) where certain XMLHttpRequests + would not display their response bodies in the DevTools Console when clicked. + Fixes [#17656](https://github.com/cypress-io/cypress/issues/17656). +- Fixed a regression in [8.3.0](#8-3-0) where capturing videos in Chrome + versions earlier than 89 would result in choppy videos and skipped frames. + Fixes [#18021](https://github.com/cypress-io/cypress/issues/18021). +- Cypress displays the correct error when certain custom error types are thrown + within a test. Fixes + [#18259](https://github.com/cypress-io/cypress/issues/18259). +- The Cypress App will no longer crash when passed a `--spec: {}` from the CLI + and instead error when passed an invalid object argument. Fixes + [#3957](https://github.com/cypress-io/cypress/issues/3957). +- Logging a plain object no longer results in the error "Cannot convert object + to primitive value". Fixes [#18143](https://github.com/cypress-io/cypress/issues/18143). + +**Misc:** + +- Updated the `cy.request()` error message when conflicting `failOnStatusCode` + and `retryOnStatusCodeFailure` options are passed to be clearer. Fixes + [#18271](https://github.com/cypress-io/cypress/issues/18271). + +**Dependency Updates:** + +- Upgraded the Chromium browser version used during `cypress run` and when + selecting Electron browser in `cypress open` from `91.0.4472.164` to + `93.0.4577.58`. +- Upgraded `electron` from `13.2.0` to `14.1.0`. Addressed in + [#18318](https://github.com/cypress-io/cypress/issues/18318) and + [#18384](https://github.com/cypress-io/cypress/issues/18384). diff --git a/content/api/commands/screenshot.md b/content/api/commands/screenshot.md index 1fa70ab2c3..a3ec9ac3fa 100644 --- a/content/api/commands/screenshot.md +++ b/content/api/commands/screenshot.md @@ -53,7 +53,8 @@ Pass in an options object to change the default behavior of `.screenshot()`. | `disableTimersAndAnimations` | `true` | When true, prevents JavaScript timers (`setTimeout`, `setInterval`, etc) and CSS animations from running while the screenshot is taken. | | `padding` | `null` | Padding used to alter the dimensions of a screenshot of an element. It can either be a number, or an array of up to four numbers [using CSS shorthand notation](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties). This property is only applied for element screenshots and is ignored for all other types. | | `scale` | `false` | Whether to scale the app to fit into the browser viewport. This is always coerced to `true` when `capture` is `runner`. | -| `timeout` | [`responseTimeout`](/guides/references/configuration#Timeouts) | Time to wait for `.screenshot()` to resolve before [timing out](#Timeouts) | +| `timeout` | [`responseTimeout`](/guides/references/configuration#Timeouts) | Time to wait for `.screenshot()` to resolve before [timing out](#Timeouts) +| `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. When capturing screenshots of an element, the argument is the element being captured. For other screenshots, the argument is the `document`. | | `onAfterScreenshot` | `null` | A callback after a non-failure screenshot is taken. When capturing screenshots of an element, the first argument is the element being captured. For other screenshots, the first argument is the `document`. The second argument is properties concerning the screenshot, including the `path` it was saved to and the `dimensions` of the saved screenshot. | @@ -173,7 +174,14 @@ Screenshot naming follows these rules: - For a named screenshot, the name is used instead of the suites and test name: `{screenshotsFolder}/{specPath}/{name}.png` - For any duplicate screenshots (named or not), they will be appended with a - number: `{screenshotsFolder}/{specPath}/{testName} (1).png` + number: `{screenshotsFolder}/{specPath}/{testName} (1).png`. + + + + This behavior can be changed by passing the `{overwrite: true}` option to `cy.screenshot()` to explicitly overwrite duplicate screenshots. + + + - For a failure screenshot, the default naming scheme is used and the name is appended with ` (failed)`: `{screenshotsFolder}/{specPath}/{testName} (failed).png` diff --git a/content/api/commands/select.md b/content/api/commands/select.md index 170e8c3be9..f9a42a0425 100644 --- a/content/api/commands/select.md +++ b/content/api/commands/select.md @@ -159,6 +159,12 @@ cy.get('select') .should('deep.equal', ['456', '457']) ``` + + +**Note:** Passing an array into `cy.select()` will select only the options matching values in the array, leaving all other options unselected (even those that were previously selected). In the same manner, calling `cy.select([])` with an empty array will clear selections on all options. + + + ### Force select #### Force select a hidden `