I'm starting to get into writing automated Acceptance tests and I'm quite confused where to write these tests against, specifically what layer in the app. Most examples I've seen are Acceptance tests written against the Domain but how about tests like:Given Incorrect Data When the user submits the form Then Play an Error BeepThese seem to be fit for the UI and not for the Domain, or probably even the Service layer.
Where should Acceptance tests be written against?
acceptance testing
Typically, an acceptance test is written against a requirement. Regardless of how you capture requirements, you should have a set of things that your system must be able to do, expressed as a list in an Software Requirements Specification (SRS) or as a collection of user stories, among other options. Each requirement should have an acceptance test associated with it that is run against the system that builds and runs.Acceptance tests come after unit testing (which typically tests at the function, method, and class level), integration testing (class and package level), and system testing (post-integration to ensure that the system functions as designed). After system testing, the developing organization knows that the software works as they intended it. Acceptance testing ensures that the needs of the client/user are fulfilled as specified by the known requirements.