From fd05b71bd69e5ac10b5acd1a682f22cb5461a677 Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Wed, 19 Oct 2022 09:32:24 -0400 Subject: [PATCH 01/10] 10.11.0 From 0d0be31fba9da493ebde4ab984ab19bdf76dea8b Mon Sep 17 00:00:00 2001 From: Chris Breiding Date: Wed, 19 Oct 2022 10:11:24 -0400 Subject: [PATCH 02/10] Update cy.origin dependencies / remove Cypress.require() (#4789) --- content/_changelogs/10.11.0.md | 9 +++ content/_data/sidebar.json | 4 -- content/api/commands/origin.md | 56 +++++++++++++----- content/api/cypress-api/require.md | 77 ------------------------- cypress/fixtures/sidebar-overrides.json | 1 - 5 files changed, 51 insertions(+), 96 deletions(-) create mode 100644 content/_changelogs/10.11.0.md delete mode 100644 content/api/cypress-api/require.md diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md new file mode 100644 index 0000000000..6dafe326f7 --- /dev/null +++ b/content/_changelogs/10.11.0.md @@ -0,0 +1,9 @@ +## 10.11.0 + +_Released 10/25/2022_ + +**Features:** + +- `cy.origin()` now supports using `require()` and dynamic `import()` to include + dependencies. `Cypress.require()` has been removed. Addresses + [#24293](https://github.com/cypress-io/cypress/issues/24293). diff --git a/content/_data/sidebar.json b/content/_data/sidebar.json index 22196f636d..d547d20244 100644 --- a/content/_data/sidebar.json +++ b/content/_data/sidebar.json @@ -985,10 +985,6 @@ "title": "platform", "slug": "platform" }, - { - "title": "require", - "slug": "require" - }, { "title": "session", "slug": "session" diff --git a/content/api/commands/origin.md b/content/api/commands/origin.md index 0f620fee82..545a988782 100755 --- a/content/api/commands/origin.md +++ b/content/api/commands/origin.md @@ -507,27 +507,53 @@ into the callback. ### Dependencies / Sharing Code -It is not possible to use +[ES module dynamic `import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports) +and/or [CommonJS `require()`](https://nodejs.org/en/knowledge/getting-started/what-is-require/) -or -[dynamic ES module `import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#dynamic_imports) -within the callback. However, [`Cypress.require()`](/api/cypress-api/require) -can be utilized to include [npm](https://www.npmjs.com/) packages and other -files. It is functionally the same as using -[CommonJS `require()`](https://nodejs.org/en/knowledge/getting-started/what-is-require/) -in browser-targeted code. +can be used within the callback to include [npm](https://www.npmjs.com/) +packages and other files. + + + +Using `import()` and `require()` within the callback requires version 5.15.0 or +greater of the +[`@cypress/webpack-preprocessor`](https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor). +This is included in Cypress by default, but if your project installs its own +version of `@cypress/webpack-preprocessor` that is set up in your Cypress +config, make sure it is version 5.15.0 or greater. + +If using an older version of the webpack or a different preprocessor, you'll see +an error that includes the following text: + +_Using require() or import() to include dependencies requires using the latest +version of @cypress/webpack-preprocessor._ + + + +#### Example ```js +// ES modules +cy.origin('somesite.com', async () => { + const _ = await import('lodash') + const utils = await import('../support/utils') + + // ... use lodash and utils ... +}) + +// CommonJS cy.origin('somesite.com', () => { - const _ = Cypress.require('lodash') - const utils = Cypress.require('../support/utils') + const _ = require('lodash') + const utils = require('../support/utils') // ... use lodash and utils ... }) ``` -`Cypress.require()` can be used to share custom commands between tests run in -primary and secondary origins. We recommend this pattern for setting up your +#### Custom commands + +This makes it possible to share custom commands between tests run in primary and +secondary origins. We recommend this pattern for setting up your [support file](/guides/core-concepts/writing-and-organizing-tests#Support-file) and setting up custom commands to run within the `cy.origin()` callback: @@ -561,7 +587,7 @@ before(() => { // calls in this spec. put it in your support file to make them available to // all specs cy.origin('somesite.com', () => { - Cypress.require('../support/commands') + require('../support/commands') }) }) @@ -573,6 +599,8 @@ it('tests somesite.com', () => { }) ``` +#### Shared execution context + The JavaScript execution context is persisted between `cy.origin()` callbacks that share the same origin. This can be utilized to share code between successive `cy.origin()` calls. @@ -582,7 +610,7 @@ before(() => { cy.origin('somesite.com', () => { // makes commands defined in this file available to all callbacks // for somesite.com - Cypress.require('../support/commands') + require('../support/commands') }) }) diff --git a/content/api/cypress-api/require.md b/content/api/cypress-api/require.md deleted file mode 100644 index f87b53b8f9..0000000000 --- a/content/api/cypress-api/require.md +++ /dev/null @@ -1,77 +0,0 @@ ---- -title: Cypress.require ---- - -`Cypress.require` enables utilizing dependencies within the -[`cy.origin()`](/api/commands/origin) callback function. It is used to require -modules such as [npm](https://www.npmjs.com/) packages and other local files. - -It is functionally the same as using -[CommonJS `require()`](https://nodejs.org/en/knowledge/getting-started/what-is-require/) -in browser-targeted code. - -## Syntax - -```js -Cypress.require(moduleId) -``` - -## Usage - -** Correct Usage** - -```js -cy.origin('somesite.com', () => { - const _ = Cypress.require('lodash') - const utils = Cypress.require('./utils') - - // ... use lodash and utils ... -}) -``` - -** Incorrect Usage** - -```js -// `Cypress.require()` cannot be used outside the `cy.origin()` callback. -// Use `require()` instead -const _ = Cypress.require('lodash') - -cy.origin('somesite.com', () => { - // `require()` cannot be used inside the `cy.origin()` callback. - // Use `Cypress.require()` instead - const _ = require('lodash') -}) - -// the callback must be inline and cannot be assigned to a variable for -// `Cypress.require()` to work -const callback = () => { - const _ = Cypress.require('lodash') -}) - -cy.origin('somesite.com', callback) -``` - -## Examples - -See -[`cy.origin()` Dependencies / Sharing Code](/api/commands/origin#Dependencies-Sharing-Code) -for example usages. - -## Limitations - -- `Cypress.require` only works when called within the - [`cy.origin()`](/api/commands/origin) callback function. It will error if used - elsewhere. -- `Cypress.require` only works in conjunction with the - [webpack preprocessor](https://www.npmjs.com/package/@cypress/webpack-preprocessor), - which is the default preprocessor for Cypress. If you have manually installed - and configured the webpack preprocessor, ensure you are using version `5.13.0` - or greater. -- For `Cypress.require` to work, the callback function must be written inline - with the `cy.origin()` call. The callback cannot be assigned to a variable. - -## History - -| Version | Changes | -| --------------------------------------------- | ----------------------- | -| [10.7.0](/guides/references/changelog#10-7-0) | `Cypress.require` added | diff --git a/cypress/fixtures/sidebar-overrides.json b/cypress/fixtures/sidebar-overrides.json index 6776822221..d8653b2086 100644 --- a/cypress/fixtures/sidebar-overrides.json +++ b/cypress/fixtures/sidebar-overrides.json @@ -34,7 +34,6 @@ "/api/cypress-api/iscy": "Cypress.isCy", "/api/cypress-api/cypress-log": "Cypress.log", "/api/cypress-api/platform": "Cypress.platform", - "/api/cypress-api/require": "Cypress.require", "/api/cypress-api/spec": "Cypress.spec", "/api/cypress-api/session": "Cypress.session", "/api/cypress-api/testing-type": "Cypress.testingType", From 68d26ead97be4da728f8c6b276822a466b77c5bb Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Mon, 24 Oct 2022 18:04:21 -0500 Subject: [PATCH 03/10] update documentations around test isolation (#4797) Co-authored-by: Matt Henkes Co-authored-by: Bill Glesias Co-authored-by: Ryan Manuel Co-authored-by: DEBRIS APRON --- content/api/commands/origin.md | 45 +++--- content/api/commands/session.md | 98 ++++++++----- content/api/cypress-api/session.md | 27 ++-- .../continuous-integration/aws-codebuild.md | 15 ++ .../writing-and-organizing-tests.md | 131 ++++++++++++++---- content/guides/overview/why-cypress.md | 10 +- content/guides/references/configuration.md | 4 +- content/guides/references/experiments.md | 8 +- 8 files changed, 231 insertions(+), 107 deletions(-) diff --git a/content/api/commands/origin.md b/content/api/commands/origin.md index 545a988782..468866ae4a 100755 --- a/content/api/commands/origin.md +++ b/content/api/commands/origin.md @@ -16,29 +16,28 @@ limitation determined by standard web security features of the browser. The Experimental -The `cy.origin()` command is currently experimental and can be enabled by -setting -the [`experimentalSessionAndOrigin`](/guides/references/experiments) flag -to `true` in the Cypress config. +The `session` API is currently experimental, and can be enabled by setting the +[`experimentalSessionAndOrigin`](/guides/references/experiments) option to +`true` in the Cypress config. Enabling this flag does the following: -- It adds the [`cy.session()`](/api/commands/session) and `cy.origin()` - commands, and [`Cypress.session`](/api/cypress-api/session) API. -- It adds the following new behaviors (that will be the default in a future - major version release of Cypress) at the beginning of each test: - - The page is cleared (by setting it to `about:blank`). - - All active session data (cookies, `localStorage` and `sessionStorage`) - across all domains are cleared. -- It supersedes - the [`Cypress.Cookies.preserveOnce()`](/api/cypress-api/cookies#Preserve-Once) and - [`Cypress.Cookies.defaults()`](/api/cypress-api/cookies#Defaults) methods. +- It adds the `cy.session()` and [`cy.origin()`](/api/commands/origin) commands, + and [`Cypress.session`](/api/cypress-api/session) API. +- It adds the concept of + [`testIsolation`](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) + which defaults to `on`, such that: + - The page is cleared (by setting it to `about:blank`). + - Cookies, local storage and session storage in all domains are cleared. +- It supersedes the + [`Cypress.Cookies.preserveOnce()`](/api/cypress-api/cookies#Preserve-Once) and + [`Cypress.Cookies.defaults()`](/api/cypress-api/cookies#Defaults) methods. - Cross-origin requests will now succeed, however, to interact with a cross-origin page you must use a `cy.origin` block. -Because the page is cleared before each -test, [`cy.visit()`](/api/commands/visit) must be explicitly called in each test -to visit a page in your application. +Because the page is cleared at the beginning of each test by default, +[`cy.visit()`](/api/commands/visit) must be explicitly called at the beginning +of each test. @@ -390,12 +389,12 @@ and reuse it across tests. Enabling the `experimentalSessionAndOrigin` flag makes the test-runner work slightly differently, and some test suites that rely on the existing behaviour -may have to be updated. The most important of these changes is **test -isolation**. This means that after every test, the current page is reset to -`about:blank` and all active session data -(cookies, `localStorage` and `sessionStorage`) across all domains are cleared. -This change is opt-in for now, but will be standardized in a future major -release of Cypress, so eventually all tests will need to be isolated. +may have to be updated. The most important of these changes is +[**test isolation**]() which defaults to `on`. This means that after every test, +the current page is reset to `about:blank` and cookies, local storage and +session storage in all domains are cleared before each test. This change is +opt-in for now, but will be standardized in a future major release of Cypress, +so eventually all tests will need to be isolated. Before this change, it was possible to write tests such that you could, for example, log in to a CMS in the first test, change some content in the second diff --git a/content/api/commands/session.md b/content/api/commands/session.md index 61e66e7d78..462014d1c2 100644 --- a/content/api/commands/session.md +++ b/content/api/commands/session.md @@ -7,7 +7,13 @@ Cache and restore [cookies](/api/cypress-api/cookies), [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), and [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) -in order to reduce test setup times. +(i.e. session data) in order to recreate a consistent browser context between +tests. + +The `cy.session()` command will inherit the +[`testIsolation`](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) +mode value to determine whether or not the page is cleared when caching and +restoring the browser context. @@ -22,21 +28,18 @@ Enabling this flag does the following: - It adds the `cy.session()` and [`cy.origin()`](/api/commands/origin) commands, and [`Cypress.session`](/api/cypress-api/session) API. -- It adds the following new behaviors (that will be the default in a future - major update of Cypress) at the beginning of each test: - - The page is cleared (by setting it to `about:blank`). Disable this by - setting - [`testIsolation=legacy`](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation). - - All active session data (cookies, `localStorage` and `sessionStorage`) - across all domains are cleared. -- It overrides the +- It adds the concept of + [`testIsolation`](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) + which defaults to `on`, such that: + - The page is cleared (by setting it to `about:blank`). + - Cookies, local storage and session storage in all domains are cleared. +- It supersedes the [`Cypress.Cookies.preserveOnce()`](/api/cypress-api/cookies#Preserve-Once) and [`Cypress.Cookies.defaults()`](/api/cypress-api/cookies#Defaults) methods. -- Cross-origin navigation will no longer fail immediately, but instead, time out - based on [`pageLoadTimeout`](/guides/references/configuration#Timeouts). -- Tests will no longer wait on page loads before moving on to the next test. +- Cross-origin requests will now succeed, however, to interact with a + cross-origin page you must use a `cy.origin` block. -Because the page is cleared at the beginning of each test, +Because the page is cleared at the beginning of each test by default, [`cy.visit()`](/api/commands/visit) must be explicitly called at the beginning of each test. @@ -129,8 +132,11 @@ runs, Cypress will preserve all cookies, `sessionStorage`, and `localStorage`, so that subsequent calls to `cy.session()` with the same `id` will bypass `setup` and just restore the cached session data. -The page and all active session data (cookies, `localStorage` and -`sessionStorage`) across all domains are always cleared before `setup` runs. +The page is cleared before `setup` when `testIsolation='on'` and is not cleared +when `testIsolation='off'`. + +Cookies, local storage and session storage in all domains are always cleared +before `setup` runs, regardless of the testIsolation configuration. ** options** **_(Object)_** @@ -332,10 +338,10 @@ describe('account details', () => { ### Switching sessions inside tests -Because `cy.session()` clears the page and all active session data before -running `setup`, you can use it to easily switch between sessions without first -needing to log the previous user out. This allows tests to more accurately -represent real-world scenarios and helps keep test run times short. +Because `cy.session()` clears the page and all session data before running +`setup`, you can use it to easily switch between sessions without first needing +to log the previous user out. This allows tests to more accurately represent +real-world scenarios and helps keep test run times short. ```jsx const login = (name) => { @@ -670,24 +676,46 @@ it('t3', () => { ## Notes -### When the page and active session data are cleared +### When the page and session data are cleared + +### Test Isolation `on` + +The page is cleared and cookies, local storage and session storage (session +data) in all domains are cleared automatically when `cy.session()` runs and +`testIsolation` is `on`. This guarantees consistent behavior whether a session +is being created or restored and allows you to switch sessions without first +having to explicitly log out. + +| | Page cleared (test) | Session data cleared | +| -------------------------- | :---------------------------------------------: | :---------------------------------------------: | +| Before `setup` | | | +| Before `validate` | | | +| Before `cy.session()` ends | | | + +[`cy.visit()`](/api/commands/visit) must be explicitly called afterwards to +ensure the page to test is loaded. + +### Test Isolation `off` + +When `testIsolation` is `off`, the page will not clear, however, the session +data will clear when `cy.session()` runs. + +| | Page cleared (test) | Session data cleared | +| -------------------------- | :-----------------: | :---------------------------------------------: | +| Before `setup` | | | +| Before `validate` | | | +| Before `cy.session()` ends | | | -The page is cleared and all active session data (cookies, `localStorage`, and -`sessionStorage`) across all domains are cleared automatically when -`cy.session()` runs. This guarantees consistent behavior whether a session is -being created or restored and allows you to switch sessions without first having -to explicitly log out. +[`cy.visit()`](/api/commands/visit) does not need to be called afterwards to +ensure the page to test is loaded. -| | Current page cleared | Active session data cleared | -| -------------------- | :---------------------------------------------: | :---------------------------------------------: | -| Before `setup` | | | -| Before `validate` | | | -| After `cy.session()` | | | +NOTE: Turning test isolation off may improve performance of end-to-end tests, +however, previous tests could impact the browser state of the next test and +cause inconsistency when using .only(). Be mindful to write isolated tests when +test isolation is off. -Calling `cy.session()` clears the current page in addition to restoring the -cached session data. [`cy.visit()`](/api/commands/visit) must be explicitly -called afterwards to ensure a page is visited if you did not provide a -`validate` function that called `cy.visit()`. +When test isolation is `off`, it is encouraged to setup your session in a before +hook or in the first test to ensure a clean setup. ### Session caching @@ -881,7 +909,7 @@ that were run when creating and/or validating the session. In this image, a saved session is restored, but when `/personal` is visited in the `validate` function, the app redirects to `/signin`, which invalidates the session. A new session is created by visiting `/signin` where the user is logged -in, after which, validation succeeds, and the session is made active for the +in, after which, validation succeeds, and the session is available for the remainder of the test. diff --git a/content/api/cypress-api/session.md b/content/api/cypress-api/session.md index a7497d26f0..4e751e29e3 100644 --- a/content/api/cypress-api/session.md +++ b/content/api/cypress-api/session.md @@ -11,26 +11,27 @@ be used alongside the [`cy.session()`](/api/commands/session) command. Experimental The `session` API is currently experimental, and can be enabled by setting the -[`experimentalSessionSupport`](/guides/references/experiments) flag to `true` in -the Cypress config or by using [`Cypress.config()`](/api/cypress-api/config) at -the top of a spec file. +[`experimentalSessionAndOrigin`](/guides/references/experiments) option to +`true` in the Cypress config. Enabling this flag does the following: -- It adds the [`cy.session()`](/api/commands/session) command for use in tests. -- It adds the [`Cypress.session`](/api/cypress-api/session) API. -- It adds the following new behaviors (that will be the default in a future - major update of Cypress) at the beginning of each test: +- It adds the `cy.session()` and [`cy.origin()`](/api/commands/origin) commands, + and [`Cypress.session`](/api/cypress-api/session) API. +- It adds the concept of + [`testIsolation`](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) + which defaults to `on`, such that: - The page is cleared (by setting it to `about:blank`). - - All active session data (cookies, `localStorage` and `sessionStorage`) - across all domains are cleared. -- It overrides the + - Cookies, local storage and session storage in all domains are cleared. +- It supersedes the [`Cypress.Cookies.preserveOnce()`](/api/cypress-api/cookies#Preserve-Once) and [`Cypress.Cookies.defaults()`](/api/cypress-api/cookies#Defaults) methods. +- Cross-origin requests will now succeed, however, to interact with a + cross-origin page you must use a `cy.origin` block. -Because the page is cleared before each test, -[`cy.visit()`](/api/commands/visit) must be explicitly called in each test to -visit a page in your application. +Because the page is cleared at the beginning of each test by default, +[`cy.visit()`](/api/commands/visit) must be explicitly called at the beginning +of each test. diff --git a/content/guides/continuous-integration/aws-codebuild.md b/content/guides/continuous-integration/aws-codebuild.md index d18e0e6ba1..e2c9939991 100644 --- a/content/guides/continuous-integration/aws-codebuild.md +++ b/content/guides/continuous-integration/aws-codebuild.md @@ -413,6 +413,21 @@ phases: ## Using the Cypress Dashboard with AWS CodeBuild + + +Dashboard analytics are dependent on your CI environment reliably providing +commit SHA data (typically via an environment variable) which is not always +present by default. This is not a problem for most users, but if you are facing +integration issues with your CodeBuild setup, please make sure the git +information is being sent properly by following +[these guidelines](/guides/continuous-integration/introduction#Git-information), +or just see +[the example `codebuild.yml` file at the top of this page](#Basic-Setup). If you +are still facing issues after this, please +[contact us](mailto:hello@cypress.io). + + + In the AWS CodeBuild configuration we have defined in the previous section, we are leveraging three useful features of the [Cypress Dashboard](https://on.cypress.io/dashboard): diff --git a/content/guides/core-concepts/writing-and-organizing-tests.md b/content/guides/core-concepts/writing-and-organizing-tests.md index b0c148a9c5..ee5773e2f9 100644 --- a/content/guides/core-concepts/writing-and-organizing-tests.md +++ b/content/guides/core-concepts/writing-and-organizing-tests.md @@ -564,62 +564,135 @@ it.skip('returns "fizz" when number is multiple of 3', () => { ### Test Isolation - + + + +Experimental - **Best Practice:** Clean up -state **before** tests run. +The concept of test isolation is currently experimental, and can be enabled by +setting the [`experimentalSessionAndOrigin`](/guides/references/experiments) +option to `true` in the Cypress config. -Test isolation is the practice of resetting application state _before_ each -test. + -Cleaning up state ensures that the operation of one test does not affect another -test later on. The goal for each test should be to reliably pass whether run in -isolation or consecutively with other tests. Having tests that depend on the -state of an earlier test can potentially cause nondeterministic test failures. + **Best Practice:** Tests should +always be able to be run independently from one another **and still pass**. -Cypress supports two modes of test isolation, `legacy` and `strict`. + -#### Legacy Mode +As stated in our mission, we hold ourselves accountable to champion a testing +process that actually works, and have built Cypress to guide developers towards +writing independent tests from the start. -When in `legacy` mode, Cypress handles resetting the state for: +We do this by cleaning up state _before_ each test to ensure that the operation +of one test does not affect another test later on. The goal for each test should +be to **reliably pass** whether run in isolation or consecutively with other +tests. Having tests that depend on the state of an earlier test can potentially +cause nondeterministic test failures which makes debugging challenging. + +Cypress will start each test with a clean test slate by restoring and clearing +all: - [aliases](/api/commands/as) -- [cookies](/api/commands/clearcookies) -- [clock](/api/commands/clock) -- [intercept](/api/commands/intercept) -- [localStorage](/api/commands/clearlocalstorage) +- [clock mocks](/api/commands/clock) +- [intercepts](/api/commands/intercept) - [routes](/api/commands/route) -- [sessions](/api/commands/session) - [spies](/api/commands/spy) - [stubs](/api/commands/stub) -- [viewport](/api/commands/viewport) +- [viewport changes](/api/commands/viewport) + +In additional to a clean test slate, Cypress also believes in running tests in a +clean browser context such that the application or component under test behaves +consistently when ran. This concept is described as `testIsolation`. -#### Strict Mode +The test isolation mode is a global configuration and can be overridden at the +`describe` level with the +[`testIsolation`](/guides/references/configuration#Global) option. + +#### End-to-end testing + +Cypress supports the following modes of test isolation in end-to-end testing to +describe if a suite of tests should run in a clean browser context or not: `on` +and `off`. + +###### On Mode Experimental -`strict` mode is currently experimental and can be enabled by setting +`on` mode is currently experimental and can be enabled by setting the [`experimentalSessionAndOrigin`](/guides/references/experiments) flag to `true` in the Cypress config. This is the default test isolation behavior when using the `experimentalSessionAndOrigin` experiment. -When in `strict` mode, Cypress handles resetting the state for everything -outlined above for `legacy` mode, in addition to clearing the page by visiting -`about:blank` before each test. This clears the dom's state and non-persistent -browser state. This forces you to re-visit your application and perform the -series of interactions needed to build the dom and browser state so the tests -can reliably pass when run standalone or in a randomized order. +When in `on` mode, Cypress resets the browser context _before_ each test by: -The test isolation mode is a global configuration and can be overridden at the -`describe` level with the -[`testIsolation`](/guides/references/configuration#Global) option. +- clearing the dom state by visiting `about:blank` +- clearing [cookies](/api/cypress-api/cookies) in all domains +- clearing + [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) + in all domains +- clearing + [`sessionStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage) + in all domains + +Because the test starts in a fresh browser context, you must re-visit your +application and perform the series of interactions needed to build the dom and +browser state for each test. + +Additionally, the `cy.session()` command will inherent this mode and will clear +the page and current browser context when establishing a browser session. This +is so tests can reliably pass when run standalone or in a randomized order. + +###### Off Mode + + + + +Experimental + +`off` mode is currently experimental and can be enabled by setting +the [`experimentalSessionAndOrigin`](/guides/references/experiments) flag +to `true` in the Cypress config. + + + +When in `off` mode, Cypress will not alter the browser context before the test +starts. The page does not clear between tests and cookies, local storage and +session storage will be available across tests in that suite. Additionally, the +`cy.session()` command will only clear the current browser context when +establishing the browser session - the current page will not clear. + +It is important to note that turning test isolation `off` may improve the +overall performance of end-to-end tests, however, previous tests could be impact +the browser state. It is important to be extremely mindful of how test are +written when using this mode and ensure tests continue to run independent from +one other. + +###### Mode Comparison + +| testIsolation | beforeEach test | cy.session() | +| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ | +| `on` | - clears page by visiting `about:blank`
- clears cookies in all domains
- local storage in all domains
- session storage in all domains | - clears page by visiting `about:blank`
- clears cookies in all domains
- local storage in all domains
- session storage in all domains | +| `off` | does not alter the current browser context |
- clears cookies in all domains
- local storage in all domains
- session storage in all domains | + +##### Component testing + +Cypress only support testIsolation `on` in component testing. + +When running component tests, the browser context will allow start in a clean +slate because Cypress will + +- clear the page +- clear [cookies](/api/cypress-api/cookies) +- clear + [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) ### Test Configuration diff --git a/content/guides/overview/why-cypress.md b/content/guides/overview/why-cypress.md index 06f96f5302..67f237f572 100644 --- a/content/guides/overview/why-cypress.md +++ b/content/guides/overview/why-cypress.md @@ -114,10 +114,18 @@ 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. + or videos of your entire test suite when run from the CLI. Record to the + [Dashboard](/guides/dashboard/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 [optimally in a Continuous Integration pipeline](/guides/guides/cross-browser-testing). +- **Smart Orchestration:** Once you're set up to record to the Dashboard, easily + [parallelize](/guides/guides/parallelization) your test suite and + [rerun failed specs first](/guides/dashboard/smart-orchestration#Run-failed-specs-first) + for tight feedback loops. +- **Flake Detection:** Discover and diagnose unreliable tests with the + Dashboard's [Flaky test management](/guides/dashboard/flaky-test-management). ### Setting up tests diff --git a/content/guides/references/configuration.md b/content/guides/references/configuration.md index ee1dd53c9d..71b7a76607 100644 --- a/content/guides/references/configuration.md +++ b/content/guides/references/configuration.md @@ -207,9 +207,9 @@ object: | `supportFile` | `cypress/support/e2e.{js,jsx,ts,tsx}` | Path to file to load before spec files load. This file is compiled and bundled. (Pass `false` to disable) | | `specPattern` | `cypress/e2e/**/*.cy.{js,jsx,ts,tsx}` | A String or Array of glob patterns of the test files to load. | | `excludeSpecPattern` | `*.hot-update.js` | A String or Array of glob patterns used to ignore test files that would otherwise be shown in your list of tests. [Please read the notes on using this.](#excludeSpecPattern) | -| `experimentalSessionAndOrigin` | `false` | Enables cross-origin and improved session support, including the [`cy.origin()`](/api/commands/origin) and [`cy.session()`](/api/commands/session) commands. This enables `testIsolation=strict` by default. Only available in end-to-end testing. | +| `experimentalSessionAndOrigin` | `false` | Enables cross-origin and improved session support, including the [`cy.origin()`](/api/commands/origin) and [`cy.session()`](/api/commands/session) commands. This enables `testIsolation=on` by default. Only available in end-to-end testing. | | `slowTestThreshold` | `10000` | Time, in milliseconds, to consider a test "slow" during `cypress run`. A slow test will display in orange text in the default reporter. | -| `testIsolation` | `legacy` | The [test isolation level](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) applied to ensure a clean slate between tests. | +| `testIsolation` | null | The [test isolation level](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) applied to ensure a clean slate between tests. This option is only available when `experimentalSessionAndOrigin=true`, then it defaults to `on`. Options are `on` or `off`. | :::cypress-config-example{noJson} diff --git a/content/guides/references/experiments.md b/content/guides/references/experiments.md index 35866e4a88..f2c759d500 100644 --- a/content/guides/references/experiments.md +++ b/content/guides/references/experiments.md @@ -39,10 +39,10 @@ creating `e2e` and `component` objects inside your Cypress configuration. These experiments are available to be specified inside the `e2e` configuration object: -| Option | Default | Description | -| ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `experimentalSessionAndOrigin` | `false` | Enables cross-origin and improved session support, including the [`cy.origin()`](/api/commands/origin) and [`cy.session()`](/api/commands/session) commands. This enables `testIsolation=strict` by default. | -| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. | +| Option | Default | Description | +| ------------------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `experimentalSessionAndOrigin` | `false` | Enables cross-origin and improved session support, by adding the [`cy.origin()`](/api/commands/origin) and [`cy.session()`](/api/commands/session) commands. This also enables the concept of [Test Isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation), which is `on` by default. | +| `experimentalStudio` | `false` | Generate and save commands directly to your test suite by interacting with your app as an end user would. | ### Component Testing From 6dcbf6d3935593aca95b91f36e8f7e57d1c7b1e2 Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 12:29:36 -0400 Subject: [PATCH 04/10] Updating changelog --- content/_changelogs/10.11.0.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index 6dafe326f7..b27eab9ddc 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -4,6 +4,27 @@ _Released 10/25/2022_ **Features:** -- `cy.origin()` now supports using `require()` and dynamic `import()` to include +- [`cy.origin()`](/api/commands/origin) now supports using `require()` and dynamic `import()` to include dependencies. `Cypress.require()` has been removed. Addresses [#24293](https://github.com/cypress-io/cypress/issues/24293). +- Adds support for [`cy.session()`](/api/commands/session) to experimental WebKit. +Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able to run against webkit. Addresses [#24116](https://github.com/cypress-io/cypress/issues/24116), [#23832](https://github.com/cypress-io/cypress/issues/23832). +- Improves user experience when connecting a project to the Dashboard. Addresses [#23379](https://github.com/cypress-io/cypress/issues/23379), [#23766](https://github.com/cypress-io/cypress/issues/23766), [#23767](https://github.com/cypress-io/cypress/issues/23767). + - Users can now connect a project to the Dashboard when logging in from the Cypress Launchpad after a testing type has been selected. + - Users will be prompted to record runs to the Dashboard from both the Cypress App and Cypress Launchpad if a project is connected to the Dashboard and has no recorded runs. + +**Bugfixes:** + +- Fixed issue connecting to the cloud when a self-signed cert was in the cert chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). +- The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). + - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. + - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. +- The behavior and implementation of the experimental strict test isolation mode has been evaluated per user feedback. strict mode has been replaced test isolation on and off modes, with on mode being the default behavior observed when experimentalSessionAndOrigin=true and the cy.session() command now inherits the test isolation behavior for the suite it runs in. When enabled, legacy mode is not longer a valid mode and to persist the browser context between tests off mode can be used. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). +- [`cy.origin()`](/api/commands/origin) now supports > 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). +- Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes [#23531](https://github.com/cypress-io/cypress/issues/23531) +- Fixed as issue where browser-skipped tests were incorrectly recorded to the Dashboard which resulted in the Dashboard marking the test as "new" or "modified" when it already existed. Fixes [#23517](https://github.com/cypress-io/cypress/issues/23517). +- Cypress will now restart on changes to the `blockHosts` configuration entry. Fixes [#22634](https://github.com/cypress-io/cypress/issues/22634). +- When shown the command to record runs to the cloud, the user can select and copy parts of the command (like the record key), instead of only being able to use the "Copy" button to copy the entire command. Fixes [#22091](https://github.com/cypress-io/cypress/issues/22091). +- Cleaned up inconsistencies in the UI between sentence case and title case. Fixes [#21854](https://github.com/cypress-io/cypress/issues/21854). +- Fixed an issue where there is a visible "Project ID" section (with no `projectId`) when user has not connected to the Dashboard. [#21806](https://github.com/cypress-io/cypress/issues/21806). +- When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move on to the next. [#6170](https://github.com/cypress-io/cypress/issues/6170). From 2181181962a7b40ed1c2d0cf5833bdaf6c6dee5d Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 12:45:12 -0400 Subject: [PATCH 05/10] Removing duplicate changelog entry --- content/_changelogs/10.11.0.md | 1 - 1 file changed, 1 deletion(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index b27eab9ddc..f0a59149db 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -19,7 +19,6 @@ Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able t - The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. -- The behavior and implementation of the experimental strict test isolation mode has been evaluated per user feedback. strict mode has been replaced test isolation on and off modes, with on mode being the default behavior observed when experimentalSessionAndOrigin=true and the cy.session() command now inherits the test isolation behavior for the suite it runs in. When enabled, legacy mode is not longer a valid mode and to persist the browser context between tests off mode can be used. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). - [`cy.origin()`](/api/commands/origin) now supports > 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). - Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes [#23531](https://github.com/cypress-io/cypress/issues/23531) - Fixed as issue where browser-skipped tests were incorrectly recorded to the Dashboard which resulted in the Dashboard marking the test as "new" or "modified" when it already existed. Fixes [#23517](https://github.com/cypress-io/cypress/issues/23517). From 7f3221c2c64215c232787b2bd56d3292c0ab971c Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 12:48:15 -0400 Subject: [PATCH 06/10] Update content/_changelogs/10.11.0.md Co-authored-by: Matt Henkes --- content/_changelogs/10.11.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index f0a59149db..df93aa6ba6 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -19,7 +19,7 @@ Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able t - The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. -- [`cy.origin()`](/api/commands/origin) now supports > 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). +- [`cy.origin()`](/api/commands/origin) now supports more than 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). - Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes [#23531](https://github.com/cypress-io/cypress/issues/23531) - Fixed as issue where browser-skipped tests were incorrectly recorded to the Dashboard which resulted in the Dashboard marking the test as "new" or "modified" when it already existed. Fixes [#23517](https://github.com/cypress-io/cypress/issues/23517). - Cypress will now restart on changes to the `blockHosts` configuration entry. Fixes [#22634](https://github.com/cypress-io/cypress/issues/22634). From 2d8eb50c5cd7cf8ae62473e891090861a19aa293 Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 13:10:31 -0400 Subject: [PATCH 07/10] Adding "Experimental Breaking Changes" section --- content/_changelogs/10.11.0.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index df93aa6ba6..d02b7cd59c 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -4,9 +4,6 @@ _Released 10/25/2022_ **Features:** -- [`cy.origin()`](/api/commands/origin) now supports using `require()` and dynamic `import()` to include - dependencies. `Cypress.require()` has been removed. Addresses - [#24293](https://github.com/cypress-io/cypress/issues/24293). - Adds support for [`cy.session()`](/api/commands/session) to experimental WebKit. Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able to run against webkit. Addresses [#24116](https://github.com/cypress-io/cypress/issues/24116), [#23832](https://github.com/cypress-io/cypress/issues/23832). - Improves user experience when connecting a project to the Dashboard. Addresses [#23379](https://github.com/cypress-io/cypress/issues/23379), [#23766](https://github.com/cypress-io/cypress/issues/23766), [#23767](https://github.com/cypress-io/cypress/issues/23767). @@ -15,10 +12,6 @@ Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able t **Bugfixes:** -- Fixed issue connecting to the cloud when a self-signed cert was in the cert chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). -- The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). - - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. - - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. - [`cy.origin()`](/api/commands/origin) now supports more than 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). - Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes [#23531](https://github.com/cypress-io/cypress/issues/23531) - Fixed as issue where browser-skipped tests were incorrectly recorded to the Dashboard which resulted in the Dashboard marking the test as "new" or "modified" when it already existed. Fixes [#23517](https://github.com/cypress-io/cypress/issues/23517). @@ -27,3 +20,13 @@ Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able t - Cleaned up inconsistencies in the UI between sentence case and title case. Fixes [#21854](https://github.com/cypress-io/cypress/issues/21854). - Fixed an issue where there is a visible "Project ID" section (with no `projectId`) when user has not connected to the Dashboard. [#21806](https://github.com/cypress-io/cypress/issues/21806). - When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move on to the next. [#6170](https://github.com/cypress-io/cypress/issues/6170). + +**Experimental Breaking Changes:** + +- [`cy.origin()`](/api/commands/origin) now supports using `require()` and dynamic `import()` to include + dependencies. `Cypress.require()` has been removed. Addresses + [#24293](https://github.com/cypress-io/cypress/issues/24293). +- Fixed issue connecting to the cloud when a self-signed cert was in the cert chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). +- The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). + - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. + - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. \ No newline at end of file From 6b6e5421e0c377c6dcf2191a4357f17c2960e5b5 Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 13:26:56 -0400 Subject: [PATCH 08/10] Moving one issue in changelog and running prettier --- content/_changelogs/10.11.0.md | 72 +++++++++++++++++++++++++--------- 1 file changed, 53 insertions(+), 19 deletions(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index d02b7cd59c..9d967ca28b 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -4,29 +4,63 @@ _Released 10/25/2022_ **Features:** -- Adds support for [`cy.session()`](/api/commands/session) to experimental WebKit. -Ensures that with `experimentalSessionAndOrigin` enabled, tests are still able to run against webkit. Addresses [#24116](https://github.com/cypress-io/cypress/issues/24116), [#23832](https://github.com/cypress-io/cypress/issues/23832). -- Improves user experience when connecting a project to the Dashboard. Addresses [#23379](https://github.com/cypress-io/cypress/issues/23379), [#23766](https://github.com/cypress-io/cypress/issues/23766), [#23767](https://github.com/cypress-io/cypress/issues/23767). - - Users can now connect a project to the Dashboard when logging in from the Cypress Launchpad after a testing type has been selected. - - Users will be prompted to record runs to the Dashboard from both the Cypress App and Cypress Launchpad if a project is connected to the Dashboard and has no recorded runs. +- Adds support for [`cy.session()`](/api/commands/session) to experimental + WebKit. Ensures that with `experimentalSessionAndOrigin` enabled, tests are + still able to run against webkit. Addresses + [#24116](https://github.com/cypress-io/cypress/issues/24116), + [#23832](https://github.com/cypress-io/cypress/issues/23832). +- Improves user experience when connecting a project to the Dashboard. Addresses + [#23379](https://github.com/cypress-io/cypress/issues/23379), + [#23766](https://github.com/cypress-io/cypress/issues/23766), + [#23767](https://github.com/cypress-io/cypress/issues/23767). + - Users can now connect a project to the Dashboard when logging in from the + Cypress Launchpad after a testing type has been selected. + - Users will be prompted to record runs to the Dashboard from both the Cypress + App and Cypress Launchpad if a project is connected to the Dashboard and has + no recorded runs. **Bugfixes:** -- [`cy.origin()`](/api/commands/origin) now supports more than 30 unique origin spec bridges per test. Fixes [#22874](https://github.com/cypress-io/cypress/issues/22874), [#23967](https://github.com/cypress-io/cypress/issues/23967). -- Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes [#23531](https://github.com/cypress-io/cypress/issues/23531) -- Fixed as issue where browser-skipped tests were incorrectly recorded to the Dashboard which resulted in the Dashboard marking the test as "new" or "modified" when it already existed. Fixes [#23517](https://github.com/cypress-io/cypress/issues/23517). -- Cypress will now restart on changes to the `blockHosts` configuration entry. Fixes [#22634](https://github.com/cypress-io/cypress/issues/22634). -- When shown the command to record runs to the cloud, the user can select and copy parts of the command (like the record key), instead of only being able to use the "Copy" button to copy the entire command. Fixes [#22091](https://github.com/cypress-io/cypress/issues/22091). -- Cleaned up inconsistencies in the UI between sentence case and title case. Fixes [#21854](https://github.com/cypress-io/cypress/issues/21854). -- Fixed an issue where there is a visible "Project ID" section (with no `projectId`) when user has not connected to the Dashboard. [#21806](https://github.com/cypress-io/cypress/issues/21806). -- When a chromium based browser tab or process crashes, Cypress will no longer hang indefinitely but will fail the current test and move on to the next. [#6170](https://github.com/cypress-io/cypress/issues/6170). +- Fixed issue connecting to the cloud when a self-signed cert was in the cert + chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). +- [`cy.origin()`](/api/commands/origin) now supports more than 30 unique origin + spec bridges per test. Fixes + [#22874](https://github.com/cypress-io/cypress/issues/22874), + [#23967](https://github.com/cypress-io/cypress/issues/23967). +- Fixed an issue where `document.cookie` would not reflect the correct value in + cross-origin tests. Fixes + [#23531](https://github.com/cypress-io/cypress/issues/23531) +- Fixed as issue where browser-skipped tests were incorrectly recorded to the + Dashboard which resulted in the Dashboard marking the test as "new" or + "modified" when it already existed. Fixes + [#23517](https://github.com/cypress-io/cypress/issues/23517). +- Cypress will now restart on changes to the `blockHosts` configuration entry. + Fixes [#22634](https://github.com/cypress-io/cypress/issues/22634). +- When shown the command to record runs to the cloud, the user can select and + copy parts of the command (like the record key), instead of only being able to + use the "Copy" button to copy the entire command. Fixes + [#22091](https://github.com/cypress-io/cypress/issues/22091). +- Cleaned up inconsistencies in the UI between sentence case and title case. + Fixes [#21854](https://github.com/cypress-io/cypress/issues/21854). +- Fixed an issue where there is a visible "Project ID" section (with no + `projectId`) when user has not connected to the Dashboard. + [#21806](https://github.com/cypress-io/cypress/issues/21806). +- When a chromium based browser tab or process crashes, Cypress will no longer + hang indefinitely but will fail the current test and move on to the next. + [#6170](https://github.com/cypress-io/cypress/issues/6170). **Experimental Breaking Changes:** -- [`cy.origin()`](/api/commands/origin) now supports using `require()` and dynamic `import()` to include - dependencies. `Cypress.require()` has been removed. Addresses +- [`cy.origin()`](/api/commands/origin) now supports using `require()` and + dynamic `import()` to include dependencies. `Cypress.require()` has been + removed. Addresses [#24293](https://github.com/cypress-io/cypress/issues/24293). -- Fixed issue connecting to the cloud when a self-signed cert was in the cert chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). -- The way that Cypress handles [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) has changed. The previous modes of `legacy` and `strict` have been replaced with `on` and `off`. Fixes [#24206](https://github.com/cypress-io/cypress/issues/24206). - - The default mode is `on` when [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. - - The [cy.session()](/api/commands/session) command now inherits the test isolation behavior for the suite it runs in. \ No newline at end of file +- The way that Cypress handles + [test isolation](/guides/core-concepts/writing-and-organizing-tests#Test-Isolation) + has changed. The previous modes of `legacy` and `strict` have been replaced + with `on` and `off`. Fixes + [#24206](https://github.com/cypress-io/cypress/issues/24206). + - The default mode is `on` when + [`experimentalSessionAndOrigin`](/guides/references/experiments) is enabled. + - The [cy.session()](/api/commands/session) command now inherits the test + isolation behavior for the suite it runs in. From 9112e3447edaa2b3b2fcde199c0e5106459a2f24 Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 13:41:13 -0400 Subject: [PATCH 09/10] Moving a few items around in the changelog --- content/_changelogs/10.11.0.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index 9d967ca28b..319a57ab97 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -13,14 +13,21 @@ _Released 10/25/2022_ [#23379](https://github.com/cypress-io/cypress/issues/23379), [#23766](https://github.com/cypress-io/cypress/issues/23766), [#23767](https://github.com/cypress-io/cypress/issues/23767). - - Users can now connect a project to the Dashboard when logging in from the - Cypress Launchpad after a testing type has been selected. + - Users will be prompted to connect a project to the Dashboard when logging in + from the Cypress Launchpad after a testing type has been selected. - Users will be prompted to record runs to the Dashboard from both the Cypress App and Cypress Launchpad if a project is connected to the Dashboard and has no recorded runs. **Bugfixes:** +- When a chromium based browser tab or process crashes, Cypress will no longer + hang indefinitely but will fail the current test and move on to the next. + [#6170](https://github.com/cypress-io/cypress/issues/6170). +- Fixed as issue where browser-skipped tests were incorrectly recorded to the + Dashboard which resulted in the Dashboard marking the test as "new" or + "modified" when it already existed. Fixes + [#23517](https://github.com/cypress-io/cypress/issues/23517). - Fixed issue connecting to the cloud when a self-signed cert was in the cert chain. Fixes [#24298](https://github.com/cypress-io/cypress/issues/24298). - [`cy.origin()`](/api/commands/origin) now supports more than 30 unique origin @@ -29,11 +36,7 @@ _Released 10/25/2022_ [#23967](https://github.com/cypress-io/cypress/issues/23967). - Fixed an issue where `document.cookie` would not reflect the correct value in cross-origin tests. Fixes - [#23531](https://github.com/cypress-io/cypress/issues/23531) -- Fixed as issue where browser-skipped tests were incorrectly recorded to the - Dashboard which resulted in the Dashboard marking the test as "new" or - "modified" when it already existed. Fixes - [#23517](https://github.com/cypress-io/cypress/issues/23517). + [#23531](https://github.com/cypress-io/cypress/issues/23531). - Cypress will now restart on changes to the `blockHosts` configuration entry. Fixes [#22634](https://github.com/cypress-io/cypress/issues/22634). - When shown the command to record runs to the cloud, the user can select and @@ -45,9 +48,6 @@ _Released 10/25/2022_ - Fixed an issue where there is a visible "Project ID" section (with no `projectId`) when user has not connected to the Dashboard. [#21806](https://github.com/cypress-io/cypress/issues/21806). -- When a chromium based browser tab or process crashes, Cypress will no longer - hang indefinitely but will fail the current test and move on to the next. - [#6170](https://github.com/cypress-io/cypress/issues/6170). **Experimental Breaking Changes:** From 4cd8afcb40f04ea5f849d60a041de5cdec5ce6c4 Mon Sep 17 00:00:00 2001 From: Stokes Player Date: Tue, 25 Oct 2022 13:47:40 -0400 Subject: [PATCH 10/10] Updating changelog copy for cy.session support in Webkit --- content/_changelogs/10.11.0.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/_changelogs/10.11.0.md b/content/_changelogs/10.11.0.md index 319a57ab97..889a20ce09 100644 --- a/content/_changelogs/10.11.0.md +++ b/content/_changelogs/10.11.0.md @@ -4,9 +4,9 @@ _Released 10/25/2022_ **Features:** -- Adds support for [`cy.session()`](/api/commands/session) to experimental - WebKit. Ensures that with `experimentalSessionAndOrigin` enabled, tests are - still able to run against webkit. Addresses +- [`cy.session()`](/api/commands/session) is now supported when using + [WebKit (Experimental)](https://docs.cypress.io/guides/guides/launching-browsers#WebKit-Experimental) + and `experimentalSessionAndOrigin` is enabled. Addresses [#24116](https://github.com/cypress-io/cypress/issues/24116), [#23832](https://github.com/cypress-io/cypress/issues/23832). - Improves user experience when connecting a project to the Dashboard. Addresses