The Screenplay Design Pattern

A Sustainable Way to Organize Complex Test Code

Michael Kutz

@MichaKutz

Page Objects and their short comings

Screenplay Overview

Actors with
Abilities

Performing
Tasks

Answering Questions

Page Objects VS Screenplay

What is the Screenplay pattern?

What is needed to apply it?

How to transform existing tests?

How and when is it better?

JDK ≥ 11

a Java IDE (like IntelliJ IDEA)

Knowing Facts

Extension

Code

Page Objects VS Screenplay

interacts with

Test

Test 2

interacts with

the same

By.name("username")
By.name("username")

Elements

PageObject

uses

uses

to interact with

By.name("username")
login(username, password)

Test

Test 2

Elements

Screenplay

Actor

Abilities

Tasks

Elements

Questions

Actions

enable

has

directs

asks

performs

made up of

interact with

about the state of

Actors with Abilities

Performing Tasks

Answering Questions

Knowing/Learning Facts

Extension

Screenplay

Actor

Abilities

Tasks

Elements

Questions

Actions

Screen

enable

has

directs

asks

performs

made up of

interact with

about the state of

on a

Facts

knows

req. for

Screenplay Design Pattern

By Michael Kutz

Screenplay Design Pattern

  • 375
Loading comments...

More from Michael Kutz