Angular became the framework of choice for numerous large-scale projects in the media, e-commerce, financial and banking sectors to name but a few.
However, even though the framework itself has changed and improved dramatically since it was originally introduced, the way we design the acceptance tests and the design patterns we use to do that is still stuck in 2009.
This makes it difficult to write E2E tests and use Protractor at scale, especially on projects where multiple teams are involved. In this talk I will demonstrate Serenity/JS, a TypeScript implementation of the popular Serenity BDD library, that lets you test Angular apps using the Screenplay Pattern and benefit from the powerful reporting features provided by Serenity BDD.
Combining the advantages of Protractor, the expressive Screenplay DSL, tooling support for TypeScript, and the powerful reporting features of Serenity BDD, Serenity/JS is set to become the tool of choice for your Angular automated testing!
27. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Click on the “change time” link
28. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Click on the “change time” link
Click on the “Leaving” button
29. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Click on the “change time” link
Click on the “Leaving” button
Select “09:00”
32. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Confirm selection
Click on the “Plan my journey”
33. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Confirm selection
Click on the “Plan my journey”
Wait for the results to load
35. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin: Waterloo
Choose destination: Canary Wharf
Choose time of departure: 9:00 AM
Confirm selection
See a Jubilee Line train at 08:59
38. serenity-js.org#SerenityJS @JanMolak
“Use Protractor to write and run the e2e tests.
End-to-end tests explore the application
as users experience it.
Protractor makes your scenario tests run
faster and in a stable manner.
- Angular website
68. serenity-js.org#SerenityJS @JanMolak
Open the Journey Planner
Choose origin of Waterloo
Choose destination of Canary Wharf
Choose time of departure: 09:00
Confirm selection
See if the fastest train departs at 08:59
95. serenity-js.org#SerenityJS @JanMolak
Questions to ask:
- How much time do I spend maintaining the tests?
- Am I modelling user’s interactions with the system,
or how the system is built?
- Can I share elements of my testing framework with others?
- How much duplication and dead code is there in my tests?
- How long would it take me to find the issue if a test fails?
- How long to change the tests when the system changes?
- Can I use my tests to drive the design of the system?