Learn how to write robust and articulate tests using the Screenplay Pattern, an innovative approach to writing BDD-style automated acceptance tests that are easier to understand, easier to extend and easier to maintain.
6. @Wakaleo @JanMolak#SerenityBDD
source:
- 44% - “Out of Control - Why Control Systems Go Wrong and How to Prevent Failure”
- 56% - “An Information Systems Manifesto”
- 80% - “Requirements: A quick and inexpensive way to improve testing”
44-80%of all defects are caused by unclear,
ambiguous or incorrect requirements
10. @Wakaleo @JanMolak#SerenityBDD
Building the
application
Testing the
application
When we are…
We model…
The domain
How the user interacts
with the application
Account
Purchase
Product
Open an account
Look for a
product
Completes a
purchase
NOUNS VERBS
The key
concepts
are…
48. @Wakaleo @JanMolak#SerenityBDD
public class TodoList {
public static Target WHAT_NEEDS_TO_BE_DONE = Target.the("'What needs to be done?' field")
.locatedBy(“#new-todo");
public static Target ITEMS = Target.the("List of todo items")
.locatedBy(".view label");
public static Target ITEMS_LEFT = Target.the("Count of items left")
.locatedBy("#todo-count strong”);
public static Target FILTER = Target.the("filter")
.locatedBy("//*[@id='filters']//a[.='{0}']");
}
Page
Objects
are much
simpler
59. @Wakaleo @JanMolak#SerenityBDD
‣ “Page Objects Refactored: SOLID Steps to the Screenplay/
Journey Pattern” - DZone
Antony Marcano, Andy Palmer, Jan Molak, John Ferguson Smart
bit.ly/screenplay-page-objects
‣ “Beyond Page Objects: Next Generation Test Automation
with Serenity and the Screenplay Pattern” - InfoQ
John Ferguson Smart, Antony Marcano, Andy Palmer, Jan Molak
bit.ly/screenplay-introduction
Want to know more?
60. @Wakaleo @JanMolak#SerenityBDD
Want to know more?
Learn about Serenity:
serenity-bdd.info
Learn more about BDD and Serenity, and how we can help:
http://johnfergusonsmart.com
See the project in action:
bit.ly/screenplay-jvm-demo