End to End Testing
By definition, unit-tests don't test interactions between modules and some side-effects.
The whole application must also be tested automatically.
Protractor
Protractor is an e2e (end-to-end) testing framework developed by the AngularJS team.
It can test AngularJS or Angular web applications but also non-AngularJS web applications.
Protractor uses the Selenium webdriver to communicate with browsers and control them.
Protractor tests are written in JavaScript (or TypeScript) with Jasmine.
Page objects:
Factorize each view's (or page) logic in a dedicated and reusable class (separation of concerns).
Cross-Browser & Cross-Device Test Automation with Browserstack
Browserstack is a cloud service with a large set of remotely controllable devices and browsers.
With Browserstack, you can run your Protractor tests on mobile and desktop.
Browserstack records logs, captures screenshots and records testing videos.
Apps can also be tested manually on Browserstack.
You can open a tunnel with Browserstack to test locally hosted applications.
Cypress
Cypress is another JavaScript End to End Testing Framework.
It doesn't use Selenium so it's not cross-browser.
With Cypress, it is easier to have a Test-Driven Development approach as tests can be re-run automatically on every change without having to respawn a browser.
Takeaways
Cross-Browser & Cross-Device E2E Testing Automation Blog Post
Boilerplate to run your first protractor tests
https://github.com/wishtack/wt-protractor-boilerplate
Useful modules
https://github.com/wishtack/wt-protractor-runner
https://github.com/wishtack/wt-protractor-utils
Last updated