The Screenplay Pattern: Better Interactions for Better Automation

The Screenplay Pattern is a design pattern for automating interactions. It helps you write more readable and maintainable tests. It can be used not only for UI tests but also for Web UI, REST API, mobile, and so on. It is more scalable and reusable for large test automation projects when compared to raw calls or using page objects.

Our guests on this episode:

Andrew Knight is the “Automation Panda” – an engineer, consultant, and international speaker who builds solutions for software testing problems. He has designed and built robust test automation projects for operating systems, service APIs, and Web apps with thousands of tests running continuously. He is the lead developer for Boa Constrictor, the .NET Screenplay Pattern. He also mentors people in good development, testing, and BDD practices. Andy currently works full-time as the Lead Software Engineer in Test at PrecisionLender, a Q2 company. He is a technical blogger and writes on AutomationPanda.com.

Show notes:

[3.29]

Defining Interactions

[4.14]

Simple DuckDuckGo Search Test

[4.50]

Why is it so hard to automate interactions

[5.20]

Raw WebDriver Calls

[7.17]

Implicit Waits

[7.31]

Explicit Waits

[7.57]

Duplicate Code

[8.16]

Unintuitive Code

[8.39]

Page Object Pattern

[10.04]

Page Object Pattern Usage

[10.20]

Page Object Duplicate Redux

[11.23]

A Base Page

[11.50]

Base Page Inheritance

[13.01]

Page Objects are free-form

[14.00]

Reconsidering Interactions

[16.12]

Learn How to Screenplay

[16.22]

Boa Constrictor

[17.01]

Rewriting DuckDuckGo Search Test using Boa Constrictor

[17.22]

Required packages

[17.38]

Creating the actor

[18.30]

Adding abilities

[19.45]

Modeling Web Pages

[21.11]

Attempting a Task

[22.46]

Asking a question

[24.40]

Composing a custom Interaction

[25.42]

Waiting for questions to yield answers

[28.03]

Quitting the Web browser

[28.30]

A completed test

Actors use abilities to perform interactions!

[29.00]

SOLID principles

[29.39]

Why Use Screenplay?

[31.32]

Does Screenplay provide better interactions for better automation?

[32.11]

Getting started with Screenplay

[35.14]

Q & A section

Show links

Andrew Knight
Q2
AutomationPanda.com