End-to-end test automation template utilising Protractor
- Page Object Model
- Test Reporting
- Several Utilities and Helper Functions
- VSCode Debugging
Install node.js then:
$ cd e2e-protractor-node
$ npm install
$ npm run webdriver-update
CLI:
- To Run Chrome Direct
$ npm run chrome
- To Run Chrome and Firefox in Parallel Note: Make sure to install Java JDK
$ npm run webdriver-start
$ npm run chrome-firefox
VSCode Launch:
I have included a launch option for vscode following this guide which will allow you to select it and hit F5 to execute and debug the tests.
Using jasmine-allure-reporter and allure-commandline
- To create report after a test:
$ npm run gen-report
- To open the report:
$ npm run open-report
- config
- contains the protractor configurations which you can call from the vscode launch options I mentioned above.
- pages
- contains the page object models for pages, userflows or common components (ie.
calculatorPage.js
,loginUserflow.js
ornavbarComponent.js
).
- contains the page object models for pages, userflows or common components (ie.
- specs
- contains the test specs; I recommend placing them in subfolders for better organisation and navigation
- utils
- contains helper functions that can be used all throughout the framework
- Play around with async/await to make asynchronous tests be more readable
Add screenshots/video for failed testsDone adding screenshot for failed test