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

[stable22] fix: cypress login with new session feature #2055

Merged
merged 2 commits into from
Jan 5, 2022

Conversation

backportbot-nextcloud[bot]
Copy link

@backportbot-nextcloud backportbot-nextcloud bot commented Jan 5, 2022

⚠️ This backport had conflicts and is incomplete ⚠️

backport of #2039

@backportbot-nextcloud backportbot-nextcloud bot added the tests If you write them we ♥ you label Jan 5, 2022
@backportbot-nextcloud backportbot-nextcloud bot added this to the Nextcloud 22.2.4 milestone Jan 5, 2022
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]>
Copy link
Contributor

@azul azul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to push cypress/integration/share.spec.js by hand because the file had changed. Should be fine now though.

@azul azul merged commit 339d191 into stable22 Jan 5, 2022
@delete-merged-branch delete-merged-branch bot deleted the backport/2039/stable22 branch January 5, 2022 13:52
@skjnldsv skjnldsv mentioned this pull request Jan 7, 2022
9 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.

1 participant