-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Cypress based E2E tests #3000
Comments
I think a secondary Docker Compose environment is a good idea, this way we can make sure the test data won't affect other environments. Something we will need to decide is how we are going to Seed Data for the tests... Ordering the tests and using data among them may seem the easiest way, however it's not a good practice. Tests should also not fail when run individually. Another possibility I thought about and noticed on their docs:
There are, of course, other ways to do that, e.g: using a script to seed data instead of a route. Cypress also gives us the possibility to stub API responses, but the problem with it is that we are not actually passing through the backend. Well, let me know what you were thinking for this 😅 |
That's exactly what I had in mind (to rely on tests order to provide data for the following tests), but your'e right -- that's a bad idea and anti pattern. In this case, let's start with using Redash's API to create seed data for as long as possible. If we ever feel this isn't enough, we can look into creating some seed helpers elsewhere. One thing I would consider not doing is to avoid cleaning the database between tests, as this will really slow them down. How about we do some setup before all tests -- like create organization, first admin user and a non admin user, and the rest create per test, but keep it. |
if test setup with |
I already have some code here and I'm planning on opening the PR by tomorrow. For me it sounds fine to use Redash's API with For the test script I'm thinking about using a Node Script with something like:
The advantage of using Node Scripts for this is that we won't have anything but JavaScript related, therefore it will be easier for anyone to work with cypress tests. We could keep Please tell me if you have a better idea for any of this 😁 |
Sounds like a good plan! My only concern is the use of the Module API instead of the CLI. I'm worried we might find ourselves having to rewrite their CLI eventually... But we can start this way and revisit if needed in the future. Eager to see this coming together :) |
Closing as this is already implemented 🙌 |
The first goal is to set initial infrastructure to run Cypress based tests both locally and in the CI along with a few example tests.
For the test environment we can launch secondary Docker Compose environment which will be removed post tests. The test script can be something like:
Regardless the Cypress tests should be configured to take the environment URL as a parameter, so we can use it with remote environments as well.
First tests to create
The text was updated successfully, but these errors were encountered: