QA Interview Hub · Knowledge base · Quizzes

Patterns

Screenplay: an overview

What Screenplay is

Screenplay (formerly the Journey pattern) is an alternative to Page Object built around actors, not pages. A popular implementation for TypeScript and Playwright is Serenity/JS.

The main concepts:

  • Actor: who acts (for example, "Olena, a bank customer").
  • Ability: what an actor can do: drive a browser, call an API.
  • Task: a business task composed of other tasks and interactions ("Transfer money").
  • Interaction: a low-level action (a click, typing).
  • Question: what an actor can learn about the system (text, state), used in checks.

A test looks like a description of behaviour: an actor performs tasks and asks questions.

await actorCalled('Olena').attemptsTo(
  Navigate.to('/transfers'),
  TransferMoney.of(100).to('UA002'),
  Ensure.that(Text.of(Balance.label()), equals('900.00 EUR')),
);

The idea is that Tasks are small and independent, easy to combine, and each follows the single responsibility principle. A Page Object, on the contrary, often grows, because it gathers everything on the page.

In an interview: Screenplay models a test through actors, their abilities, tasks and questions to the system, not through pages. In the TS world it is implemented by Serenity/JS, and it scales well to large domain scenarios with several roles.

Screenplay vs POM: when not to

A realistic assessment that is expected at a senior interview:

CriterionPOM + fixturesScreenplay
Learning curvelowhigh
Prevalence in Playwrightthe standardniche
Several roles in a scenarioby handnatural
Amount of codelessmore small classes

Screenplay is justified when many actors interact in one scenario (a customer, an operator, an admin), the domain is complex and tests are written as living documentation.

When NOT to:

  • The team is small or of mixed levels, and the learning curve becomes a bottleneck.
  • A medium-sized project where POM with components and fixtures already covers the needs.
  • You want a "trendy" framework without a real problem it solves.

Playwright fixtures and a Steps layer already give most of the benefits: DI, business steps, reporting through test.step. So for most Playwright projects the standard is POM.

A typical mistake: claiming that Screenplay is "better than POM" without context, or on the contrary dismissing it without knowing the idea. A right answer shows the trade-off.

In an interview: I know Screenplay and understand its advantages for complex domains with several roles, but for most Playwright projects I choose POM with components and fixtures, because the learning curve is lower and the team writes tests faster.