Angular Protractor Testing In Depth
End to end testing doesn’t have to be hard. In this workshop,
learn the ropes of writing end to end tests that are easy to maintain in a rapidly progressing project.
This class applies equally to Angular 1.x and Angular 2+.
There are a few short topics about structuring or annotating your Angular application
to enable easier and more robust tests;
we can explain this using whatever Angular version suits the class.
Prerequisites / Requirements
- Experience in software development (required)
- A computer - this is a hands-on workshop.
- Ability to install software, including Node, NPM, and packages.
- Brief Introduction and Background
- What are automated tests, and why test E2E?
- The testing pyramid
- Many small independent unit tests
- Moderate number of integration tests
- Fewer, scenario-vased end-to-end tests
- Angular-specific testing - Why Protractor?
- Technology and Terminology
- NPM, the package manager
- Protractor, the E2E testing tool
- Jasmine, the testing library
- Selenium / Webdriver, the browser automation tool
- Browsers, including PhantomJS
- Getting Started (Hands-on)
- Installing Node, NPM, Protractor, Selenium
- Configuring Protractor
- Your first test
- Your next few tests
- Development tools
- IDE / editor
- Browser development tools (Chrome, Firefox, etc)
- Selenium recording tools - unfortunately not Protractor-specific
- The Web Platform - refreshed for Protractor Testing
- HTML and the DOM, Document Object Model
- CSS, including CSS selectors for testing
- XPath, briefly
- Growing a Protractor test suite (Hands-on)
- Organizing a test suite
- Creating and using page objects
- Structuring and naming tests, so they are easier to interpret and debug later.
- Testing use cases, rather than features.
- Building use cases over time; extending versus starting anew.
- Failing quickly, saving turnaround time.
- Problems and Solutions (Hands-on)
- Selecting the Target Elements
- Timeouts, one of the worst aspects of E2E browser testing
- Random failures
- Latency - round trips matter
- Post-mortem analysis - logging and screenshots
- Automating the System Under Test
- Automated builds
- Automated deployment
- Database refresh vs data-tolerant test suites
- Scaling Protractor Testing
- Multiple browsers - how many is enough?
- Multiple operating systems - how many is enough?
- A local Selenium grid
- Outsourcing your Selenium grid
- Sauce Labs