The Screenplay Pattern: Better Interactions for Better Automation
summary
Claims that the Screenplay Pattern reduces duplication and flakiness compared with Page Objects and demonstrates it with a C# library Boa Constrictor used at PrecisionLender, implemented against a DuckDuckGo web UI search and a Dog API REST test. Code shows actors with abilities that drive Selenium WebDriver (Selenium 4) and RestSharp, composable tasks and questions like actors use abilities to perform interactions, built‑in waits that poll until a question is true, a composed search task (send keys + click), and clean browser quit behavior.
AI-written summary · about
chapters (28)
- 0:00Intro
- 3:36A simple DuckDuckGo search test
- 4:39Raw WebDriver calls
- 6:26Explicit waits
- 7:09Duplicate code
- 7:25Unintuitive code
- 9:08Page Object Pattern usage
- 9:33Page object duplication redux
- 10:31A base page
- 10:54Base page inheritance
- 11:12Even more duplication?
- 12:54Reconsidering interactions
- 15:09Boa Constrictor
- 16:04Required packages
- 16:21Creating the Actor
- 17:10Adding Abilities
- 18:18Modeling web pages
- 19:29Attempting a Task
- 21:15Asking a Question
- 23:00Composing a custom Interaction
- 24:04Waiting for Questions to yield answers
- 26:11Quitting the web browser
- 26:36A completed test
- 26:49A REST API test
- 29:01SOLID principles
- 29:33Why use Screenplay?
- 31:19Actors use Abilities to perform Interactions
- 31:31Getting started
related talks
48mDesign patterns to boost your test automation
25mTest Craftsmanship: Clean code practices for Test Automation
45mDesign Patterns in Test Automation
14mTest Automation Framework Design and Implementation
27mKnowing your automation
44mPolyglot automation
39mBeyond Page Objects
32mLiving on Crotches or UI Automation Antipatterns
