Answer the question
In order to leave comments, you need to log in
Do you write E2E tests independently?
Let's take CRUD, for which we want to write e2e tests. It is often said that tests should be independent of each other. We can write tests in two ways
1) Sequential tests that depend on each other. Example - CREATE is tested first. If all is well, we test UPDATE. Next, we test READ. Finally, we test DELETE. We tested everything, cleaned up the database after ourselves, with a minimum of code duplication.
2) Independent tests. Here, for each method, you will have to write a preparatory setup and cleanup after yourself, for example, to test UPDATE, you will first need to do CREATE, and then DELETE. In this case, the indirect dependency is preserved (?) If, for example, CREATE does not work properly, then UPDATE will also give an error
Do you write e2e tests the first way, or are you still trying to make independent tests? Why?
Answer the question
In order to leave comments, you need to log in
I tried this and that:
1. Purely e2e, when interaction with the server occurs via HTTP
2. Independent, when all data in the database is created in advance, then a couple of actions are done via HTTP, then everything is cleaned.
The first one is a little simpler, and the second one can simulate unusual situations, or create a state that is difficult or impossible to get with one request in a short time (for example, you need to wait a week)
Do you write e2e tests the first way, or are you still trying to make independent tests? Why?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question