A domain layer is the middle layer of a test automation system. It models the exact activities required to complete workflows expressed in the Specification layer and gives sequences of lower-level activities a business meaning. section 14.2.1 section 14.4
The layer separates what an external actor is trying to accomplish from how a specific interface makes it happen. Domain activities use Serenity/JS Screenplay Pattern APIs, while the Integration layer translates them into browser, HTTP, or other interface interactions. section 14.2.1 section 15.1
A useful separation of responsibilities is:
- Keep workflows, business rules, and usage examples in the Specification layer, where stakeholders can understand them. section 14.2.1
- Model meaningful actor activities in the Domain layer instead of exposing sequences of clicks, form entries, or HTTP requests. section 15.1
- Place interface-specific interactions, test-tool integration, interactable elements, test data, and reporting in the Integration layer. section 14.2.1
Booking a plane ticket
A domain model describes a traveler searching for a flight, adjusting a departure date, filling out registration details, and selecting the cheapest flight. The underlying clicks, field entries, and HTTP requests remain implementation details of the Integration layer. section 15.1
Use the layer diagram to locate the Domain layer between stakeholder-facing specifications and technology-facing integrations. section 14.2.1
