Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs for experimental session API #3427

Closed
wants to merge 3 commits into from
Closed

docs for experimental session API #3427

wants to merge 3 commits into from

Conversation

kuceb
Copy link
Contributor

@kuceb kuceb commented Dec 21, 2020

docs for experimental Cypress Session API

  • info about needing to visit before each test
  • expand setCookie/getCookie docs for new hostOnly option

need on links for:

@kuceb kuceb changed the base branch from develop to 6.2.0-release December 21, 2020 06:38
@jennifer-shehane jennifer-shehane self-requested a review December 21, 2020 08:46
@jennifer-shehane jennifer-shehane mentioned this pull request Dec 21, 2020
8 tasks
Copy link
Member

@jennifer-shehane jennifer-shehane left a 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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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.

@jennifer-shehane
Copy link
Member

These new pages need on links - so a PR against services.

@kuceb kuceb changed the base branch from 6.2.0-release to develop January 4, 2021 16:25
@amirrustam
Copy link
Contributor

@bkucera since we now have a new docs site, this PR needs to be ported over to a new PR. Please branch off master and make the new PR against master. Apologies for the inconvenience as we make this transition.

@amirrustam
Copy link
Contributor

Closing in favor of new PR.

@amirrustam amirrustam closed this Mar 30, 2021
@matthamil matthamil deleted the feat-sessions branch April 14, 2021 20:09
@CypressJosh CypressJosh mentioned this pull request Apr 27, 2021
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants