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

121 use cypress best practises #130

Conversation

RobinMeow
Copy link
Owner

@RobinMeow RobinMeow commented Apr 1, 2024

  • do not use deleteTestUser at end of tests to clean up state (it should also not use the ui with cy.)

  • use cy.task('db:reset') to clean up state before tests when required

  • do not use createTestUser before tests to login (its using the UI as well, which should not be)

  • use minimal login implementation as command (using fetch and storing the response (access token) into localStorage

  • known issue at Cypress localhost URL not accessible after cy.request on server  cypress-io/cypress#25397 (comment)

  • workaround as descibred in the cypress comment. (triggering a fetch to the spa, before all tests run)

@RobinMeow RobinMeow self-assigned this Apr 1, 2024
@RobinMeow RobinMeow linked an issue Apr 1, 2024 that may be closed by this pull request
@RobinMeow RobinMeow changed the title 121 replace deletetestuser at end of tests with db reset before tests 121 use cypress best practises Apr 2, 2024
@RobinMeow RobinMeow merged commit c00bb1a into master Apr 2, 2024
4 checks passed
@RobinMeow RobinMeow deleted the 121-replace-deletetestuser-at-end-of-tests-with-db-reset-before-tests branch April 2, 2024 16:39
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.

replace deleteTestUser at end of tests with db reset before tests
1 participant