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

Extract commonly used test logic to commands #8767

Merged
merged 4 commits into from
May 31, 2022
Merged

Extract commonly used test logic to commands #8767

merged 4 commits into from
May 31, 2022

Conversation

pixeldesu
Copy link
Contributor

What

This PR extracts a lot of the commonly used logic into Cypress commands.

  • cy.resetState() to reset the instance database and IndexedDB
  • cy.registerUser(username, password, isAdmin) to create a (admin) user
  • cy.login(username, password) to log in a user

Why

This reduces code duplication, especially considering we want to write more tests in the future, which require a lot of the same setup code in the beginning.

Additional info (optional)

Not every instance of logging in users or registering them has been replaced. I only replace them in before/after{Each} hooks because if we specifically test if registering/logging in works, that should not be hidden behind an abstraction.

Tests currently fail after a fixed point because the sign-in limiter kicks in, this is already being discussed in #7986.

@syuilo syuilo merged commit d3e242a into misskey-dev:develop May 31, 2022
@syuilo
Copy link
Member

syuilo commented May 31, 2022

🆒

@pixeldesu pixeldesu deleted the feature/test-commands branch May 31, 2022 10:12
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