Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Objectify the Screenplay: A Story of Patterns
Search
apetkova
March 18, 2017
Technology
0
58
Objectify the Screenplay: A Story of Patterns
QA: Challenge Accepted 3.0 presentation
apetkova
March 18, 2017
Tweet
Share
More Decks by apetkova
See All by apetkova
Stop Testing, Start Building Quality
apetkova
0
33
The Framework That Knows Its Bugs
apetkova
0
320
Automation Frameworks: First Contact
apetkova
0
160
Quality And The Squad Framework
apetkova
0
240
Motivation 3.0: Burying the carrot & stick
apetkova
0
220
Ex Machina: The framework that knows its bugs
apetkova
0
140
Other Decks in Technology
See All in Technology
[OCI Technical Deep Dive] OCIで生成AIを活用するためのソリューション解説(2025年8月5日開催)
oracle4engineer
PRO
0
110
AWSの最新サービスでAIエージェント構築に楽しく入門しよう
minorun365
PRO
6
150
Findy Freelance 利用シーン別AI活用例
ness
0
660
Amazon Q Developerを活用したアーキテクチャのリファクタリング
k1nakayama
2
220
LLMで構造化出力の成功率をグンと上げる方法
keisuketakiguchi
0
980
Amazon Inspector コードセキュリティで手軽に実現するシフトレフト
maimyyym
0
130
ZOZOTOWNの大規模マーケティングメール配信を支えるアーキテクチャ
zozotech
PRO
0
550
Claude Codeから我々が学ぶべきこと
oikon48
10
2.8k
生成AIによるデータサイエンスの変革
taka_aki
0
3k
Amazon Q と『音楽』-ゲーム音楽もAmazonQで作成してみた感想-
senseofunity129
0
160
形式手法特論:位相空間としての並行プログラミング #kernelvm / Kernel VM Study Tokyo 18th
ytaka23
3
1.5k
はじめての転職講座/The Guide of First Career Change
kwappa
5
4.3k
Featured
See All Featured
4 Signs Your Business is Dying
shpigford
184
22k
The Language of Interfaces
destraynor
158
25k
Making Projects Easy
brettharned
117
6.3k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
110
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.8k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
283
13k
Side Projects
sachag
455
43k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.4k
A designer walks into a library…
pauljervisheath
207
24k
Six Lessons from altMBA
skipperchong
28
3.9k
Transcript
A STORY OF PATTERNS
About Me Aneta Petkova Automation QA Lead, Honeywell Aerospace
[email protected]
linkedin.com/in/apetkova/
Overview Journey #1: Back in time ••The PageObject pattern Journey
#2: Into the now ••The Screenplay pattern Journey #3: Looking at tomorrow ••No spoilers yet
Why should we care about patterns?
The PageObject
PageObject: concept Web Page Page class Test Separation: Keeping things
tidy
PageObject: structure WebDriver config
PageObject: structure WebDriver config Page Object classes
PageObject: structure WebDriver config Page Object classes Test classes
PageObject Web Java private WebElement folderNameLabel; private WebElement downloadAllLink; private
List<WebElement> files; public void sortByName(); public void downloadAll();
PageObject The test method @Test public void sortTest() { BrowseFolderPage
page = new BrowseFolderPage(); page.sortFilesByName(); List<String> actualFileNames = page.getFileNames(); List<String> expectedFileNames = new ArrayList<String>(actualFileNames); expectedFileNames.sort(); Assert.assertEquals(actualFileNames, expectedFileNames, "File names do not match"); }
PageObject The test method @Test public void sortTest() { BrowseFolderPage
page = new BrowseFolderPage(); page.sortFilesByName(); List<String> actualFileNames = page.getFileNames(); List<String> expectedFileNames = new ArrayList<String>(actualFileNames); expectedFileNames.sort(); Assert.assertEquals(actualFileNames, expectedFileNames, "File names do not match"); }
PageObject The test method @Test public void sortTest() { BrowseFolderPage
page = new BrowseFolderPage(); page.sortFilesByName(); List<String> actualFileNames = page.getFileNames(); List<String> expectedFileNames = new ArrayList<String>(actualFileNames); expectedFileNames.sort(); Assert.assertEquals(actualFileNames, expectedFileNames, "File names do not match"); }
PageObject The test method @Test public void sortTest() { BrowseFolderPage
page = new BrowseFolderPage(); page.sortFilesByName(); List<String> actualFileNames = page.getFileNames(); List<String> expectedFileNames = new ArrayList<String>(actualFileNames); expectedFileNames.sort(); Assert.assertEquals(actualFileNames, expectedFileNames, "File names do not match"); } baby_corgi.jpg cartoon_corgi.png snow_corgi.jpg
PageObject The test method @Test public void sortTest() { BrowseFolderPage
page = new BrowseFolderPage(); page.sortFilesByName(); List<String> actualFileNames = page.getFileNames(); List<String> expectedFileNames = new ArrayList<String>(actualFileNames); expectedFileNames.sort(); Assert.assertEquals(actualFileNames, expectedFileNames, "File names do not match"); }
Payoff
Payoff
Payoff
Pitfalls
Pitfalls
Pitfalls
The PageObject
The Screenplay pattern System functionality before system properties Actions before
objects
Screenplay: concept Actor
Screenplay: concept Actor Abilities has
Screenplay: concept Actor Abilities has Actions Tasks enable made up
of performs
Screenplay: concept Actor Abilities Actions Tasks has enable made up
of performs Questions Elements Screen asks about the state of on the interact with
Screenplay: library “Automated Acceptance Testing with Style” - and great
reporting! /Thucydides.info
Screenplay: structure Page Objects
Screenplay: structure Tasks Page Objects
Screenplay: structure State checks Tasks Page Objects
Screenplay: structure Features -> tests State checks Tasks Page Objects
Screenplay The PageObject class public static Target FOLDER_NAME = the(“Folder
name label”).locatedBy(“#locator”); public static Target DOWNLOAD_ALL = the(“Download All link”).locatedBy(“#locator”); public static Target FILES = the(“List of files”).locatedBy(“#locator”);
Screenplay The test method @Test public void should_be_able_to_sort_his_files_by_name() { roland.wasAbleTo(StartWith.aPopulatedFolder());
roland.attemptsTo(SortFilesInFolder.by("Name")); roland.should(seeThat(FileList.displayed(), is(FileList.orderedBy(system)))); }
Screenplay The test method @Test public void should_be_able_to_sort_his_files_by_name() { roland.wasAbleTo(StartWith.aPopulatedFolder())
roland.attemptsTo(SortFilesInFolder.by("Name")); roland.should(seeThat(FileList.displayed(), is(FileList.orderedBy(system)))); }
Screenplay The test method @Test public void should_be_able_to_sort_his_files_by_name() { roland.wasAbleTo(StartWith.aPopulatedFolder());
roland.attemptsTo(SortFilesInFolder .by("Name")); roland.should(seeThat(FileList.displayed(), is(FileList.orderedBy(system)))); }
Screenplay The test method @Test public void should_be_able_to_sort_his_files_by_name() { roland.wasAbleTo(StartWith.aPopulatedFolder());
roland.attemptsTo(SortFilesInFolder.by("Name")); roland.should(seeThat(FileList.displayed(), is(FileList.orderedBy(system)))); }
Serenity report
Serenity report
Payoff
Payoff
Payoff
Payoff
Pitfalls
Pitfalls
Pitfalls
Pitfalls
The middle ground
The middle ground ØFocus on users, not asserts
The middle ground ØFocus on users, not asserts ØKeep tasks
in separate classes
The middle ground ØFocus on users, not asserts ØKeep tasks
in separate classes ØConsider relaxed encapsulation
Define your own journey!
[email protected]
linkedin.com/in/apetkova