An overview on the concepts of automated End-to-End testing, my experiences with testing Angular applications with the use of Protractor, and a quick technical walkthrough.
7. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/5 1/1
Why E2E tests are brittle
Browser events are asynchronous in nature
Javascript libraries being ready
Stylesheets
Videos and images being loaded
8. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/6 1/1
Why E2E tests are brittle
Browser events are asynchronous in nature
Javascript libraries being ready
Stylesheets
Videos and images being loaded
Browsers behaving differently
Tests run faster on Chrome than Firefox
9. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/7 1/1
Importance of E2E Tests
Tests a complete User Scenario
Automated vs Manual
Credibility towards end-users
10. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/8 1/1
Tests are also part of our
codebase
11. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/9 1/1
Angular and Protractor
13. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/11 1/1
My Books
2. User searches for a title
3. User clicks on Want to Read
button
1. User logs in
successfully
4. Check that title has
been added to list
14. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/12 1/1
In BDD syntax:
As a user
I want to search for a title
So I can add it to my to my Reading list
Given:
That a logged-in user has nothing in his Reading list
When:
User searches for "Life, the Universe, and Everything" and adds it to
his Reading list
Then: "Life, the Universe, and Everything" should be in his Reading
list
16. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/14 1/1
Refactor with Page Objects
Applies separation of concerns
Avoids repetitive code (DRY)
Allows for easier maintenance
Sounds more meaningful and more natural
20. 12/30/2019 End-to-End Testing: Slides
file:///home/jeanella/Downloads/slides-e2e-testing.html#/18 1/1
Wrapping up...
Aim to push tests further down the pyramid when
possible
No need to retest functionalities
Apply the 80/20 rule (Pareto Principle)