diff --git a/docs/accessibility/configuration/viewfilters.mdx b/docs/accessibility/configuration/viewfilters.mdx index db1b842ca9..a4cfa40a79 100644 --- a/docs/accessibility/configuration/viewfilters.mdx +++ b/docs/accessibility/configuration/viewfilters.mdx @@ -18,7 +18,7 @@ By default, every URL that is visited within a run is included in the Accessibil For every URL visited by Cypress in a run and every link element found, the first `viewFilters` rule for which the `pattern` property matches the URL is used to either include or exclude the URL based on the `include` value. URLs that do not match any rules are included by default. -## Syntax +## Syntax ```typescript { @@ -31,19 +31,19 @@ For every URL visited by Cypress in a run and every link element found, the firs } ``` -### viewFilters +### viewFilters _Optional._ Object\[] An array of objects used to specify URLs to exclude from Accessibility. _**Each object can have the following properties:**_ -### pattern +### pattern _Required._ String (URL Pattern) Used to match URLs. Uses [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax. -### include +### include _Optional._ Boolean @@ -51,9 +51,9 @@ _Default:_ `true` A boolean that represents whether or not a matched URL should be included in Accessibility. -## Examples +## Examples -### Excluding URLs by hostname +### Excluding URLs by hostname **Config** @@ -83,7 +83,7 @@ https://cypress.io/home https://cypress.io/about ``` -### Including only specific URLs +### Including only specific URLs **Config** diff --git a/docs/accessibility/configuration/views.mdx b/docs/accessibility/configuration/views.mdx index 4334d52345..76a92d74da 100644 --- a/docs/accessibility/configuration/views.mdx +++ b/docs/accessibility/configuration/views.mdx @@ -36,27 +36,27 @@ The `groupBy` property of a view definition allows you to create multiple views } ``` -### views +### views _Optional._ Object\[] An array of objects used to define views within Accessibility. _**Each object can have the following properties:**_ -### pattern +### pattern _Required._ String (URL Pattern) A URL pattern that is used to group matching URLs into a view. Uses [URL Pattern API](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API) syntax. -### groupBy +### groupBy _Optional._ String\[] The URL parameters that should be used to subdivide the URLs into multiple views, rather than being grouped into a single view. -## Examples +## Examples -### Grouping dynamic path parameters +### Grouping dynamic path parameters **Config** @@ -85,7 +85,7 @@ https://cypress.io/users/bob#baz https://cypress.io/users/* ``` -### Using named path parameters +### Using named path parameters **Config** @@ -116,7 +116,7 @@ https://cypress.io/users/bob#baz https://cypress.io/users/:name ``` -### Grouping URLs by named path parameters +### Grouping URLs by named path parameters **Config** @@ -149,7 +149,7 @@ https://cypress.io/analytics/performance/:id https://cypress.io/analytics/usage/:id ``` -### Grouping URLs by named query parameters +### Grouping URLs by named query parameters **Config** @@ -180,7 +180,7 @@ https://cypress.io/app?name=hello https://cypress.io/app?name=world ``` -### Grouping URLs by path parameters to ignore dynamic hosts +### Grouping URLs by path parameters to ignore dynamic hosts **Config** diff --git a/docs/accessibility/core-concepts/inspecting-violation-details.mdx b/docs/accessibility/core-concepts/inspecting-violation-details.mdx index 33897eec36..3305e6dd02 100644 --- a/docs/accessibility/core-concepts/inspecting-violation-details.mdx +++ b/docs/accessibility/core-concepts/inspecting-violation-details.mdx @@ -18,18 +18,18 @@ After navigating to a specific Rule of View from a [Run-level report](/accessibi This page is divided into two main sections: **Rules** and **Snapshots**. -### Rules +## Rules The left-hand side of the detail view lists all Rules that match the current filters for the selected View. If no specific View is selected, the list applies to all Views in the run. -#### Rule details +### Rule details Each Rule can be expanded to reveal related elements and additional information: - **Description**: Text explaining the rule, its origin, the affected user experiences, and how to fix the issue. - **Learn More**: A link to Deque University for in-depth guidance. -#### Element details +### Element details Clicking on an element in the expanded Rule section provides: @@ -44,7 +44,7 @@ Clicking on an element in the expanded Rule section provides: alt="Details displayed after clicking on an element in the Rules section of the Cypress Accessibility issue detail view. Options to copy the selector, print to console, share the issue, and solutions are available." /> -### Snapshots +## Snapshots Snapshots are fully hydrated HTML and CSS representations of your application's state during the test. Unlike screenshots or video, these snapshots allow you to: diff --git a/docs/api/commands/and.mdx b/docs/api/commands/and.mdx index 18c370353b..e87407fc66 100644 --- a/docs/api/commands/and.mdx +++ b/docs/api/commands/and.mdx @@ -72,7 +72,7 @@ A method to be called on the chainer. Pass a function that can have any number of explicit assertions within it. Whatever was passed to the function is what is yielded. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - In most cases, `.and()` yields the same subject it was given. - `.and()` is an assertion, and it is _safe_ to chain further commands that use @@ -238,11 +238,11 @@ cy.get('button') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.and()` requires being chained off a previous command. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.and()` will continue to [retry](/app/core-concepts/retry-ability) its specified assertions until it times out. diff --git a/docs/api/commands/as.mdx b/docs/api/commands/as.mdx index 72a2be5da7..9ce0434bf5 100644 --- a/docs/api/commands/as.mdx +++ b/docs/api/commands/as.mdx @@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.as()`. | ------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `type` | `query` | The type of alias to store, which impacts how the value is retrieved later in the test. Valid values are `query` and `static`. A `query` alias re-runs all queries leading up to the resulting value each time the alias is requested. A `static` alias is retrieved once when the alias is stored, and will never change. `type` has no effect when aliasing intercepts, spies, and stubs. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.as()` yields the same subject it was given. - It is _safe_ to chain further commands after `.as()`. @@ -183,17 +183,17 @@ describe('A fixture', () => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.as()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.as()` is a utility command. - `.as()` will not run assertions. Assertions will pass through as if this command did not exist. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.as()` cannot time out. diff --git a/docs/api/commands/blur.mdx b/docs/api/commands/blur.mdx index e7680c5eab..ebeb6062e5 100644 --- a/docs/api/commands/blur.mdx +++ b/docs/api/commands/blur.mdx @@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.blur`. | `force` | `false` | Forces the action, disables checking if [element is focused](#Requirements) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.blur()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.blur()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -115,17 +115,17 @@ events. Your best bet here is to keep Cypress focused when working on a test. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.blur()` requires being chained off a command that yields DOMelement(s). - `.blur()` requires the element to currently have focus. - `.blur()` requires the element to be able to receive focus. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.blur()` will automatically wait for assertions you have chained to pass. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.blur()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/check.mdx b/docs/api/commands/check.mdx index 688467af5d..2c87830766 100644 --- a/docs/api/commands/check.mdx +++ b/docs/api/commands/check.mdx @@ -64,7 +64,7 @@ Pass in an options object to change the default behavior of `.check()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.check()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.check()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -168,19 +168,19 @@ cy.get('#pick-fruit :checked').should('be.checked').and('have.value', 'apple') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.check()` requires being chained off a command that yields DOM element(s). - `.check()` requires the element to have type `checkbox` or `radio`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.check()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.check()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.check()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/children.mdx b/docs/api/commands/children.mdx index 54f045a98c..c99140957c 100644 --- a/docs/api/commands/children.mdx +++ b/docs/api/commands/children.mdx @@ -51,7 +51,7 @@ Pass in an options object to change the default behavior of `.children()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.children()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.children()` yields the new DOM element(s) it found. - `.children()` is a query, and it is _safe_ to chain further commands. @@ -115,11 +115,11 @@ cy.get('ul').children('.active') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.children()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.children()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -127,7 +127,7 @@ cy.get('ul').children('.active') - `.children()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.children()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/clear.mdx b/docs/api/commands/clear.mdx index 54c76a065e..e2e5901c26 100644 --- a/docs/api/commands/clear.mdx +++ b/docs/api/commands/clear.mdx @@ -54,7 +54,7 @@ Pass in an options object to change the default behavior of `.clear()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.clear()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.clear()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -88,19 +88,19 @@ Please read the [`.type()`](/api/commands/type) documentation for more details. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.clear()` requires being chained off a command that yields DOM element(s). - `.clear()` requires the element to be an `input` or `textarea`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.clear()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements) - `.clear()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.clear()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/clearallcookies.mdx b/docs/api/commands/clearallcookies.mdx index 0777562892..913b83c389 100644 --- a/docs/api/commands/clearallcookies.mdx +++ b/docs/api/commands/clearallcookies.mdx @@ -41,21 +41,21 @@ Pass in an options object to change the default behavior of | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.clearAllCookies()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearAllCookies()` yields `null`. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearAllCookies()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clearAllCookies()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearAllCookies()` should never time out. diff --git a/docs/api/commands/clearalllocalstorage.mdx b/docs/api/commands/clearalllocalstorage.mdx index 19a84e44f3..507c1a0411 100644 --- a/docs/api/commands/clearalllocalstorage.mdx +++ b/docs/api/commands/clearalllocalstorage.mdx @@ -42,21 +42,21 @@ Pass in an options object to change the default behavior of | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearAllLocalStorage()` yields `null`. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearAllLocalStorage()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clearAllLocalStorage()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearAllLocalStorage()` cannot time out. diff --git a/docs/api/commands/clearallsessionstorage.mdx b/docs/api/commands/clearallsessionstorage.mdx index 0e6d2fe361..3e97552a89 100644 --- a/docs/api/commands/clearallsessionstorage.mdx +++ b/docs/api/commands/clearallsessionstorage.mdx @@ -42,21 +42,21 @@ Pass in an options object to change the default behavior of | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearAllSessionStorage()` yields `null`. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearAllSessionStorage()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + `cy.clearAllSessionStorage()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearAllSessionStorage()` cannot time out. diff --git a/docs/api/commands/clearcookie.mdx b/docs/api/commands/clearcookie.mdx index b4e9387ce7..15e37dcc0b 100644 --- a/docs/api/commands/clearcookie.mdx +++ b/docs/api/commands/clearcookie.mdx @@ -45,7 +45,7 @@ Pass in an options object to change the default behavior of `cy.clearCookie()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.clearCookie()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearCookie()` yields `null`. @@ -71,15 +71,15 @@ cy.url().should('include', 'login') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearCookie()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clearCookie()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearCookie()` should never time out. diff --git a/docs/api/commands/clearcookies.mdx b/docs/api/commands/clearcookies.mdx index 1842026adf..71f48b1ac0 100644 --- a/docs/api/commands/clearcookies.mdx +++ b/docs/api/commands/clearcookies.mdx @@ -41,7 +41,7 @@ Pass in an options object to change the default behavior of `cy.clearCookies()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.clearCookies()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearCookies()` yields `null`. @@ -66,15 +66,15 @@ cy.url().should('include', 'login') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearCookies()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clearCookies()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearCookies()` should never time out. diff --git a/docs/api/commands/clearlocalstorage.mdx b/docs/api/commands/clearlocalstorage.mdx index a2b40b794a..82b506e2e0 100644 --- a/docs/api/commands/clearlocalstorage.mdx +++ b/docs/api/commands/clearlocalstorage.mdx @@ -46,7 +46,7 @@ Pass in an options object to change the default behavior of | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.clearLocalStorage()` yields the localStorage for the current domain. @@ -76,21 +76,23 @@ cy.clearLocalStorage(/app-/) ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clearLocalStorage()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clearLocalStorage()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clearLocalStorage()` cannot time out. ## Command Log +**_Clear all localStorage_** + ```javascript cy.clearLocalStorage(/prop1|2/).then((ls) => { expect(ls.getItem('prop1')).to.be.null diff --git a/docs/api/commands/click.mdx b/docs/api/commands/click.mdx index ae4d6abda7..2f8bacdec0 100644 --- a/docs/api/commands/click.mdx +++ b/docs/api/commands/click.mdx @@ -75,7 +75,7 @@ Pass in an options object to change the default behavior of `.click()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.click()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.click()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -209,18 +209,18 @@ then the element will not receive focus as per the spec. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.click()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.click()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.click()`will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.click()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). @@ -228,7 +228,7 @@ then the element will not receive focus as per the spec. ## Command Log -**Click the button** +**_Click the button_** ```javascript cy.get('.action-btn').click() diff --git a/docs/api/commands/clock.mdx b/docs/api/commands/clock.mdx index 2101a67622..bdc0e1d040 100644 --- a/docs/api/commands/clock.mdx +++ b/docs/api/commands/clock.mdx @@ -53,7 +53,7 @@ Pass in an options object to change the default behavior of `cy.clock()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.clock()` yields a `clock` object with the following methods: @@ -278,23 +278,23 @@ of a test, the page under test is reloaded or changed. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.clock()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.clock()` is a utility command. - `cy.clock()` will not run assertions. Assertions will pass through as if this command did not exist. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.clock()` cannot time out. ## Command Log -**Create a clock and tick it 1 second** +**_Create a clock and tick it 1 second_** ```javascript cy.clock() diff --git a/docs/api/commands/closest.mdx b/docs/api/commands/closest.mdx index 5f8cb895e6..8c6d40fe74 100644 --- a/docs/api/commands/closest.mdx +++ b/docs/api/commands/closest.mdx @@ -50,7 +50,7 @@ Pass in an options object to change the default behavior of `.closest()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.closest()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.closest()` yields the new DOM element(s) it found. - `.closest()` is a query, and it is _safe_ to chain further commands. @@ -67,11 +67,11 @@ cy.get('p.error').closest('.banner') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.closest()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.closest()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -79,7 +79,7 @@ cy.get('p.error').closest('.banner') - `.closest()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.closest()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). @@ -87,7 +87,7 @@ cy.get('p.error').closest('.banner') ## Command Log -#### Find the closest element of `li.active` with the class 'nav' +**_Find the closest element of `li.active` with the class 'nav'_** ```javascript cy.get('li.active').closest('.nav') diff --git a/docs/api/commands/contains.mdx b/docs/api/commands/contains.mdx index c3a7eb3c9f..44f30e62b0 100644 --- a/docs/api/commands/contains.mdx +++ b/docs/api/commands/contains.mdx @@ -63,7 +63,7 @@ Pass in an options object to change the default behavior of `.contains()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.contains()` to resolve before [timing out](#Timeouts) | | `includeShadowDom` | [`includeShadowDom` config option value](/app/references/configuration#Global) | Whether to traverse shadow DOM boundaries and include elements within the shadow DOM in the yielded results. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.contains()` yields the new DOM element it found. - `.contains()` is a query, and it is _safe_ to chain further commands. @@ -450,12 +450,12 @@ cy.contains('Age').find('input').type('29') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.contains()` can be chained off of `cy` or off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.contains()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -463,7 +463,7 @@ cy.contains('Age').find('input').type('29') - `.contains()`will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.contains()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/dblclick.mdx b/docs/api/commands/dblclick.mdx index 1b30909a5e..aadddaa0fe 100644 --- a/docs/api/commands/dblclick.mdx +++ b/docs/api/commands/dblclick.mdx @@ -75,7 +75,7 @@ Pass in an options object to change the default behavior of `.dblclick()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.dblclick()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.dblclick()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -191,18 +191,18 @@ cy.get('li:first').dblclick({ ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.dblclick()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.dblclick()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.dblclick()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.dblclick()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/debug.mdx b/docs/api/commands/debug.mdx index ab55f1b93c..aa9019b46c 100644 --- a/docs/api/commands/debug.mdx +++ b/docs/api/commands/debug.mdx @@ -42,7 +42,7 @@ Pass in an options object to change the default behavior of `.debug()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.debug()` yields the same subject it was given from the previous command. - `.debug()` is a query, and it is _safe_ to chain further commands. @@ -59,17 +59,17 @@ cy.get('a').debug().should('have.attr', 'href') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.debug()` can be chained off of `cy` or off another command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.debug()` is a utility command. - `.debug()` will not run assertions. Assertions will pass through as if this command did not exist. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.debug()` cannot time out. diff --git a/docs/api/commands/document.mdx b/docs/api/commands/document.mdx index d9d0167b38..cb54f2c596 100644 --- a/docs/api/commands/document.mdx +++ b/docs/api/commands/document.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of `cy.document()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.document()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.document()` 'yields the `window.document` object. - `cy.document()` is a query, and it is _safe_ to chain further commands. @@ -56,17 +56,17 @@ cy.document().its('contentType').should('eq', 'text/html') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.document()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.document()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.document()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/each.mdx b/docs/api/commands/each.mdx index f795e8f84f..2509731e84 100644 --- a/docs/api/commands/each.mdx +++ b/docs/api/commands/each.mdx @@ -41,7 +41,7 @@ Pass a function that is invoked with the following arguments: - `index` - `collection` -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.each()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -110,16 +110,16 @@ function. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.each()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.each()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.each()` can time out waiting for a promise you've returned to resolve. diff --git a/docs/api/commands/end.mdx b/docs/api/commands/end.mdx index 537c316160..9055e7a2ee 100644 --- a/docs/api/commands/end.mdx +++ b/docs/api/commands/end.mdx @@ -24,7 +24,7 @@ cy.contains('ul').end() // Yield 'null' instead of 'ul' element cy.end() ``` -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.end()` yields `null`. @@ -50,15 +50,15 @@ cy.contains('User: Charles').click() // contains looks for content in document n ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.end()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.end()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.end()` cannot time out. diff --git a/docs/api/commands/eq.mdx b/docs/api/commands/eq.mdx index f5a0bdd0ee..938c6e5208 100644 --- a/docs/api/commands/eq.mdx +++ b/docs/api/commands/eq.mdx @@ -58,7 +58,7 @@ Pass in an options object to change the default behavior of `.eq()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.eq()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.eq()` yields the new DOM element it found. - `.eq()` is a query, and it is _safe_ to chain further commands. @@ -130,11 +130,11 @@ cy.get('li').eq(-2).should('contain', 'sphynx') // true ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.eq()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.eq()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -142,7 +142,7 @@ cy.get('li').eq(-2).should('contain', 'sphynx') // true - `.eq()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.eq()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). @@ -150,7 +150,7 @@ cy.get('li').eq(-2).should('contain', 'sphynx') // true ## Command Log -**Find the 4th `
  • ` in the navigation** +**_Find the 4th `
  • ` in the navigation_** ```javascript cy.get('.left-nav.nav').find('>li').eq(3) diff --git a/docs/api/commands/exec.mdx b/docs/api/commands/exec.mdx index cd6ae28b02..8fdbb096ee 100644 --- a/docs/api/commands/exec.mdx +++ b/docs/api/commands/exec.mdx @@ -47,7 +47,7 @@ Pass in an options object to change the default behavior of `cy.exec()`. | `failOnNonZeroExit` | `true` | whether to fail if the command exits with a non-zero code | | `timeout` | [`execTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.exec()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.exec()` yields an object with the following properties: @@ -191,19 +191,19 @@ describe('has data available from database', { execTimeout: 90000 }, () => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.exec()` requires being chained off of `cy`. - `cy.exec()` requires the executed system command to eventually exit. - `cy.exec()` requires that the exit code be `0` when `failOnNonZeroExit` is `true`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.exec()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.exec()` can time out waiting for the system command to exist. diff --git a/docs/api/commands/filter.mdx b/docs/api/commands/filter.mdx index f4784f8034..c75b76a8e9 100644 --- a/docs/api/commands/filter.mdx +++ b/docs/api/commands/filter.mdx @@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.filter()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.filter()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.filter()` yields the new DOM element(s) it found. - `.filter()` is a query, and it is _safe_ to chain further commands. @@ -124,11 +124,11 @@ cy.get('[data-testid="testattr"]').filter(':contains("Hello\u00a0world")') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.filter()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.filter()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -136,7 +136,7 @@ cy.get('[data-testid="testattr"]').filter(':contains("Hello\u00a0world")') - `.filter()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.filter()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/find.mdx b/docs/api/commands/find.mdx index 468dff4305..908c3a3512 100644 --- a/docs/api/commands/find.mdx +++ b/docs/api/commands/find.mdx @@ -50,7 +50,7 @@ Pass in an options object to change the default behavior of `.find()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.find()` to resolve before [timing out](#Timeouts) | | `includeShadowDom` | [`includeShadowDom` config option value](/app/references/configuration#Global) | Whether to traverse shadow DOM boundaries and include elements within the shadow DOM in the yielded results. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.find()` yields the new DOM element(s) it found. - `.find()` is a query, and it is _safe_ to chain further commands. @@ -75,11 +75,11 @@ cy.get('#parent').find('li') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.find()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.find()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -87,7 +87,7 @@ cy.get('#parent').find('li') - `.find()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.find()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/first.mdx b/docs/api/commands/first.mdx index 02d8578845..8944fefb2b 100644 --- a/docs/api/commands/first.mdx +++ b/docs/api/commands/first.mdx @@ -45,7 +45,7 @@ Pass in an options object to change the default behavior of `.first()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.first()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.first()` yields the new DOM element it found. - `.first()` is a query, and it is _safe_ to chain further commands. @@ -72,11 +72,11 @@ cy.get('li').first() ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.first()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.first()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -84,7 +84,7 @@ cy.get('li').first() - `.first()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.first()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/fixture.mdx b/docs/api/commands/fixture.mdx index 146e706e4e..ad2d9a7f1a 100644 --- a/docs/api/commands/fixture.mdx +++ b/docs/api/commands/fixture.mdx @@ -69,7 +69,7 @@ Pass in an options object to change the default behavior of `cy.fixture()`. | --------- | ----------------------------------------------------------- | ------------------------------------------------------------------------- | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.fixture()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.fixture()` yields the contents of the file. Formatting is determined by its file extension. @@ -317,16 +317,16 @@ cy.fixture('todo.json').then((todo) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.fixture()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.fixture()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.fixture()` should never time out. diff --git a/docs/api/commands/focus.mdx b/docs/api/commands/focus.mdx index c591e9cb15..c3dfb8ff62 100644 --- a/docs/api/commands/focus.mdx +++ b/docs/api/commands/focus.mdx @@ -40,7 +40,7 @@ Pass in an options object to change the default behavior of `.focus()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.focus()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.focus()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -112,16 +112,16 @@ events. Your best bet here is to keep Cypress focused when working on a test. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.focus()` requires being chained off a command that yields DOM element(s). - `.focus()` requires the element to be able to receive focus. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.focus()` will automatically wait for assertions you have chained to pass. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.focus()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/focused.mdx b/docs/api/commands/focused.mdx index 27ccc20e69..63201d81fa 100644 --- a/docs/api/commands/focused.mdx +++ b/docs/api/commands/focused.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of `cy.focused()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.focused()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.focused()` yields the DOM element it found. - `cy.focused()` is a query, and it is _safe_ to chain further commands. @@ -62,12 +62,12 @@ cy.focused().should('have.attr', 'name', 'username') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.focused()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.focused()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -75,7 +75,7 @@ cy.focused().should('have.attr', 'name', 'username') - `cy.focused()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.focused()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/get.mdx b/docs/api/commands/get.mdx index 667bfe7f54..223c06867a 100644 --- a/docs/api/commands/get.mdx +++ b/docs/api/commands/get.mdx @@ -66,7 +66,7 @@ Pass in an options object to change the default behavior of `cy.get()`. | `withinSubject` | null | Element to search for children in. If null, search begins from root-level DOM element | | `includeShadowDom` | [`includeShadowDom` config option value](/app/references/configuration#Global) | Whether to traverse shadow DOM boundaries and include elements within the shadow DOM in the yielded results. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.get()` yields the DOM element(s) it found, or the results of the alias lookup. @@ -221,11 +221,11 @@ it('disables on click', () => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.get()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.get()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -233,7 +233,7 @@ it('disables on click', () => { - `cy.get()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.get()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/getallcookies.mdx b/docs/api/commands/getallcookies.mdx index 538d0f9247..f5bed09cb4 100644 --- a/docs/api/commands/getallcookies.mdx +++ b/docs/api/commands/getallcookies.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.getAllCookies()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.getAllCookies()` yields an array of cookie objects. Each cookie object has the following properties: @@ -75,16 +75,16 @@ cy.getAllCookies() ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.getAllCookies()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.getAllCookies()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.getAllCookies()` should never time out. diff --git a/docs/api/commands/getalllocalstorage.mdx b/docs/api/commands/getalllocalstorage.mdx index 01f407ee97..c27ba22d96 100644 --- a/docs/api/commands/getalllocalstorage.mdx +++ b/docs/api/commands/getalllocalstorage.mdx @@ -32,7 +32,7 @@ Pass in an options object to change the default behavior of | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.getAllLocalStorage()` yields an object where the keys are origins and the values are key-value pairs of `localStorage` data. @@ -74,16 +74,16 @@ cy.getAllLocalStorage().then((result) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.getAllLocalStorage()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.getAllLocalStorage()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.getAllLocalStorage()` cannot time out. diff --git a/docs/api/commands/getallsessionstorage.mdx b/docs/api/commands/getallsessionstorage.mdx index ebe0a5520d..8e14b0de94 100644 --- a/docs/api/commands/getallsessionstorage.mdx +++ b/docs/api/commands/getallsessionstorage.mdx @@ -32,7 +32,7 @@ Pass in an options object to change the default behavior of | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.getAllSessionStorage()` yields an object where the keys are origins and the values are key-value pairs of `sessionStorage` data. @@ -74,16 +74,16 @@ cy.getAllSessionStorage().then((result) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.getAllSessionStorage()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.getAllSessionStorage()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.getAllSessionStorage()` cannot time out. diff --git a/docs/api/commands/getcookie.mdx b/docs/api/commands/getcookie.mdx index 9a61abb402..3b9757079f 100644 --- a/docs/api/commands/getcookie.mdx +++ b/docs/api/commands/getcookie.mdx @@ -35,7 +35,7 @@ Pass in an options object to change the default behavior of `cy.getCookie()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.getCookie()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.getCookie()` yields a cookie object with the following properties: @@ -123,16 +123,16 @@ Check out our example recipes using `cy.getCookie()` to test ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.getCookie()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.getCookie()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.getCookie()` should never time out. @@ -146,6 +146,8 @@ practical purposes it should never happen. ## Command Log +**_Get a browser cookie and make assertions about the object_** + ```javascript cy.getCookie('fakeCookie1').should('have.property', 'value', '123ABC') ``` diff --git a/docs/api/commands/getcookies.mdx b/docs/api/commands/getcookies.mdx index 2e453a4f81..a1d861309c 100644 --- a/docs/api/commands/getcookies.mdx +++ b/docs/api/commands/getcookies.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of `cy.getCookies()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.getCookies()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.getCookies()` yields an array of cookie objects. Each cookie object has the following properties: @@ -70,16 +70,16 @@ cy.getCookies() ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.getCookies()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.getCookies()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.getCookies()` should never time out. @@ -93,6 +93,8 @@ practical purposes it should never happen. ## Command Log +**_Get browser cookies and inspect all properties_** + ```javascript cy.getCookies() .should('have.length', 1) diff --git a/docs/api/commands/go.mdx b/docs/api/commands/go.mdx index c8d81ca423..f1c54a9cc1 100644 --- a/docs/api/commands/go.mdx +++ b/docs/api/commands/go.mdx @@ -39,7 +39,7 @@ Pass in an options object to change the default behavior of `cy.go()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`pageLoadTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.go()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.go()` yields the `window` object after the page finishes loading. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -77,7 +77,7 @@ cy.go(1) // equivalent to clicking forward button ## Notes -#### Refreshing and loading the page +### Refreshing and loading the page If going forward or back causes a full page refresh, Cypress will wait for the new page to load before moving on to new commands. @@ -87,18 +87,18 @@ as hash routing) and will resolve immediately. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.go()` requires being chained off of `cy`. - `cy.go()` requires the response to be `content-type: text/html`. - `cy.go()` requires the response code to be `2xx` after following redirects. - `cy.go()` requires the load `load` event to eventually fire. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.go()` will automatically wait for assertions you have chained to pass. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.go()` can time out waiting for the page to fire its `load` event. - `cy.go()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/hash.mdx b/docs/api/commands/hash.mdx index 071c4d3867..c3373abaee 100644 --- a/docs/api/commands/hash.mdx +++ b/docs/api/commands/hash.mdx @@ -40,7 +40,7 @@ Pass in an options object to change the default behavior of `cy.hash()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.hash()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - When the current URL contains a hash, `cy.hash()` yields the current URL's hash (including the `#` character). @@ -76,16 +76,16 @@ cy.hash().should('match', /users\/.+$/) // => true ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.hash()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.hash()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.hash()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/intercept.mdx b/docs/api/commands/intercept.mdx index 0031a074d5..c35ce7dd32 100644 --- a/docs/api/commands/intercept.mdx +++ b/docs/api/commands/intercept.mdx @@ -173,7 +173,7 @@ send a response, access the real response, and more. See ["Intercepted requests"][req] and [Request/Response Modification with `routeHandler`](#RequestResponse-Modification-with-routeHandler). -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.intercept()` yields `null`, but can be aliased. - Waiting on an aliased `cy.intercept()` route using @@ -1564,14 +1564,17 @@ are some workarounds: ## Command Log +**_Routes Instrument Panel_** + +When you create `cy.intercept()` rules, Cypress will display a new Instrument called _Routes_. + ```javascript cy.intercept('/accounts*').as('accountsGet') cy.intercept('/company', { companyId: 1 }).as('companyGet') cy.intercept('/teams*', [{ teamId: 2 }]).as('teamsGet') ``` -Whenever you create `cy.intercept()` rules, Cypress will display a new -Instrument Panel called _Routes_. It will list the routing table in the +It will list the routing table in the Instrument Panel, including the `method`, `RouteMatcher`, if the route is stubbed, any alias, and number of matched requests: diff --git a/docs/api/commands/invoke.mdx b/docs/api/commands/invoke.mdx index 219f12a62f..cca57983e6 100644 --- a/docs/api/commands/invoke.mdx +++ b/docs/api/commands/invoke.mdx @@ -70,7 +70,7 @@ Pass in an options object to change the default behavior of `.invoke()`. Additional arguments to be given to the function call. There is no limit to the number of arguments. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.invoke()` yields the return value of the method. - `.invoke()` is a query, and it is _safe_ to chain further commands. @@ -246,11 +246,11 @@ cy.wrap(english).invoke('greeting').should('equal', 'bye') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.invoke()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.invoke()` will wait for the `function` to exist on the subject before running. @@ -259,7 +259,7 @@ cy.wrap(english).invoke('greeting').should('equal', 'bye') - `.invoke()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.invoke()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/its.mdx b/docs/api/commands/its.mdx index e90cb53776..6fb13c5651 100644 --- a/docs/api/commands/its.mdx +++ b/docs/api/commands/its.mdx @@ -50,7 +50,7 @@ Pass in an options object to change the default behavior of `.its()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.its()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.its()` 'yields the value of the property. - `.its()` is a query, and it is _safe_ to chain further commands. @@ -193,16 +193,16 @@ cy.window().its('evilProp').should('not.exist') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.its()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.its()` will automatically [retry](/app/core-concepts/retry-ability) until it has a property that is not `null` or `undefined`. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.its()` can time out waiting for the property to exist. - `.its()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/last.mdx b/docs/api/commands/last.mdx index 15d61130df..b278ff1a4e 100644 --- a/docs/api/commands/last.mdx +++ b/docs/api/commands/last.mdx @@ -45,7 +45,7 @@ Pass in an options object to change the default behavior of `.last()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.last()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.last()` yields the new DOM element it found. - `.last()` is a query, and it is _safe_ to chain further commands. @@ -72,11 +72,11 @@ cy.get('li').last() ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.last()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.last()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -84,7 +84,7 @@ cy.get('li').last() - `.last()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.last()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/location.mdx b/docs/api/commands/location.mdx index b1ed5a7bee..a608a35794 100644 --- a/docs/api/commands/location.mdx +++ b/docs/api/commands/location.mdx @@ -41,7 +41,7 @@ Pass in an options object to change the default behavior of `cy.location()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.location()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.location()` is a query, and it is _safe_ to chain further commands. @@ -158,17 +158,17 @@ cy.location().then((loc) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.location()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.location()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.location()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/log.mdx b/docs/api/commands/log.mdx index c454bf8db4..8ae24bf2db 100644 --- a/docs/api/commands/log.mdx +++ b/docs/api/commands/log.mdx @@ -31,7 +31,7 @@ message. Additional arguments to be printed to the Cypress Command Log. There is no limit to the number of arguments. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.log()` yields `null`. @@ -56,21 +56,21 @@ cy.log('events triggered', events) ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.log()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.log()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.log()` cannot time out. ## Command Log -#### Print messages with arguments to the Command Log. +**_Print messages with arguments to the Command Log._** ```javascript cy.log('log out any message we want here') diff --git a/docs/api/commands/next.mdx b/docs/api/commands/next.mdx index e7ec295cf8..ee65f83dcd 100644 --- a/docs/api/commands/next.mdx +++ b/docs/api/commands/next.mdx @@ -52,7 +52,7 @@ Pass in an options object to change the default behavior of `.next()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.next()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.next()` yields the new DOM element(s) it found. - `.next()` is a query, and it is _safe_ to chain further commands. @@ -117,11 +117,11 @@ cy.get('li').next('.selected') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.next()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.next()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -129,7 +129,7 @@ cy.get('li').next('.selected') - `.next()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.next()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/nextall.mdx b/docs/api/commands/nextall.mdx index b9c31558ba..05ae19ab3c 100644 --- a/docs/api/commands/nextall.mdx +++ b/docs/api/commands/nextall.mdx @@ -51,7 +51,7 @@ Pass in an options object to change the default behavior of `.nextAll()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.nextAll()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.nextAll()` yields the new DOM element(s) it found. - `.nextAll()` is a query, and it is _safe_ to chain further commands. @@ -98,11 +98,11 @@ cy.get('li').nextAll('.selected') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.nextAll()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.nextAll()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('li').nextAll('.selected') - `.nextAll()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.nextAll()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/nextuntil.mdx b/docs/api/commands/nextuntil.mdx index c511c24149..a45a33e937 100644 --- a/docs/api/commands/nextuntil.mdx +++ b/docs/api/commands/nextuntil.mdx @@ -62,7 +62,7 @@ Pass in an options object to change the default behavior of `.nextUntil()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.nextUntil()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.nextUntil()` yields the new DOM element(s) it found. - `.nextUntil()` is a query, and it is _safe_ to chain further commands. @@ -97,12 +97,12 @@ cy.get('#veggies').nextUntil('#nuts') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.nextUntil()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.nextUntil()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('#veggies').nextUntil('#nuts') - `.nextUntil()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.nextUntil()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/not.mdx b/docs/api/commands/not.mdx index 697e138fed..ac4ef4a613 100644 --- a/docs/api/commands/not.mdx +++ b/docs/api/commands/not.mdx @@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.not()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.not()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.not()` yields the new DOM element(s) it found. - `.not()` is a query, and it is _safe_ to chain further commands. @@ -82,11 +82,11 @@ cy.get('ul>li').not('.active').should('have.length', 4) // true ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.not()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.not()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -94,7 +94,7 @@ cy.get('ul>li').not('.active').should('have.length', 4) // true - `.not()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.not()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/origin.mdx b/docs/api/commands/origin.mdx index d98a40bd00..968aaedfaf 100644 --- a/docs/api/commands/origin.mdx +++ b/docs/api/commands/origin.mdx @@ -125,7 +125,7 @@ There are a number of limitations placed on commands run inside the callback, please see [Callback restrictions](#Callback-restrictions) section below for a full list. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.origin()` yields the value yielded by the last Cypress command in the callback function. diff --git a/docs/api/commands/parent.mdx b/docs/api/commands/parent.mdx index f269ce6a36..4f6a1a75b5 100644 --- a/docs/api/commands/parent.mdx +++ b/docs/api/commands/parent.mdx @@ -54,7 +54,7 @@ Pass in an options object to change the default behavior of `.parent()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.parent()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.parent()` yields the new DOM element(s) it found. - `.parent()` is a query, and it is _safe_ to chain further commands. @@ -109,11 +109,11 @@ cy.get('li').parent('.sub-nav') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.parent()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.parent()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -121,7 +121,7 @@ cy.get('li').parent('.sub-nav') - `.parent()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.parent()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/parents.mdx b/docs/api/commands/parents.mdx index cd421ddcb1..28863377ea 100644 --- a/docs/api/commands/parents.mdx +++ b/docs/api/commands/parents.mdx @@ -55,7 +55,7 @@ Pass in an options object to change the default behavior of `.parents()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.parents()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.parents()` yields the new DOM element(s) it found. - `.parents()` is a query, and it is _safe_ to chain further commands. @@ -96,11 +96,11 @@ cy.get('li.active').parents('.main-nav') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.parents()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.parents()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -108,7 +108,7 @@ cy.get('li.active').parents('.main-nav') - `.parents()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.parents()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/parentsuntil.mdx b/docs/api/commands/parentsuntil.mdx index 4e2fb02eb0..a25ab04e75 100644 --- a/docs/api/commands/parentsuntil.mdx +++ b/docs/api/commands/parentsuntil.mdx @@ -62,7 +62,7 @@ Pass in an options object to change the default behavior of `.parentsUntil()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.parentsUntil()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.parentsUntil()` yields the new DOM element(s) it found. - `.parentsUntil()` is a query, and it is _safe_ to chain further commands. @@ -96,12 +96,12 @@ cy.get('.active').parentsUntil('.nav') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.parentsUntil()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.parentsUntil()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('.active').parentsUntil('.nav') [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.parentsUntil()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/pause.mdx b/docs/api/commands/pause.mdx index 3307c38c44..d1bb0a33e0 100644 --- a/docs/api/commands/pause.mdx +++ b/docs/api/commands/pause.mdx @@ -46,7 +46,7 @@ Pass in an options object to change the default behavior of `.pause()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.pause()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -69,23 +69,23 @@ cy.get('button').should('not.be.disabled') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.pause()` can be chained off of `cy` or off another command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.pause()` is a utility command. - `.pause()` will not run assertions. Assertions will pass through as if this command did not exist. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.pause()` cannot time out. ## Command Log -### Pause and step through each `.click()` command +**_Pause and step through each `.click()` command_** ```javascript cy.get('#action-canvas') diff --git a/docs/api/commands/prev.mdx b/docs/api/commands/prev.mdx index 4eff60f538..4535ea63b5 100644 --- a/docs/api/commands/prev.mdx +++ b/docs/api/commands/prev.mdx @@ -51,7 +51,7 @@ Pass in an options object to change the default behavior of `.prev()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.prev()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.prev()` yields the new DOM element(s) it found. - `.prev()` is a query, and it is _safe_ to chain further commands. @@ -98,11 +98,11 @@ cy.get('li').prev('.active') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.prev()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.prev()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('li').prev('.active') - `.prev()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.prev()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/prevall.mdx b/docs/api/commands/prevall.mdx index d83c871715..9e2b76cf12 100644 --- a/docs/api/commands/prevall.mdx +++ b/docs/api/commands/prevall.mdx @@ -51,7 +51,7 @@ Pass in an options object to change the default behavior of `.prevAll()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.prevAll()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.prevAll()` yields the new DOM element(s) it found. - `.prevAll()` is a query, and it is _safe_ to chain further commands. @@ -98,11 +98,11 @@ cy.get('li').prevAll('.selected') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.prevAll()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.prevAll()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('li').prevAll('.selected') - `.prevAll()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.prevAll()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/prevuntil.mdx b/docs/api/commands/prevuntil.mdx index 6389f7f620..660a82a8ac 100644 --- a/docs/api/commands/prevuntil.mdx +++ b/docs/api/commands/prevuntil.mdx @@ -62,7 +62,7 @@ Pass in an options object to change the default behavior of `.prevUntil()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.prevUntil()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.prevUntil()` yields the new DOM element(s) it found. - `.prevUntil()` is a query, and it is _safe_ to chain further commands. @@ -97,12 +97,12 @@ cy.get('#nuts').prevUntil('#veggies') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.prevUntil()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.prevUntil()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -110,7 +110,7 @@ cy.get('#nuts').prevUntil('#veggies') - `.prevUntil()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.prevUntil()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/readfile.mdx b/docs/api/commands/readfile.mdx index 72ba5c9213..9229b2ccda 100644 --- a/docs/api/commands/readfile.mdx +++ b/docs/api/commands/readfile.mdx @@ -60,7 +60,7 @@ Pass in an options object to change the default behavior of `cy.readFile()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.readFile()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.readFile()` yields the contents of the file. - The file will be read from disk again if any upcoming command (such as an @@ -207,19 +207,19 @@ cy.readFile('users.json').its('users.123.name').should('eq', 'John Doe') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.readFile()` requires being chained off of `cy`. - `cy.readFile()` requires the file must exist. - `cy.readFile()` requires the file be successfully read from disk. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.readFile()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.readFile()` can time out waiting for assertions you've added to pass. - `cy.readFile()` can time out when the content being read takes a significant diff --git a/docs/api/commands/reload.mdx b/docs/api/commands/reload.mdx index 3c4c5e265c..adb047eb5b 100644 --- a/docs/api/commands/reload.mdx +++ b/docs/api/commands/reload.mdx @@ -36,7 +36,7 @@ reload without cache. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`pageLoadTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.reload()` to resolve before [timing out](#Timeouts) Note: Network requests are limited by the underlying operating system, and may still time out if this value is increased. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.reload()` yields the `window` object after the page finishes loading. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -67,7 +67,7 @@ cy.reload(true) ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.reload()` requires being chained off of `cy`. - `cy.reload()` requires the response to be `content-type: text/html`. @@ -75,11 +75,11 @@ cy.reload(true) redirects. - `cy.reload()` requires the load `load` event to eventually fire. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.reload()` will automatically wait for assertions you have chained to pass. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.reload()` can time out waiting for the page to fire its `load` event. - `cy.reload()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/request.mdx b/docs/api/commands/request.mdx index a6c900ab7d..da7b780750 100644 --- a/docs/api/commands/request.mdx +++ b/docs/api/commands/request.mdx @@ -128,7 +128,7 @@ globally in [configuration](/app/references/configuration). You can also set options for `cy.request()`'s `baseUrl` and `responseTimeout` globally in the [Cypress configuration](/app/references/configuration). -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.request()` yields the `response` as an object literal containing properties such as: @@ -373,19 +373,19 @@ See ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.request()` requires being chained off of `cy`. - `cy.request()` requires that the server sends a response. - `cy.request()` requires that the response status code be `2xx` or `3xx` when `failOnStatusCode` is `true`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.request()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.request()` can time out waiting for the server to respond. diff --git a/docs/api/commands/rightclick.mdx b/docs/api/commands/rightclick.mdx index 01db1e48ca..8d9aaaab96 100644 --- a/docs/api/commands/rightclick.mdx +++ b/docs/api/commands/rightclick.mdx @@ -83,7 +83,7 @@ Pass in an options object to change the default behavior of `.rightclick()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.rightclick()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.rightclick()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -198,12 +198,12 @@ cy.get('.menu-item').rightclick({ ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.rightclick()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.rightclick()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). @@ -211,7 +211,7 @@ cy.get('.menu-item').rightclick({ [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.rightclick()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/root.mdx b/docs/api/commands/root.mdx index ed08fb4857..89b74dfa67 100644 --- a/docs/api/commands/root.mdx +++ b/docs/api/commands/root.mdx @@ -34,7 +34,7 @@ Pass in an options object to change the default behavior of `.root()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.root()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.root()` yields the root DOM element. @@ -68,22 +68,22 @@ cy.get('form').within(($form) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.root()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.root()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.root()` can time out waiting for assertions you've added to pass. ## Command Log -#### Get root element +**_Get root element_** ```javascript cy.root().should('match', 'html') diff --git a/docs/api/commands/screenshot.mdx b/docs/api/commands/screenshot.mdx index 9cdd518d48..f9b67ebedd 100644 --- a/docs/api/commands/screenshot.mdx +++ b/docs/api/commands/screenshot.mdx @@ -62,7 +62,7 @@ For more details on these options and to set some as defaults across all uses of `.screenshot()`, see the [Cypress.Screenshot API doc](/api/cypress-api/screenshot-api). -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.screenshot()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -313,17 +313,17 @@ stealing focus, [ensure that the extension is enabled](/app/references/troublesh ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.screenshot()` can be chained off of `cy` or off a command that yields a single DOM element. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.screenshot()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.screenshot()` should never time out. @@ -337,7 +337,7 @@ practical purposes it should never happen. ## Command Log -#### Take a screenshot with a specific filename +**_Take a screenshot with a specific filename_** ```javascript cy.screenshot('my-image') diff --git a/docs/api/commands/scrollintoview.mdx b/docs/api/commands/scrollintoview.mdx index b3982fc96b..89e07146ee 100644 --- a/docs/api/commands/scrollintoview.mdx +++ b/docs/api/commands/scrollintoview.mdx @@ -43,7 +43,7 @@ Pass in an options object to change the default behavior of `.scrollIntoView()`. | `offset` | `{top: 0, left: 0}` | Amount to scroll after the element has been scrolled into view | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.scrollIntoView()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.scrollIntoView()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -91,23 +91,23 @@ or ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.scrollIntoView()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.scrollIntoView()` will automatically wait for assertions you have chained to pass -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.scrollIntoView()` can time out waiting for assertions you've added to pass. ## Command Log -#### Assert element is visible after scrolling it into view +**_Assert element is visible after scrolling it into view_** ```javascript cy.get('#scroll-horizontal button').scrollIntoView().should('be.visible') diff --git a/docs/api/commands/scrollto.mdx b/docs/api/commands/scrollto.mdx index e21e02d511..1d4161d2d2 100644 --- a/docs/api/commands/scrollto.mdx +++ b/docs/api/commands/scrollto.mdx @@ -73,7 +73,7 @@ Pass in an options object to change the default behavior of `cy.scrollTo()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.scrollTo()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.scrollTo()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -182,12 +182,12 @@ or ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.scrollTo()` requires being chained off a command that yields DOM element(s). - `.scrollTo()` requires the element to be scrollable. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.scrollTo()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/select.mdx b/docs/api/commands/select.mdx index d0d44c8de8..edae1e6d8f 100644 --- a/docs/api/commands/select.mdx +++ b/docs/api/commands/select.mdx @@ -53,7 +53,7 @@ Pass in an options object to change the default behavior of `.select()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.select()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.select()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -253,19 +253,19 @@ disabled ``. See ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.select()` requires being chained off a command that yields DOM element(s). - `.select()` requires the element to be a `select`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.select()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.select()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.select()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/selectfile.mdx b/docs/api/commands/selectfile.mdx index ac131eda43..e7f399476c 100644 --- a/docs/api/commands/selectfile.mdx +++ b/docs/api/commands/selectfile.mdx @@ -89,7 +89,7 @@ Pass in an options object to change the default behavior of `.selectFile()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.selectFile()` to resolve before [timing out](#Timeouts). | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.selectFile()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -261,7 +261,7 @@ cy.get('input[type=file]').selectFile('does-not-exist.yaml') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.selectFile()` requires being chained off a command that yields DOM element(s). With the `input` action (default), it further requires a single @@ -270,12 +270,12 @@ cy.get('input[type=file]').selectFile('does-not-exist.yaml') - If given an alias, `.selectFile()` requires that the subject of the alias must not be `null` or `undefined`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.selectFile()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.selectFile()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/session.mdx b/docs/api/commands/session.mdx index cd702490df..bc56c7ffe8 100644 --- a/docs/api/commands/session.mdx +++ b/docs/api/commands/session.mdx @@ -116,7 +116,7 @@ before `setup` runs, regardless of the `testIsolation` configuration. | `validate` | `undefined` | Validates the newly-created or restored session. Function to run immediately after the session is created and `setup` function runs or after a session is restored and the page is cleared. If it throws an exception, contains any failing Cypress command, returns a Promise which rejects or resolves to `false`, or the last Cypress command yielded `false`, the session is considered invalid.

    - If validation fails immediately after `setup`, the test will fail.
    - If validation fails after restoring a session, `setup` will re-run. | | `cacheAcrossSpecs` | `false` | When enabled, the newly created session is considered "global" and can be restored in any spec during the test execution in the same Cypress run on the same machine. Use this option for a session that will be used multiple times, across many specs. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.session()` yields `null`. @@ -788,8 +788,6 @@ and global sessions and re-run the spec file (see alt="Sessions Instrument Panel" /> -### The command log - Whenever `cy.session()` is called, the command log will show one of the following lines, which includes the status of the session call along with the session `id` value: @@ -832,8 +830,6 @@ remainder of the test. alt="Recreated session (expanded)" /> -### Printing to the console - Clicking a session `id` in the Instrument Panel or clicking the first line under an expanded session group in the command log will print that session's details to the console. This information contains the `id` along with any cached session diff --git a/docs/api/commands/setcookie.mdx b/docs/api/commands/setcookie.mdx index 568e464ae0..f81e87a2a0 100644 --- a/docs/api/commands/setcookie.mdx +++ b/docs/api/commands/setcookie.mdx @@ -45,7 +45,7 @@ Pass in an options object to change the default behavior of `cy.setCookie()`. | `timeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.setCookie()` to resolve before [timing out](#Timeouts) | | `sameSite` | `undefined` | Cookie's SameSite value. If set, should be one of `lax`, `strict`, or `no_restriction`. Pass `undefined` to use the browser's default. Note: `no_restriction` can only be used if the `secure` flag is set to `true`. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.setCookie()` yields a cookie object with the following properties: @@ -77,16 +77,16 @@ cy.getCookie('session_id').should( ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.setCookie()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.setCookie()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.setCookie()` should never time out. @@ -100,6 +100,8 @@ practical purposes it should never happen. ## Command Log +**_Set a cookie on the browser for testing_** + ```javascript cy.getCookies().should('be.empty') cy.setCookie('fakeCookie1', '123ABC') diff --git a/docs/api/commands/shadow.mdx b/docs/api/commands/shadow.mdx index aa948423a5..7b98afe844 100644 --- a/docs/api/commands/shadow.mdx +++ b/docs/api/commands/shadow.mdx @@ -28,7 +28,7 @@ cy.exec('npm start').shadow() // Errors, 'exec' does not yield DOM element cy.get('.not-a-shadow-host').shadow() // Errors, subject must host a shadow root ``` -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.shadow()` yields the new DOM element(s) it found. - `.shadow()` is a query, and it is _safe_ to chain further commands. @@ -51,12 +51,12 @@ cy.get('.shadow-host').shadow().find('.my-button').click() ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.shadow()` requires being chained off a command that yields a DOM element that is a shadow host (i.e. has a shadow root directly attached to it). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.shadow()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -66,7 +66,7 @@ cy.get('.shadow-host').shadow().find('.my-button').click() - `.shadow()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.shadow()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/should.mdx b/docs/api/commands/should.mdx index d798562a95..a39d3cc0ba 100644 --- a/docs/api/commands/should.mdx +++ b/docs/api/commands/should.mdx @@ -65,7 +65,7 @@ A method to be called on the chainer. Pass a function that can have any number of explicit assertions within it. Whatever was passed to the function is what is yielded. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + In most cases, `.should()` yields the same subject it was given from the previous command. @@ -449,11 +449,11 @@ cy.get('button') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.should()` requires being chained off a previous command. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.should()` will continue to [retry](/app/core-concepts/retry-ability) its specified assertions until it times out. diff --git a/docs/api/commands/siblings.mdx b/docs/api/commands/siblings.mdx index 91f4bc48f7..cdde4f5e82 100644 --- a/docs/api/commands/siblings.mdx +++ b/docs/api/commands/siblings.mdx @@ -45,7 +45,7 @@ Pass in an options object to change the default behavior of `.siblings()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.siblings()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.siblings()` yields the new DOM element(s) it found. - `.siblings()` is a query, and it is _safe_ to chain further commands. @@ -81,11 +81,11 @@ cy.get('li').siblings('.active') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.siblings()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.siblings()` will automatically [retry](/app/core-concepts/retry-ability) until the element(s) @@ -93,7 +93,7 @@ cy.get('li').siblings('.active') - `.siblings()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.siblings()` can time out waiting for the element(s) to [exist in the DOM](/app/core-concepts/introduction-to-cypress#Implicit-Assertions). diff --git a/docs/api/commands/spread.mdx b/docs/api/commands/spread.mdx index 37850314be..8b9a9e615f 100644 --- a/docs/api/commands/spread.mdx +++ b/docs/api/commands/spread.mdx @@ -47,7 +47,7 @@ Pass in an options object to change the default behavior of `.spread()`. | --------- | ----------------------------------------------------------------- | ---------------------------------------------------------------------- | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.spread()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.spread()` yields the return value of your callback function. - `.spread()` wlll not change the subject if `null` or `undefined` is returned. @@ -84,24 +84,24 @@ cy.getCookies().spread((cookie1, cookie2, cookie3) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.spread()` requires being chained off a previous command. - `.spread()` requires being chained off a command that yields an array-like structure. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.spread()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.spread()` can time out waiting for a promise you've returned to resolve. ## Command Log -`.spread()` does _not_ log in the Command Log +- `.spread()` does _not_ log in the Command Log ## History diff --git a/docs/api/commands/spy.mdx b/docs/api/commands/spy.mdx index f3e720a5ae..6ac0d31a9f 100644 --- a/docs/api/commands/spy.mdx +++ b/docs/api/commands/spy.mdx @@ -40,7 +40,7 @@ The `object` that has the `method` to be wrapped. The name of the `method` on the `object` to be wrapped. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.spy()` is _synchronous_ and returns a value (the spy) instead of a Promise-like chain-able object. It can be aliased. diff --git a/docs/api/commands/stub.mdx b/docs/api/commands/stub.mdx index 9593b4f40e..175f8480fb 100644 --- a/docs/api/commands/stub.mdx +++ b/docs/api/commands/stub.mdx @@ -40,7 +40,7 @@ The `object` that has the `method` to be replaced. The name of the `method` on the `object` to be wrapped. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.stub()` is _synchronous_ and returns a value (the stub) instead of a Promise-like chain-able object. It can be aliased. diff --git a/docs/api/commands/submit.mdx b/docs/api/commands/submit.mdx index a756bdd66c..10429443e3 100644 --- a/docs/api/commands/submit.mdx +++ b/docs/api/commands/submit.mdx @@ -47,7 +47,7 @@ Pass in an options object to change the default behavior of `.submit()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.submit()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.submit()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -98,16 +98,16 @@ failures. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.submit()` requires being chained off a command that yields DOM element(s). - `.submit()` requires the element to be a `form`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.submit()` will automatically wait for assertions you have chained to pass. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.submit()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/task.mdx b/docs/api/commands/task.mdx index c029bcb0e6..b61c1889d3 100644 --- a/docs/api/commands/task.mdx +++ b/docs/api/commands/task.mdx @@ -98,7 +98,7 @@ Pass in an options object to change the default behavior of `cy.task()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`taskTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.task()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.task()` yields the value returned or resolved by the `task` event in [setupNodeEvents](/app/plugins/plugins-guide#Using-a-plugin). @@ -503,17 +503,17 @@ on('task', { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.task()` requires being chained off of `cy`. - `cy.task()` requires the task to eventually end. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.task()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.task()` can time out waiting for the task to end. diff --git a/docs/api/commands/then.mdx b/docs/api/commands/then.mdx index 0d396964c9..ecafd63b78 100644 --- a/docs/api/commands/then.mdx +++ b/docs/api/commands/then.mdx @@ -49,7 +49,7 @@ Pass in an options object to change the default behavior of `.then()`. Pass a function that takes the previously yielded subject as its first argument. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + Whatever is returned from the callback function becomes the new subject and will flow into the next command (with the exception of `undefined` or `null`). @@ -226,16 +226,16 @@ cy.get('button') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.then()` requires being chained off a previous command. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.then()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.then()` can time out waiting for a promise you've returned to resolve. diff --git a/docs/api/commands/tick.mdx b/docs/api/commands/tick.mdx index edbda2ab7c..860493c510 100644 --- a/docs/api/commands/tick.mdx +++ b/docs/api/commands/tick.mdx @@ -41,7 +41,7 @@ Pass in an options object to change the default behavior of `cy.tick()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + `cy.tick()` yields a `clock` object with the following methods: @@ -118,18 +118,18 @@ cy.clock().invoke('restore') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.tick()` requires being chained off of `cy`. - `cy.tick()` requires that `cy.clock()` be called before it. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.tick()` is a utility command. - `cy.tick()` will not run assertions. Assertions will pass through as if this command did not exist. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.tick()` cannot time out. diff --git a/docs/api/commands/title.mdx b/docs/api/commands/title.mdx index 3da6867c2c..a9d43f73ea 100644 --- a/docs/api/commands/title.mdx +++ b/docs/api/commands/title.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of `cy.title()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.title()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.title()` 'yields the `document.title` property of the current page. - `cy.title()` is a query, and it is _safe_ to chain further commands. @@ -48,16 +48,16 @@ cy.title().should('eq', 'My Awesome Application') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.title()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.title()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.title()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/trigger.mdx b/docs/api/commands/trigger.mdx index c60e5e3c58..88862845dd 100644 --- a/docs/api/commands/trigger.mdx +++ b/docs/api/commands/trigger.mdx @@ -79,7 +79,7 @@ You can also include arbitrary event properties (e.g. `clientX`, `shiftKey`) and they will be attached to the event. Passing in coordinate arguments (`clientX`, `pageX`, etc) will override the position coordinates. -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.trigger()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -262,18 +262,18 @@ command / event you're looking for hasn't been implemented yet. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.trigger()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.trigger()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.trigger()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.trigger()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/type.mdx b/docs/api/commands/type.mdx index 2a4fd56728..7aaa196e32 100644 --- a/docs/api/commands/type.mdx +++ b/docs/api/commands/type.mdx @@ -95,7 +95,7 @@ Pass in an options object to change the default behavior of `.type()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.type()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) + - `.type()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -592,18 +592,18 @@ submitted. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) + - `.type()` requires being chained off a command that yields DOM element(s). -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) + - `.type()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.type()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) + - `.type()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). @@ -611,7 +611,7 @@ submitted. ## Command Log -**Type into the input** +**_Type into the input_** ```javascript cy.get('input[name=firstName]').type('Jane Lane') diff --git a/docs/api/commands/uncheck.mdx b/docs/api/commands/uncheck.mdx index a861fde34d..5d0cc74154 100644 --- a/docs/api/commands/uncheck.mdx +++ b/docs/api/commands/uncheck.mdx @@ -57,7 +57,7 @@ Pass in an options object to change the default behavior of `.uncheck()`. | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `.uncheck()` to resolve before [timing out](#Timeouts) | | `waitForAnimations` | [`waitForAnimations`](/app/references/configuration#Actionability) | Whether to wait for elements to [finish animating](/app/core-concepts/interacting-with-elements#Animations) before executing the command. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.uncheck()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -106,19 +106,19 @@ cy.get('[type="checkbox"]').uncheck(['ga', 'ca']) ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.uncheck()` requires being chained off a command that yields DOM element(s). - `.uncheck()` requires the element to have type `checkbox`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.uncheck()` will automatically wait for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). - `.uncheck()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.uncheck()` can time out waiting for the element to reach an [actionable state](/app/core-concepts/interacting-with-elements). diff --git a/docs/api/commands/url.mdx b/docs/api/commands/url.mdx index c4d828263e..eb83db77bc 100644 --- a/docs/api/commands/url.mdx +++ b/docs/api/commands/url.mdx @@ -41,7 +41,7 @@ Pass in an options object to change the default behavior of `cy.url()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.url()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.url()` yields the current URL as a string. - `cy.url()` is a query, and it is _safe_ to chain further commands. @@ -128,16 +128,16 @@ cy.url().should('contain', '#users/new') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.url()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.url()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.url()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/viewport.mdx b/docs/api/commands/viewport.mdx index b30f6f75bf..cf3f5d2a13 100644 --- a/docs/api/commands/viewport.mdx +++ b/docs/api/commands/viewport.mdx @@ -78,7 +78,7 @@ Pass in an options object to change the default behavior of `cy.viewport()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.viewport()` yields `null`. @@ -276,15 +276,15 @@ describe( ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.viewport()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.viewport()` cannot have any assertions chained. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.viewport()` cannot time out. diff --git a/docs/api/commands/visit.mdx b/docs/api/commands/visit.mdx index 7e27f5cab4..47356ec619 100644 --- a/docs/api/commands/visit.mdx +++ b/docs/api/commands/visit.mdx @@ -82,7 +82,7 @@ By default, the `cy.visit()` commands' will use the `pageLoadTimeout` and You can also set all `cy.visit()` commands' `pageLoadTimeout` and `baseUrl` globally in the [Cypress configuration](/app/references/configuration). -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.visit()` yields the `window` object after the page finishes loading. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -397,18 +397,18 @@ does so immediately before any of your application code runs. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.visit()` requires being chained off of `cy`. - `cy.visit()` requires the response to be `content-type: text/html`. - `cy.visit()` requires the response code to be `2xx` after following redirects. - `cy.visit()` requires the load `load` event to eventually fire. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.visit()` will automatically wait for assertions you have chained to pass -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.visit()` can time out waiting for the page to fire its `load` event. - `cy.visit()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/wait.mdx b/docs/api/commands/wait.mdx index 4c173a8537..6ced05f224 100644 --- a/docs/api/commands/wait.mdx +++ b/docs/api/commands/wait.mdx @@ -99,7 +99,7 @@ Pass in an options object to change the default behavior of `cy.wait()`. | `requestTimeout` | [`requestTimeout`](/app/references/configuration#Timeouts) | Overrides the global `requestTimeout` for this request. Defaults to `timeout`. | | `responseTimeout` | [`responseTimeout`](/app/references/configuration#Timeouts) | Overrides the global `responseTimeout` for this request. Defaults to `timeout`. | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + #### When given a `time` argument: @@ -302,19 +302,19 @@ requests to complete within the given `requestTimeout` and `responseTimeout`. ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - When passed a `time` argument `cy.wait()` can be chained off of `cy` or off another command. - When passed an `alias` argument `cy.wait()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.wait()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.wait()` can time out waiting for the request to go out. - `cy.wait()` can time out waiting for the response to return. diff --git a/docs/api/commands/window.mdx b/docs/api/commands/window.mdx index 6afc4bf2e8..9e92a9ed20 100644 --- a/docs/api/commands/window.mdx +++ b/docs/api/commands/window.mdx @@ -31,7 +31,7 @@ Pass in an options object to change the default behavior of `cy.window()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.window()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.window()` yields the `window` object. - `cy.window()` is a query, and it is _safe_ to chain further commands. @@ -199,16 +199,16 @@ it('should trigger KeyboardEvent with .type inside Cypress event listener', (don ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.window()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.window()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.window()` can time out waiting for assertions you've added to pass. diff --git a/docs/api/commands/within.mdx b/docs/api/commands/within.mdx index 7f21d32a19..a7f9263e1a 100644 --- a/docs/api/commands/within.mdx +++ b/docs/api/commands/within.mdx @@ -47,7 +47,7 @@ Pass in an options object to change the default behavior of `.within()`. | ------ | ------- | ----------------------------------------------------------------------------------- | | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `.within()` yields the same subject it was given. - It is [unsafe](/app/core-concepts/retry-ability#Only-queries-are-retried) @@ -180,17 +180,17 @@ cy.get('form').within(($form) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `.within()` requires being chained off a previous command that yields exactly one DOM element. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `.within()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `.within()` cannot time out. diff --git a/docs/api/commands/wrap.mdx b/docs/api/commands/wrap.mdx index c281a887d4..0992159dbf 100644 --- a/docs/api/commands/wrap.mdx +++ b/docs/api/commands/wrap.mdx @@ -35,7 +35,7 @@ Pass in an options object to change the default behavior of `cy.wrap()`. | `log` | `true` | Displays the command in the [Command log](/app/core-concepts/open-mode#Command-Log) | | `timeout` | [`defaultCommandTimeout`](/app/references/configuration#Timeouts) | Time to wait for `cy.wrap()` to resolve before [timing out](#Timeouts) | -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.wrap()` yields the object it was called with. @@ -190,24 +190,24 @@ cy.get('some-submit-button') ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.wrap()` requires being chained off of `cy`. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.wrap()`, when its argument is a promise, will automatically wait until the promise resolves. If the promise is rejected, `cy.wrap()` will fail the test. - `cy.wrap()` will automatically [retry](/app/core-concepts/retry-ability) until all chained assertions have passed. -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.wrap()` can time out waiting for assertions you've added to pass. ## Command Log -**Make assertions about object** +**_Make assertions about object_** ```javascript cy.wrap({ amount: 10 }).should('have.property', 'amount').and('eq', 10) diff --git a/docs/api/commands/writefile.mdx b/docs/api/commands/writefile.mdx index bbe481a48a..e18fc71684 100644 --- a/docs/api/commands/writefile.mdx +++ b/docs/api/commands/writefile.mdx @@ -72,7 +72,7 @@ parameter and include encoding there. This is the same behavior as ::: -### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} + - `cy.writeFile()` yields `null`. @@ -205,18 +205,18 @@ cy.readFile(filename, null).then((obj) => { ## Rules -### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} + - `cy.writeFile()` requires being chained off of `cy`. - `cy.writeFile()` requires the file be successfully written to disk. Anything preventing this such as OS permission issues will cause it to fail. -### Assertions [](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} + - `cy.writeFile()` will only run assertions you have chained once, and will not [retry](/app/core-concepts/retry-ability). -### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} + - `cy.writeFile()` can time out when the content being written takes a significant amount of time to encode. diff --git a/docs/api/cypress-api/screenshot-api.mdx b/docs/api/cypress-api/screenshot-api.mdx index 3f7bd74f65..5348868333 100644 --- a/docs/api/cypress-api/screenshot-api.mdx +++ b/docs/api/cypress-api/screenshot-api.mdx @@ -168,7 +168,7 @@ Cypress.Screenshot.defaults({ ## Notes -#### Where to put screenshot configuration +### Where to put screenshot configuration diff --git a/docs/app/continuous-integration/circleci.mdx b/docs/app/continuous-integration/circleci.mdx index b4af9ed1bd..0285ccbff4 100644 --- a/docs/app/continuous-integration/circleci.mdx +++ b/docs/app/continuous-integration/circleci.mdx @@ -90,7 +90,7 @@ Check out the full { }) } - // highlight-start + // only run this test it.only('returns "fizz" when number is multiple of 3', () => { numsExpectedToEq([9, 12, 18], 'fizz') }) - // highlight-end it('returns "buzz" when number is multiple of 5', () => { numsExpectedToEq([10, 20, 25], 'buzz') diff --git a/docs/app/guides/migration/selenium-to-cypress.mdx b/docs/app/guides/migration/selenium-to-cypress.mdx index da0a729949..e7522d2ac4 100644 --- a/docs/app/guides/migration/selenium-to-cypress.mdx +++ b/docs/app/guides/migration/selenium-to-cypress.mdx @@ -230,20 +230,20 @@ Considering the easy and clear syntax of Cypress, transferring all the selectors might take the longest. And while copying and pasting the selectors is definitely an option, rewriting the selectors might be required to conform to the best practices. -##### Multiple tabs +### Multiple tabs When you have the need to interact with multiple browser tabs in Cypress, an official plugin has been provided to accomplish this goal. The [Puppeteer plugin](https://github.com/cypress-io/cypress/tree/develop/npm/puppeteer) utilizes Puppeteer's browser API with one command within Cypress. -##### File upload +### File upload Because Selenium cannot interact with the file upload dialog, it provides a way to upload files without opening the dialog. Cypress provides support uploading files through the built-in [`.selectFile()`](/api/commands/selectfile) command. There are [many options](https://www.cypress.io/blog/2022/01/19/uploading-files-with-selectfile) available to allow you to upload a single file, multiple files, and even drag and drop in Cypress. -##### GraphQL +### GraphQL Given the increasing prominence of GraphQL, the community has responded accordingly. Validating the contents of GraphQL requests or responses is entirely feasible using Cypress's native intercept functionality. This plugin enhances both @@ -324,7 +324,7 @@ it would be remiss not to explore the potential benefits afforded by its feature Some of the core features include: -##### [Test Replay](/cloud/features/test-replay) +#### [Test Replay](/cloud/features/test-replay) One of the major difficulties in troubleshooting headless testing is having to reproduce the failure in your local environment in order to debug failures in CI. Cypress Cloud resolves this issue with Test Replay. Test Replay's @@ -334,7 +334,7 @@ locally so you can swiftly get back to shipping valuable software for your users leading up to crashes or failures by inspecting the DOM, network events, and console logs of your application under test exactly as they ran in CI. -##### [Parallelization](/cloud/features/smart-orchestration/parallelization) +#### [Parallelization](/cloud/features/smart-orchestration/parallelization) To enhance testing efficiency further, Cypress Cloud offers a built-in solution for test parallelization. With a simple toggle, tests can run in parallel, eliminating the need for complex configurations to run tests concurrently. diff --git a/docs/app/guides/test-retries.mdx b/docs/app/guides/test-retries.mdx index a5282dc237..467290d445 100644 --- a/docs/app/guides/test-retries.mdx +++ b/docs/app/guides/test-retries.mdx @@ -65,7 +65,7 @@ also: However, failures in `before` and `after` hooks will not trigger a retry. -#### The following is a detailed step-by-step example of how test retries works: +### The following is a detailed step-by-step example of how test retries works: Assuming we have configured test retries with **2** retry attempts (for a total of 3 attempts), here is how the tests might run: diff --git a/docs/app/references/assertions.mdx b/docs/app/references/assertions.mdx index 0064bd2c2a..7a1f7ac809 100644 --- a/docs/app/references/assertions.mdx +++ b/docs/app/references/assertions.mdx @@ -320,7 +320,7 @@ cy.contains('first todo').should('not.have.class', 'completed') cy.get('[data-testid="loading"]').should('not.be.visible') ``` -#### False passing tests +### False passing tests Negative assertions may pass for reasons you weren't expecting. Let's say we want to test that a Todo list app adds a new Todo item after typing the Todo and diff --git a/docs/app/references/changelog.mdx b/docs/app/references/changelog.mdx index dd3f14a3d8..1113a0a72f 100644 --- a/docs/app/references/changelog.mdx +++ b/docs/app/references/changelog.mdx @@ -2026,7 +2026,7 @@ to 84% faster startup times! [Migration Guide](/app/references/migration-guide#Migrating-to-Cypress-110) which explains the breaking changes in more detail.** -###### Component Testing: +**Component Testing:** - Removed `cssFile`, `cssFiles`, `style`, `styles`, `stylesheet`, and `stylesheets` from the `options` argument to the `cy.mount()` function. We @@ -2069,14 +2069,14 @@ which explains the breaking changes in more detail.** Addresses [#24047](https://github.com/cypress-io/cypress/issues/24047) and [#23427](https://github.com/cypress-io/cypress/issues/23427). -###### General: +**General:** - Communication with the Cypress Dashboard will now verify CAs and reject any unauthorized calls. If you use a self-signed CA you will need to set `npm_config_ca`, `npm_config_cafile`, or `NODE_EXTRA_CA_CERTS`. Addresses [#23980](https://github.com/cypress-io/cypress/issues/23980). -###### Experimental: +**Experimental:** - [`cy.session()`](/api/commands/session) now requires a setup command to use the command. Addresses diff --git a/docs/app/references/configuration.mdx b/docs/app/references/configuration.mdx index 79bac1540a..b539ec29ff 100644 --- a/docs/app/references/configuration.mdx +++ b/docs/app/references/configuration.mdx @@ -354,7 +354,7 @@ readonly and cannot be changed at run time. - `viewportWidth` - `waitForAnimations` -#### `Cypress.config()` +### `Cypress.config()` You can also override configuration values within your test using [`Cypress.config()`](/api/cypress-api/config). @@ -369,7 +369,7 @@ Cypress.config('pageLoadTimeout', 100000) Cypress.config('pageLoadTimeout') // => 100000 ``` -#### Test-specific Configuration +### Test-specific Configuration To apply specific Cypress [configuration](/app/references/configuration) values to a suite or test, pass a configuration object to the test or suite @@ -379,7 +379,7 @@ The configuration values passed in will only take effect during the suite or test where they are set. The values will then reset to the previous default values after the suite or test is complete. -##### Syntax +#### Syntax ```javascript describe(name, config, fn) @@ -388,7 +388,7 @@ it(name, config, fn) specify(name, config, fn) ``` -##### Suite configuration +#### Suite configuration If you want to target a suite of tests to run or be excluded when run in a specific browser, you can override the `browser` configuration within the suite @@ -419,7 +419,7 @@ describe( ) ``` -##### Single test configuration +#### Single test configuration If you want to target a test to run or be excluded when run in a specific browser, you can override the `browser` configuration within the test @@ -659,7 +659,7 @@ See the [plugins guide](/app/plugins/plugins-guide) for more information. ## Common problems -#### `baseUrl` is not set +### `baseUrl` is not set Make sure you do not accidentally place the `baseUrl` config option into the `env` object. The following configuration is _incorrect_ and will not work: @@ -700,7 +700,7 @@ Solution: place the `baseUrl` property outside the `env` object and inside the You can also find a few tips on setting the `baseUrl` in this [short video](https://www.youtube.com/watch?v=f5UaXuAc52c). -#### Test files not found when using `spec` parameter +### Test files not found when using `spec` parameter When using the `--spec ` argument, make it relative to the project's folder. If the specs are still missing, run Cypress with diff --git a/docs/app/references/environment-variables.mdx b/docs/app/references/environment-variables.mdx index e1e8e811c5..2c680b8fcd 100644 --- a/docs/app/references/environment-variables.mdx +++ b/docs/app/references/environment-variables.mdx @@ -21,13 +21,13 @@ Environment variables are useful when: Environment variables can be changed easily - especially when running in CI. -#### Instead of hard coding this in your tests: +### Instead of hard coding this in your tests: ```javascript cy.request('https://api.acme.corp') // this will break on other environments ``` -#### We can move this into a Cypress environment variable: +### We can move this into a Cypress environment variable: ```javascript cy.request(Cypress.env('EXTERNAL_API')) // points to a dynamic env var diff --git a/docs/app/references/trade-offs.mdx b/docs/app/references/trade-offs.mdx index 4eeb6ac9d5..f6191c457f 100644 --- a/docs/app/references/trade-offs.mdx +++ b/docs/app/references/trade-offs.mdx @@ -14,7 +14,7 @@ While at first it may seem like these are strict limitations in Cypress - we think you will soon realize that many of these boundaries are actually **good** to have. In a sense they prevent you from writing bad, slow, or flaky tests. -#### Permanent trade-offs: +## Permanent trade-offs Overview - Cypress is not a general purpose [automation tool](#Automation-restrictions). - Cypress commands run [inside of a browser](#Inside-the-browser). @@ -25,7 +25,7 @@ to have. In a sense they prevent you from writing bad, slow, or flaky tests. Please read our [Cross Origin Testing Guide](/app/guides/cross-origin-testing). -#### Temporary trade-offs: +## Temporary trade-offs Overview We want to highlight some _temporary_ restrictions that Cypress hopes to eventually address. diff --git a/docs/app/tooling/code-coverage.mdx b/docs/app/tooling/code-coverage.mdx index e9dc8b858b..907a3d9ad2 100644 --- a/docs/app/tooling/code-coverage.mdx +++ b/docs/app/tooling/code-coverage.mdx @@ -696,49 +696,49 @@ Even if you only want to measure the back end code coverage Cypress can help. There is a series of videos we have recorded showing code coverage in Cypress -#### How to instrument react-scripts web application for code coverage +### How to instrument react-scripts web application for code coverage -#### Get code coverage reports from Cypress tests +### Get code coverage reports from Cypress tests -#### Excluding code from code coverage reports +### Excluding code from code coverage reports -#### Check code coverage robustly using 3rd party tool +### Check code coverage robustly using 3rd party tool -#### Adding code coverage badge to your project +### Adding code coverage badge to your project -#### Show code coverage in commit status check +### Show code coverage in commit status check -#### Checking code coverage on pull request +### Checking code coverage on pull request ](/app/core-concepts/introduction-to-cypress#Assertions) {#Assertions} diff --git a/docs/partials/_header-requirements.mdx b/docs/partials/_header-requirements.mdx new file mode 100644 index 0000000000..fea4fac72a --- /dev/null +++ b/docs/partials/_header-requirements.mdx @@ -0,0 +1 @@ +### Requirements [](/app/core-concepts/introduction-to-cypress#Chains-of-Commands) {#Requirements} diff --git a/docs/partials/_header-timeouts.mdx b/docs/partials/_header-timeouts.mdx new file mode 100644 index 0000000000..0a54efe817 --- /dev/null +++ b/docs/partials/_header-timeouts.mdx @@ -0,0 +1 @@ +### Timeouts [](/app/core-concepts/introduction-to-cypress#Timeouts) {#Timeouts} diff --git a/docs/partials/_header-yields.mdx b/docs/partials/_header-yields.mdx new file mode 100644 index 0000000000..1d158fca47 --- /dev/null +++ b/docs/partials/_header-yields.mdx @@ -0,0 +1 @@ +### Yields [](/app/core-concepts/introduction-to-cypress#Subject-Management) {#Yields} diff --git a/docs/partials/_test-replay-info.mdx b/docs/partials/_test-replay-info.mdx index 3ee901a5c9..a44ddf8dae 100644 --- a/docs/partials/_test-replay-info.mdx +++ b/docs/partials/_test-replay-info.mdx @@ -2,6 +2,6 @@ Debugging Cypress Cloud Test Runs? -Don't rely on artifact representations or reproducing failing conditions locally. Replay the test as it executed during the recorded run with full debug capability using [ Test Replay](/cloud/features/test-replay). +Don't rely on artifact representations or reproducing failing conditions locally. Replay the test as it executed during the recorded run with full debug capability using [ Test Replay](/cloud/features/test-replay). ::: diff --git a/docs/ui-coverage/configuration/elements.mdx b/docs/ui-coverage/configuration/elements.mdx index 3c1d540159..716d50f5a2 100644 --- a/docs/ui-coverage/configuration/elements.mdx +++ b/docs/ui-coverage/configuration/elements.mdx @@ -31,7 +31,7 @@ If multiple elements on the same snapshot match the same rule, then that rule ca } ``` -#### elements +### elements _Optional._ Object\[] diff --git a/docs/ui-coverage/configuration/overview.mdx b/docs/ui-coverage/configuration/overview.mdx index c96638b5a3..405e8a00e6 100644 --- a/docs/ui-coverage/configuration/overview.mdx +++ b/docs/ui-coverage/configuration/overview.mdx @@ -13,7 +13,7 @@ Configuration allows you to customize and fine-tune UI Coverage in Cypress to su **Note**: By default, setting configuration is limited to Admin users. At your request, this can be changed to allow setting config by all users. Reach out to your Cypress point-of-contact if you would like to change this. -### Setting Configuration +## Setting Configuration To add or modify the configuration for your project, navigate to the "App Quality" tab in your project settings. @@ -69,7 +69,7 @@ You can use the provided editor to write configuration in JSON format. A complet Note that the root-level properties `elementFilters` and `viewFilters` apply to both UI Coverage and Accessibility. These properties can also be nested under `uiCoverage` or `accessibility` to apply to only that product, with nested configuration taking precedence over root-level configuration. The `views` property also applies to both products but cannot be nested. -### Viewing Configuration for a Run +## Viewing Configuration for a Run You can view configuration information for each run in the Properties tab, as shown below. This is the configuration set for the project at the start of the run. diff --git a/docs/ui-coverage/core-concepts/element-grouping.mdx b/docs/ui-coverage/core-concepts/element-grouping.mdx index 19892f7e44..e2e7ccf204 100644 --- a/docs/ui-coverage/core-concepts/element-grouping.mdx +++ b/docs/ui-coverage/core-concepts/element-grouping.mdx @@ -13,7 +13,7 @@ When multiple elements on a page have the same behavior, testing each element in UI Coverage groups elements that are related to one another through structural or behavioral hints. A group of elements is considered one element when it comes to scoring, and interacting with any element in the group will cause all elements in the group to be considered tested (e.g. clicking one treats all of them as having been clicked). -### Grouping Rules +## Grouping Rules - Elements are grouped by [elementgroups](/ui-coverage/configuration/elementgroups) configuration if defined. - `label` elements are grouped with the form elements with which they are associated. diff --git a/src/components/badge/style.module.css b/src/components/badge/style.module.css index edad24be91..4ca26d4ae6 100644 --- a/src/components/badge/style.module.css +++ b/src/components/badge/style.module.css @@ -25,19 +25,11 @@ h1 > .badge { .danger { background-color: var(--ifm-color-red-100); color: var(--ifm-color-red-600); - - [data-theme='dark'] & { - background-color: var(--ifm-color-red-1000); - } } .info { background-color: var(--ifm-color-teal-100); color: var(--ifm-color-teal-600); - - [data-theme='dark'] & { - background-color: var(--ifm-color-teal-1000); - } } /* large light-green badge in page/content titles */ diff --git a/src/components/icon/index.tsx b/src/components/icon/index.tsx index 1834e3f8ea..441308dd9e 100644 --- a/src/components/icon/index.tsx +++ b/src/components/icon/index.tsx @@ -8,9 +8,10 @@ interface IconProps { url?: string; callout?: string; contentType?: string; + title?: string; } -export default function Icon({ name, color, inline, url, callout, contentType }: IconProps) { +export default function Icon({ name, color, inline, url, callout, contentType, title }: IconProps) { const iconName = name === "github" ? ["fab", "github"] : name; const space = inline ? '.25rem' : '0.5rem' @@ -29,7 +30,7 @@ export default function Icon({ name, color, inline, url, callout, contentType }: return ( <> - + { url ? { content } : null} ) diff --git a/src/components/plugins-list/style.module.css b/src/components/plugins-list/style.module.css index 8bedb1a15a..fc7721b257 100644 --- a/src/components/plugins-list/style.module.css +++ b/src/components/plugins-list/style.module.css @@ -82,22 +82,22 @@ ul.pluginsList li p { } .badgePill.badgeOfficial { - background-color: #11d3d7; + background-color: var(--ifm-color-teal-500); } .badgePill.badgeVerified { - background-color: #25bd4d; + background-color: var(--ifm-color-jade-500); } .badgePill.badgeCommunity { - background-color: #9d44eb; + background-color: var(--ifm-color-indigo-500); } .badgePill.badgeDeprecated { - background-color: #7f112c; + background-color: var(--ifm-color-red-600); } .keyword { font-weight: 300; - color: #777; + color: var(--ifm-color-gray-800); } diff --git a/src/css/markdown.scss b/src/css/markdown.scss index 1fbf59d681..f0b85c4648 100644 --- a/src/css/markdown.scss +++ b/src/css/markdown.scss @@ -60,6 +60,10 @@ div.markdown { border-bottom: 1px solid var(--ifm-link-color); color: var(--ifm-link-hover-color); } + + html[data-theme='dark'] & { + color: var(--ifm-color-indigo-200); + } } a.cy-button-width { diff --git a/src/css/sidebar.scss b/src/css/sidebar.scss index 08ce741296..5752fc5a34 100644 --- a/src/css/sidebar.scss +++ b/src/css/sidebar.scss @@ -1,39 +1,8 @@ -.theme-doc-sidebar-item-category { - padding-bottom: 0.3rem; -} - -body .theme-doc-sidebar-container { - @apply border-r border-gray-1000/[0.07]; - html[data-theme='dark'] & { - @apply border-gray-900; +.theme-doc-sidebar-container { + // Not happy about this, but I can't figure out how to target this otherwise + a.text-indigo-500 { + [data-theme='dark'] & { + color: var(--ifm-color-indigo-300) + } } -} - -/* sidebar menu */ -.theme-doc-sidebar-menu { - padding: 0.75rem; - font-family: 'Roboto'; - font-size: 1.1rem; -} -/* sidebar menu children */ -.theme-doc-sidebar-item-link-level-2, -.theme-doc-sidebar-item-link-level-3, -.theme-doc-sidebar-item-link-level-4 { - font-size: 1.025rem; -} - -/* sidebar menu collapsible children */ -.theme-doc-sidebar-item-category-level-2, -.theme-doc-sidebar-item-category-level-3 > .menu__list-item-collapsible { - font-size: 1.025rem; -} - -/* sidebar chevrons */ -.menu__link--sublist:after { - background: var(--ifm-menu-link-sublist-icon) 50%/1.7rem 1.7rem; -} - -// helps delineate different refs in sidebar, particularly in API section -.theme-doc-sidebar-item-link.theme-doc-sidebar-item-link-level-2.menu__list-item.sidebar-guide-ref { - font-weight: 600; -} +} \ No newline at end of file diff --git a/src/css/table-of-contents.scss b/src/css/table-of-contents.scss index e21ad1ca03..486e6dc858 100644 --- a/src/css/table-of-contents.scss +++ b/src/css/table-of-contents.scss @@ -6,7 +6,7 @@ a:hover { @apply text-indigo-500; html[data-theme='dark'] & { - @apply text-indigo-400; + @apply text-indigo-300; } } } @@ -33,7 +33,7 @@ .table-of-contents .table-of-contents__link--active { @apply text-indigo-500; html[data-theme='dark'] & { - @apply text-indigo-400; + @apply text-indigo-300; } font-weight: 700; } diff --git a/src/theme/MDXComponents.js b/src/theme/MDXComponents.js index ec28107fa1..98830e7ded 100644 --- a/src/theme/MDXComponents.js +++ b/src/theme/MDXComponents.js @@ -17,6 +17,10 @@ import DocumentDomainWorkaround from "@site/docs/partials/_document-domain-worka 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"; +import HeaderAssertions from "@site/docs/partials/_header-assertions.mdx"; +import HeaderRequirements from "@site/docs/partials/_header-requirements.mdx"; +import HeaderTimeouts from "@site/docs/partials/_header-timeouts.mdx"; +import HeaderYields from "@site/docs/partials/_header-yields.mdx"; import Icon from "@site/src/components/icon"; import ImportMountFunctions from "@site/docs/partials/_import-mount-functions.mdx"; import IntellisenseCodeCompletion from "@site/docs/partials/_intellisense-code-completion.mdx"; @@ -156,6 +160,10 @@ export default { E2EOnlyBadge, E2EOrCtTabs, VueSyntaxTabs, + HeaderAssertions, + HeaderRequirements, + HeaderTimeouts, + HeaderYields, Icon, ImportMountFunctions, IntellisenseCodeCompletion, diff --git a/src/theme/TOC/index.tsx b/src/theme/TOC/index.tsx index 194636ab88..c77d3ecfe5 100644 --- a/src/theme/TOC/index.tsx +++ b/src/theme/TOC/index.tsx @@ -5,7 +5,7 @@ import TOC from '@theme-original/TOC' export default function TOCWrapper(props) { return ( <> -

    +

    Contents