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

Release 12.4.0 #4997

Merged
merged 25 commits into from
Jan 24, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3999260
Chore: add experimentalSkipDomainInjection option (#4955)
AtofStryker Jan 9, 2023
6613052
Merge branch 'main' into release-12.4.0
mschile Jan 18, 2023
10f67a6
Adding documentation for experimentalMemoryManagement (#4991)
mschile Jan 18, 2023
67a4ee7
Merge branch 'main' into release-12.4.0
AtofStryker Jan 24, 2023
2162a59
chore: initial commit of 12.4.0 changelog
AtofStryker Jan 24, 2023
8f7a0b6
chore: add .as() changes to changelog
AtofStryker Jan 24, 2023
ca436fe
Merge branch 'main' of github.com:cypress-io/cypress-documentation in…
AtofStryker Jan 24, 2023
7417a86
chore: fix formatting in changelog
AtofStryker Jan 24, 2023
4ba7d03
chore: address comments from review
AtofStryker Jan 24, 2023
f4a552e
chore: cut over changelog to use issue references instead of pull req…
AtofStryker Jan 24, 2023
74416b6
fix: cut over document-domain-workaround to mdx component
AtofStryker Jan 24, 2023
774c376
chore: lint document
AtofStryker Jan 24, 2023
e7c7cce
chore: fix absolute link reference
AtofStryker Jan 24, 2023
79e1048
chore: add space to changelog
AtofStryker Jan 24, 2023
51af456
chore: add space to changelog
AtofStryker Jan 24, 2023
e4d9917
Update docs/guides/references/_changelogs/12.4.0.md
AtofStryker Jan 24, 2023
c4a2c99
Update docs/guides/references/_changelogs/12.4.0.md
AtofStryker Jan 24, 2023
77608b2
Update docs/guides/references/_changelogs/12.4.0.md
AtofStryker Jan 24, 2023
175d13c
copy/pasta changelog suggestions into main doc
AtofStryker Jan 24, 2023
a682fc1
Update docs/guides/references/_changelogs/12.4.0.md
AtofStryker Jan 24, 2023
e0bf63e
Update docs/guides/references/_changelogs/12.4.0.md
AtofStryker Jan 24, 2023
2a4b1b2
chore: update PR with suggestions
AtofStryker Jan 24, 2023
762c221
chore: update suggestions from code review
AtofStryker Jan 24, 2023
730e2b1
Merge branch 'main' into release-12.4.0
AtofStryker Jan 24, 2023
1a5a438
chore: run prettier
AtofStryker Jan 24, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/guides/guides/cross-origin-testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ property into the visited `text/html` pages. This is why navigations without the
use of the [`cy.origin()`](/api/commands/origin) command are solely scope to the
same superdomain.

<DocumentDomainWorkaround />

We understand this is a bit complicated to understand, so we have built a nifty
chart to help clarify the differences!

Expand Down
63 changes: 63 additions & 0 deletions docs/guides/references/_changelogs/12.4.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
## 12.4.0

_Released 1/24/2023_

**Features:**

- Added official support for Vite 4 projects for component testing. Addresses
[#24969](https://github.com/cypress-io/cypress/issues/24969).
- Added new
[`experimentalMemoryManagement`](/guides/references/experiments#Configuration)
configuration option to improve memory management in Chromium-based browsers.
Enable this option with `experimentalMemoryManagement=true` if you have
experienced "Out of Memory" issues. Addresses
[#23391](https://github.com/cypress-io/cypress/issues/23391).
- Added new
[`experimentalSkipDomainInjection`](/guides/references/experiments#Experimental-Skip-Domain-Injection)
flag to disable Cypress from setting `document.domain` on injection, allowing
users to test Salesforce domains. If you believe you are having
`document.domain` issues, please see the
[`experimentalSkipDomainInjection`](/guides/references/experiments#Experimental-Skip-Domain-Injection)
flag to enable for your domain. This config option is end-to-end only.
Addresses [#2367](https://github.com/cypress-io/cypress/issues/2367),
[#23958](https://github.com/cypress-io/cypress/issues/23958),
[#24290](https://github.com/cypress-io/cypress/issues/24290), and
[#24418](https://github.com/cypress-io/cypress/issues/24418).
- The [`.as`](/api/commands/as) command now accepts an options argument,
allowing an alias to be stored as type "query" or "static" value. This is
stored as "query" by default. Addresses
[#25173](https://github.com/cypress-io/cypress/issues/25173).
- The `cy.log()` command will now display a line break where the `\n` character
is used. Addresses
[#24964](https://github.com/cypress-io/cypress/issues/24964).
- [`component.specPattern`](/guides/references/configuration#component) now
utilizes a JSX/TSX file extension when generating a new empty spec file if
project contains at least one file with those extensions. This applies only to
component testing and is skipped if
[`component.specPattern`](/guides/references/configuration#component) has been
configured to exclude files with those extensions. Addresses
[#24495](https://github.com/cypress-io/cypress/issues/24495)
[#24495](https://github.com/cypress-io/cypress/issues/24495).
- Added support for the `data-qa` selector in the
[Selector Playground](guides/core-concepts/cypress-app#Selector-Playground) in
addition to `data-cy`, `data-test` and `data-testid`. Addresses
[#25305](https://github.com/cypress-io/cypress/issues/25305).

**Bugfixes:**

- Fixed an issue where component tests could incorrectly treat new major
versions of certain dependencies as supported. Fixes
[#25379](https://github.com/cypress-io/cypress/issues/25379).
- Fixed an issue where spaces on new lines in the Command Log were not
maintained. Fixes
[#23679](https://github.com/cypress-io/cypress/issues/23679).
- Fixed an issue where Angular component testing projects would fail to
initialize if an unsupported browserslist entry was specified in the project
configuration. Fixes
[#25312](https://github.com/cypress-io/cypress/issues/25312).

**Misc**

- Video output link in `cypress run` mode has been added to it's own line to
make the video output link more easily clickable in the terminal. Addresses
[#23913](https://github.com/cypress-io/cypress/issues/23913).
64 changes: 64 additions & 0 deletions docs/guides/references/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,70 @@
title: Changelog
---

## 12.4.0

_Released 1/24/2023_

**Features:**

- Added official support for Vite 4 projects for component testing. Addresses
[#24969](https://github.com/cypress-io/cypress/issues/24969).
- Added new
[`experimentalMemoryManagement`](/guides/references/experiments#Configuration)
configuration option to improve memory management in Chromium-based browsers.
Enable this option with `experimentalMemoryManagement=true` if you have
experienced "Out of Memory" issues. Addresses
[#23391](https://github.com/cypress-io/cypress/issues/23391).
- Added new
[`experimentalSkipDomainInjection`](/guides/references/experiments#Experimental-Skip-Domain-Injection)
flag to disable Cypress from setting `document.domain` on injection, allowing
users to test Salesforce domains. If you believe you are having
`document.domain` issues, please see the
[`experimentalSkipDomainInjection`](/guides/references/experiments#Experimental-Skip-Domain-Injection)
flag to enable for your domain. This config option is end-to-end only.
Addresses [#2367](https://github.com/cypress-io/cypress/issues/2367),
[#23958](https://github.com/cypress-io/cypress/issues/23958),
[#24290](https://github.com/cypress-io/cypress/issues/24290), and
[#24418](https://github.com/cypress-io/cypress/issues/24418).
- The [`.as`](/api/commands/as) command now accepts an options argument,
allowing an alias to be stored as type "query" or "static" value. This is
stored as "query" by default. Addresses
[#25173](https://github.com/cypress-io/cypress/issues/25173).
- The `cy.log()` command will now display a line break where the `\n` character
is used. Addresses
[#24964](https://github.com/cypress-io/cypress/issues/24964).
- [`component.specPattern`](/guides/references/configuration#component) now
utilizes a JSX/TSX file extension when generating a new empty spec file if
project contains at least one file with those extensions. This applies only to
component testing and is skipped if
[`component.specPattern`](/guides/references/configuration#component) has been
configured to exclude files with those extensions. Addresses
[#24495](https://github.com/cypress-io/cypress/issues/24495)
[#24495](https://github.com/cypress-io/cypress/issues/24495).
- Added support for the `data-qa` selector in the
[Selector Playground](guides/core-concepts/cypress-app#Selector-Playground) in
addition to `data-cy`, `data-test` and `data-testid`. Addresses
[#25305](https://github.com/cypress-io/cypress/issues/25305).

**Bugfixes:**

- Fixed an issue where component tests could incorrectly treat new major
versions of certain dependencies as supported. Fixes
[#25379](https://github.com/cypress-io/cypress/issues/25379).
- Fixed an issue where spaces on new lines in the Command Log were not
maintained. Fixes
[#23679](https://github.com/cypress-io/cypress/issues/23679).
- Fixed an issue where Angular component testing projects would fail to
initialize if an unsupported browserslist entry was specified in the project
configuration. Fixes
[#25312](https://github.com/cypress-io/cypress/issues/25312).

**Misc**

- Video output link in `cypress run` mode has been added to it's own line to
make the video output link more easily clickable in the terminal. Addresses
[#23913](https://github.com/cypress-io/cypress/issues/23913).

## 12.3.0

_Released 1/03/2023_
Expand Down
10 changes: 8 additions & 2 deletions docs/guides/references/error-messages.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,14 @@ This can happen for a number of reasons, including:
- There is a bug in the browser involving memory management
- There is a memory leak in Cypress

If the browser running Cypress tests crashes, currently, Cypress will abort any
remaining tests and print out this error.
For Chromium-based browsers, you can try enabling
[experimentalMemoryManagement](/guides/references/experiments).

If you are running in `open` mode, you can also try lowering
[numTestsKeptInMemory](/guides/references/configuration#Global).

If the browser running Cypress tests crashes, Cypress will abort any remaining
tests and print out this error.

There is an [open issue](https://github.com/cypress-io/cypress/issues/349) to
recover from browser crashes automatically, so tests can continue to run.
Expand Down
64 changes: 59 additions & 5 deletions docs/guides/references/experiments.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ configuration to Cypress.
| --------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `experimentalFetchPolyfill` | `false` | Automatically replaces `window.fetch` with a polyfill that Cypress can spy on and stub. Note: `experimentalFetchPolyfill` has been deprecated in Cypress 6.0.0 and will be removed in a future release. Consider using [cy.intercept()](/api/commands/intercept) to intercept `fetch` requests instead. |
| `experimentalInteractiveRunEvents` | `false` | Allows listening to the [`before:run`](/api/plugins/before-run-api), [`after:run`](/api/plugins/after-run-api), [`before:spec`](/api/plugins/before-spec-api), and [`after:spec`](/api/plugins/after-spec-api) events in the [setupNodeEvents](/guides/tooling/plugins-guide#Using-a-plugin) function during interactive mode. |
| `experimentalMemoryManagement` | `false` | Enables support for improved memory management within Chromium-based browsers. |
| `experimentalModifyObstructiveThirdPartyCode` | `false` | Whether Cypress will search for and replace obstructive code in third party `.js` or `.html` files. NOTE: Setting this flag removes [Subresource Integrity (SRI)](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). |
| `experimentalSourceRewriting` | `false` | Enables AST-based JS/HTML rewriting. This may fix issues caused by the existing regex-based JS/HTML replacement algorithm. See [#5273](https://github.com/cypress-io/cypress/issues/5273) for details. |
| `experimentalWebKitSupport` | `false` | Enable experimental support for running tests in WebKit. When set, installs of `playwright-webkit` will be detected and available in Cypress. See [Launching Browsers](/guides/guides/launching-browsers#WebKit-Experimental) for more information. |
Expand All @@ -39,11 +40,63 @@ creating `e2e` and `component` objects inside your Cypress configuration.
These experiments are available to be specified inside the `e2e` configuration
object:

| Option | Default | Description |
| -------------------------------- | ------- | --------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| `experimentalOriginDependencies` | `false` | Enables support for `require`/`import` within `cy.origin`. |
| Option | Default | Description |
| --------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------- |
| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. |
| `experimentalRunAllSpecs` | `false` | Enables the "Run All Specs" UI feature, allowing the execution of multiple specs sequentially. |
| `experimentalOriginDependencies` | `false` | Enables support for `require`/`import` within `cy.origin`. |
| `experimentalSkipDomainInjection` | `null` | Removes injecting `document.domain` into `text/html` pages for any sites that match the provided patterns. |

#### Experimental Skip Domain Injection

Under the hood, Cypress
[injects document.domain](/guides/guides/web-security#Examples-of-what-Cypress-does-under-the-hood)
into your test application to lessen the burden of navigation. This is well
described in our [Cross Origin Testing](/guides/guides/cross-origin-testing)
guide. However, some sites have compatibility issues with this feature.

The `experimentalSkipDomainInjection` option disables injecting
`document.domain` inside Cypress. When enabled, all cross-origin/subdomain
navigation must use `cy.origin()`, which may make tests a bit more verbose. We
only recommend including your site pattern if you are having issues running
Cypress out of the box and suspect setting `document.domain` is interfering with
your site's ability to render properly.

Before enabling, verify your application is not implementing frame busting
techniques, which you can mitigate with the
[`modifyObstructiveCode`](/guides/references/configuration#modifyObstructiveCode)
and
[`experimentalModifyObstructiveThirdPartyCode`](/guides/guides/web-security#Modifying-Obstructive-Third-Party-Code)
flags.

At this point in time, we are aware of the following sites that require the
`experimentalSkipDomainInjection` option to be set to be tested properly:

- Google
- Salesforce

This flag can be enabled by passing an array of origin URLs or
[minimatch](https://github.com/isaacs/minimatch) glob patterns:

:::cypress-config-example

```js
{
e2e: {
experimentalSkipDomainInjection: [
'*.salesforce.com',
'*.force.com',
'*.google.com',
]
}
}
```

:::

If using other Salesforce domains, such as
[enhanced domains](https://help.salesforce.com/s/articleView?id=sf.domain_name_enhanced.htm&type=5),
you will need to add the correct matching glob pattern.

### Component Testing

Expand All @@ -58,6 +111,7 @@ configuration object:

| Version | Changes |
| --------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| [12.4.0](/guides/references/changelog#12-4-0) | Added `experimentalSkipDomainInjection` and `experimentalMemoryManagement`. |
| [12.0.0](/guides/references/changelog#12-0-0) | Removed `experimentalSessionAndOrigin` and made it the default behavior. Added `experimentalOriginDependencies`. |
| [11.2.0](/guides/references/changelog#11-2-0) | Added `experimentalRunAllSpecs`. |
| [10.8.0](/guides/references/changelog#10-8-0) | Added `experimentalWebKitSupport`. |
Expand Down
14 changes: 14 additions & 0 deletions docs/partials/_document-domain-workaround.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:::caution

<strong class="alert-header">
<Icon name="exclamation-triangle"></Icon> Disabling document.domain Injection
</strong>

In some cases, `document.domain` injection may cause issues. As of Cypress
[v12.4.0](https://on.cypress.io/changelog#12-4-0), disabling `document.domain`
injection is available with the `experimentalSkipDomainInjection` option. Please
read about this
[experiment](/guides/references/experiments#Experimental-Skip-Domain-Injection)
for more information

:::
2 changes: 2 additions & 0 deletions src/theme/MDXComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import CypressConfigFileTabs from "@site/src/components/cypress-config-file-tabs
import DefaultSelectorPriority from "@site/docs/partials/_default-selector-priority.mdx";
import DocsImage from "@site/src/components/docs-image";
import DocsVideo from "@site/src/components/docs-video";
import DocumentDomainWorkaround from "@site/docs/partials/_document-domain-workaround.mdx";
import E2EOnlyBadge from "@site/src/components/e2e-only-badge";
import E2EOrCtTabs from "@site/src/components/e2e-or-ct-tabs";
import VueSyntaxTabs from "@site/src/components/vue-syntax-tabs";
Expand Down Expand Up @@ -119,6 +120,7 @@ export default {
DefaultSelectorPriority,
DocsImage,
DocsVideo,
DocumentDomainWorkaround,
E2EOnlyBadge,
E2EOrCtTabs,
VueSyntaxTabs,
Expand Down