Skip to content

Conversation

@backportbot-nextcloud
Copy link

backport of #2039

azul added 2 commits January 3, 2022 10:45
Use the new session feature to create and reuse sessions:
https://docs.cypress.io/api/commands/session

The first time `login` with a given name is called
the steps described in the login function are performed
and cookies and localstorage are cached.

The next time `login` is called with the same name
cookies and localStorage are restored and used again.

This allows us to keep fast test runs
while still separating the tests more cleanly.

The old logout command was broken because of the way
we used `Cypress.Cookies.defaults({ preserve })` before:

Cypress runs all the `cy.*` commands during initialization
and builds a list of commands that are then executed during the tests.
However `Cypress.Cookies.defaults` is evaluated when preparing the list
not while performing the actual steps.

Signed-off-by: Azul <[email protected]>
Open the test.md file once and then check all the things.

Signed-off-by: Azul <[email protected]>
@backportbot-nextcloud backportbot-nextcloud bot added the tests If you write them we ♥ you label Jan 3, 2022
@backportbot-nextcloud backportbot-nextcloud bot added this to the Nextcloud 23.0.1 milestone Jan 3, 2022
@juliusknorr juliusknorr merged commit aab9041 into stable23 Jan 4, 2022
@juliusknorr juliusknorr deleted the backport/2039/stable23 branch January 4, 2022 08:52
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2022
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests If you write them we ♥ you

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants