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
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Objectify the Screenplay: A Story of Patterns
QA: Challenge Accepted 3.0 presentation
apetkova
March 18, 2017
More Decks by apetkova
See All by apetkova
Stop Testing, Start Building Quality
apetkova
0
65
The Framework That Knows Its Bugs
apetkova
0
350
Automation Frameworks: First Contact
apetkova
0
160
Quality And The Squad Framework
apetkova
0
260
Motivation 3.0: Burying the carrot & stick
apetkova
0
230
Ex Machina: The framework that knows its bugs
apetkova
0
160
Other Decks in Technology
See All in Technology
"何を作るか"を任される エンジニアは、どう育つのか
yutaokafuji
1
590
FinOps × AIエージェントで実現する コストインシデントの自動調査
oasis1994liveforever
0
120
ACE-Step-1.5で見る 音楽生成AIのしくみと“破綻だけ直す”Retake機能の開発【zennfes spring 2026 登壇資料】
personabb
1
120
AI駆動開発を通して感じた、 AI時代のデザイナーの役割変化
whisaiyo
0
230
Socrates × Looker 〜セマンティックレイヤーで進化するデータ分析エージェント〜
hanon52_
3
2.1k
Claude Code×Terraform IaC テンプレート駆動開発
itouhi
1
490
エラーバジェットのアラートのタイミングを考える.pdf
kairim0
0
110
Microsoft Build Keynoteふりかえり
tomokusaba
0
120
ポケモンの型をTypeScriptの型システムで表現してみた
subroh0508
0
370
Oracle AI Database@AWS:サービス概要のご紹介
oracle4engineer
PRO
4
2.9k
On-behalf-of Token exchange with AgentCore Identity
hironobuiga
2
150
小さく始める AI 活用推進 ― 日経電子版 Web チームの事例/nikkei-tech-talk47
nikkei_engineer_recruiting
0
220
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
570
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
330
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Writing Fast Ruby
sferik
630
63k
My Coaching Mixtape
mlcsv
0
140
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Heart Work Chapter 1 - Part 1
lfama
PRO
7
36k
Embracing the Ebb and Flow
colly
88
5.1k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
320
What's in a price? How to price your products and services
michaelherold
247
13k
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