From 6a21845d0bee87320a44fa9850b8b0ec77fde53b Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Tue, 7 Mar 2023 10:29:49 -0600 Subject: [PATCH 1/5] Update using-cypress-faq.mdx --- docs/faq/questions/using-cypress-faq.mdx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/faq/questions/using-cypress-faq.mdx b/docs/faq/questions/using-cypress-faq.mdx index 84707f8bb3..f6878bad74 100644 --- a/docs/faq/questions/using-cypress-faq.mdx +++ b/docs/faq/questions/using-cypress-faq.mdx @@ -727,12 +727,15 @@ expand the APIs to support "switching into" an iframe and then back out of them. ## How do I preserve cookies / localStorage in between my tests? By default, Cypress automatically -[clears all cookies **before** each test](/api/commands/clearcookies) to prevent -state from building up. +[clears all cookies, local storage and session **before** each test](/guides/core-concepts/test-isolation) +to prevent state from leaking between tests. You can preserve session details across tests using the [`cy.session()`](/api/commands/session) command. +Alternatively, you can disabled [`testIsolation`](/guides/references/configuration#e2e) +at the suite or e2e configuration-level to prevent the clearing of browser state. + ## Some of my elements animate in; how do I work around that? Oftentimes you can usually account for animation by asserting From afb9ac90516a4e6b87d9a1a1c5a16dc12f6d3b71 Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Tue, 7 Mar 2023 10:37:58 -0600 Subject: [PATCH 2/5] Update test-isolation.md --- docs/guides/core-concepts/test-isolation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/core-concepts/test-isolation.md b/docs/guides/core-concepts/test-isolation.md index 83ac89f357..a33d4d98b4 100644 --- a/docs/guides/core-concepts/test-isolation.md +++ b/docs/guides/core-concepts/test-isolation.md @@ -17,7 +17,7 @@ sidebar_position: 35 :::tip - **Best Practice:** Tests should +  **Best Practice:** Tests should always be able to be run independently from one another **and still pass**. ::: From 38cd973ca12a2eb8703cb560d2bfe84e88c0a4ed Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Tue, 7 Mar 2023 10:43:54 -0600 Subject: [PATCH 3/5] Update test-isolation.md --- docs/guides/core-concepts/test-isolation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/core-concepts/test-isolation.md b/docs/guides/core-concepts/test-isolation.md index a33d4d98b4..9ad716807e 100644 --- a/docs/guides/core-concepts/test-isolation.md +++ b/docs/guides/core-concepts/test-isolation.md @@ -48,7 +48,7 @@ consistently when ran. This behavior is described as `testIsolation`. The test isolation is a global configuration and can be overridden for end-to-end testing at the `describe` level with the -[`testIsolation`](/guides/references/configuration#Global) option. +[`testIsolation`](/guides/references/configuration#e2e) option. ## Test Isolation in End-to-End Testing From de174156f331939dce8cb4f1f3ea15d0e28305af Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Tue, 14 Mar 2023 14:36:27 -0500 Subject: [PATCH 4/5] prettier --- docs/faq/questions/using-cypress-faq.mdx | 5 +++-- docs/guides/core-concepts/test-isolation.md | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/faq/questions/using-cypress-faq.mdx b/docs/faq/questions/using-cypress-faq.mdx index f6878bad74..3a088bc95f 100644 --- a/docs/faq/questions/using-cypress-faq.mdx +++ b/docs/faq/questions/using-cypress-faq.mdx @@ -733,8 +733,9 @@ to prevent state from leaking between tests. You can preserve session details across tests using the [`cy.session()`](/api/commands/session) command. -Alternatively, you can disabled [`testIsolation`](/guides/references/configuration#e2e) -at the suite or e2e configuration-level to prevent the clearing of browser state. +Alternatively, you can disabled +[`testIsolation`](/guides/references/configuration#e2e) at the suite or e2e +configuration-level to prevent the clearing of browser state. ## Some of my elements animate in; how do I work around that? diff --git a/docs/guides/core-concepts/test-isolation.md b/docs/guides/core-concepts/test-isolation.md index 9ad716807e..d6d943d3c3 100644 --- a/docs/guides/core-concepts/test-isolation.md +++ b/docs/guides/core-concepts/test-isolation.md @@ -17,8 +17,9 @@ sidebar_position: 35 :::tip -  **Best Practice:** Tests should -always be able to be run independently from one another **and still pass**. +  **Best Practice:** Tests +should always be able to be run independently from one another **and still +pass**. ::: From 980c8450d068068441d9d54e69e4ae941f4bb7f2 Mon Sep 17 00:00:00 2001 From: Emily Rohrbough Date: Wed, 22 Mar 2023 10:27:38 -0500 Subject: [PATCH 5/5] Update docs/faq/questions/using-cypress-faq.mdx Co-authored-by: Bill Glesias --- docs/faq/questions/using-cypress-faq.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq/questions/using-cypress-faq.mdx b/docs/faq/questions/using-cypress-faq.mdx index 58b4044661..cee03808d5 100644 --- a/docs/faq/questions/using-cypress-faq.mdx +++ b/docs/faq/questions/using-cypress-faq.mdx @@ -733,7 +733,7 @@ to prevent state from leaking between tests. You can preserve session details across tests using the [`cy.session()`](/api/commands/session) command. -Alternatively, you can disabled +Alternatively, you can disable [`testIsolation`](/guides/references/configuration#e2e) at the suite or e2e configuration-level to prevent the clearing of browser state.