An approach and a framework to foster tester-developer collaboration and to avoid clutter when writing E2E tests
Various test automation patterns exist for E2E testing. Examples include the Page Object Model (POM), which structures applications into pages, and the Screenplay Pattern (SP), which models tests as actor interactions. Both are legit but have conceptual drawbacks. The POM enforces a page-based structure, which feels outdated in modern development, where SPAs are common. Applications are better seen as features, components, or bounded contexts. The SP puts users in the role of a screenplay director: assigning actors capabilities and instructions but not engaging directly. Both add overhead and complexity before implementation begins. Many testers resort to copying & pasting code, which can be error-prone. Additionally, both patterns are designed for TAEs, not developers, which discourages their involvement in test automation. This misalignment hinders a whole-team approach.
Our approach, Back-to-the-Primitive (BP), overcomes these limitations with reusable primitives—such as locating elements, entering text, or clicking buttons—to model user interactions. The test programmer can directly write tests using these primitives, while complexity remains encapsulated. BP is both a test automation and middleware pattern other approaches can use. It balances abstraction and practicality, fostering tester-developer collaboration.
We applied BP in two projects using Cypress, Playwright, and TypeScript. In this talk, I will introduce BP, show TypeScript examples, and invite discussion.