I am automating web UI tests using Selenium. These tests are written partly in the spirit of Unit tests, that is they try their best to leave the application in the same state in which they found it. For instance, if a test registers a support ticket using the web UI, it is expected to remove it and the end of the test using the web UI.
Compared to unit tests, these kinds of tests do much more, not in terms of actual code executed or processes triggered, but in terms of tested actions. One such hypothetical test would be:
- (Actor 1) register support ticket;
- (Actor 1) comment with initial data;
- (Actor 2) reply with request for more information
- (Actor 1) upload more information
- (Actor 2) comment that issue is fixed
- (Actor 1) close issue
All of these actions are verified during a test, and should one fail, the application data is inconsistent.
Is there a better way of making end-to-end tests self-contained and idempotent?
Is there a better way of making end-to-end tests self-contained and idempotent?