Independent tests
Last updated
Was this helpful?
Last updated
Was this helpful?
A good practice in automation testing is that every test is completely independent of other tests.
Atomic tests:
do not rely on their order
have no dependencies between them, no shared variables
do not require any additional manual preparation
they are small, they should verify just one feature
Benefits of independent end-to-end test cases:
Easier debugging
Can be run in
Easier team collaboration
Ordering tests it's not recommended practice, because end-to-end tests should be atomic (see ).
Example test case: --> login to an admin panel --> check if the user exists --> delete the user
You might be tempted to create one test for user registration and one for checking if the user is created. But all of these steps should be in one test only. You can't split it because one of the tests would need to wait until the first is finished. You won't be able to run the second test without running the first one, it will just lead to problems and so-called spaghetti between the tests.
Here's an e
Solution: simply create a single test with all of these steps, no dependencies, no problems
That's why BugBug doesn't allow you to order tests and combine them or create separate "before & after" steps, even in a . It's better to and use .