-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs for experimental session API #3427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the PR that this is supposed to go with in the TR. Can you link?
@@ -17,9 +17,11 @@ Option | Default | Description | |||
`experimentalComponentTesting` | `false` | Enables component testing using framework-specific adaptors. See {% url "Component Testing" component-testing-introduction %} for more detail. | |||
`experimentalFetchPolyfill` | `false` | Automatically replaces `window.fetch` with a polyfill that Cypress can spy on and stub. Note: `experimentalFetchPolyfill` has been deprecated in Cypress 6.0.0 and will be removed in a future release. Consider using {% url "`cy.intercept()`" intercept %} to intercept `fetch` requests instead. | |||
`experimentalRunEvents` | `false` | Allows listening to the {% url "`before:spec`" before-spec-api %} and {% url "`after:spec`" after-spec-api %} events in the plugins file. | |||
`experimentalSessionSupport` | `false` | Enables support for the Cypress Session API. See {% url `defineSession` defineSession %} and {% url `useSession` useSession %} for more detail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the TR PR to comment on, but I recall us before saying that using the word 'support' in an experimental flag is a bit redundant. Could maybe be experimentalSessions
.
{% fa fa-warning orange %} **This is an experimental feature. In order to use it, you must set the {% url "`experimentalSessionSupport`" experiments %} configuration option to `true`.** | ||
{% endnote %} | ||
|
||
Defines a `Session`. A `Session` a collection of `cookies` and `localStorage` across all domains that may be restored to at any point during a test with the accompanying {% url `cy.useSession()` useSession %} command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably would not put Session
in code ticks. It's just going to be complicated to keep up with and doesn't seem like it's strictly 'code' per se, more of a concept.
|
||
## Yields {% helper_icon yields %} | ||
|
||
Unlike most Cypress commands, `cy.defineSession()` is *synchronous* and returns the `Session` reference instead of a Promise-like chain-able object. This allows you to assign the `Session` object and pass the reference directly to {% url `cy.useSession()` useSession %}. You may also place `cy.defineSession()` calls in a `cypress/support` and export the session objects for use in multiple spec files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This maybe would be ok in code ticks since it is referring to an actual code reference 'Session' object.
These new pages need |
@bkucera since we now have a new docs site, this PR needs to be ported over to a new PR. Please branch off |
Closing in favor of new PR. |
docs for experimental Cypress Session API
need
on
links for: