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

fix: Make sure sessions are cleared between tests #168

Merged
merged 2 commits into from Mar 3, 2023

Conversation

skjnldsv
Copy link
Contributor

@skjnldsv skjnldsv commented Mar 3, 2023

Extracted from #157


From the discussion so we can continue here:

@skjnldsv

I would prefer a try/catch or error catch somewhere in case this test is restarted. If we always logout before running this entire test (which is really checking the default state of cypress and nextcloud) does not make sense anymore. :)

Maybe do that on fail ?
docs.cypress.io/api/events/catalog-of-events#Debug-the-moment-a-test-fails

@susnux

This is just run once before, so it just ensures a consistent test environment. So it ensures it does not matter if users.cy.ts is run first or this one.

I think we want to test the login works, so we assume we are logged out on the first test Login and see the default files list so we can enforce this initial state to properly test this scenario, or am I missing something?

@skjnldsv

No, the issue is about the logic.
With independent sessions for each test, we should not have to logout. Manually adding this will circumvent the actual behaviour of those cypress tests :)

Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
@skjnldsv skjnldsv added 3. to review Waiting for reviews bug Something isn't working labels Mar 3, 2023
@skjnldsv skjnldsv requested a review from susnux March 3, 2023 09:10
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
@skjnldsv
Copy link
Contributor Author

skjnldsv commented Mar 3, 2023

After thought, I forgot we were not using session isolation.
So it does make sense to have this in! 👍

@skjnldsv skjnldsv merged commit 72f7feb into master Mar 3, 2023
@skjnldsv skjnldsv deleted the fix/cypress-sessions branch March 3, 2023 12:10
@susnux
Copy link
Contributor

susnux commented Mar 5, 2023

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants