Skip to content

End-to-end test automation template utilising Protractor for Node JS

License

Notifications You must be signed in to change notification settings

marcdacz/e2e-protractor-node

Repository files navigation

e2e-protractor-node

End-to-end test automation template utilising Protractor

protractor logo

Features:

  • Page Object Model
  • Test Reporting
  • Several Utilities and Helper Functions
  • VSCode Debugging

Installation:

Install node.js then:

$ cd e2e-protractor-node
$ npm install
$ npm run webdriver-update

Execution:

CLI:

  1. To Run Chrome Direct
$ npm run chrome
  1. 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. vscode debug

Test Reporting:

Using jasmine-allure-reporter and allure-commandline

  1. To create report after a test:
$ npm run gen-report
  1. To open the report:
$ npm run open-report

Folder Structure:

  1. config
    • contains the protractor configurations which you can call from the vscode launch options I mentioned above.
  2. pages
    • contains the page object models for pages, userflows or common components (ie. calculatorPage.js, loginUserflow.js or navbarComponent.js).
  3. specs
    • contains the test specs; I recommend placing them in subfolders for better organisation and navigation
  4. utils
    • contains helper functions that can be used all throughout the framework

ToDos:

  • Play around with async/await to make asynchronous tests be more readable
  • Add screenshots/video for failed tests Done adding screenshot for failed test

About

End-to-end test automation template utilising Protractor for Node JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published