Test Automation
Using Screen Play Design Pattern
Test Automation
● Why ‘Test Automation’ ?
○ To reduce manual efforts
○ Continuous integration
● Purpose
○ Is it making you slow ?
○ End to end test
■ Minimal journey
Page object pattern
Is there any pattern ?
Assertions
Features / Jobs / functions
Locators
SOLID
S : Single Responsibility
O : Open Close Principle
L : Liskov substitution
I : Interface segregation
D: Dependency inversion
Single Responsibility
Responsibility
● How to strike right balance
○ Too many fragments
■ Test becomes too noisy
○ Too big component
■ Loose flexibility
● How to define a task and how to make sure we build a building blocks ?
○ Dont define action
■ Interaction can change.
Open Close Principle
Apply SOLID principle To POM
1. Single responsibility
2. Open close principle
Assertions Features Locators
AT High level
Questions
Task UI
ScreenPlay Design Pattern
Setup Screenplay
1. Generate Project
a. $ mvn archetype:generate -Dfilter=screenplay
i. Enter 1 and select a version
ii. 'groupId': : net.serenitybdd.tutorials
iii. 'artifactId': : todomvctests
iv. 'package': net.serenitybdd.tutorials
2. Run Test
a. mvn clean verify
DEMO
References
https://www.toptal.com/software/single-responsibility-principle
https://www.codeproject.com/Articles/1185933/Single-Responsibility-Principle-on-
Different-Level
https://www.lego.com/en-us/classic/products
http://mozaicworks.com/blog/open-closed-principle/
http://serenity-bdd.info/docs/articles/screenplay-tutorial.html
http://serenity-bdd.info/docs/articles/screenplay-tutorial.html
Questions ??

Test automation Screen Play Design Pattern