Skip to content

Demo for writing E2E tests using protractor and cucumber

License

Notifications You must be signed in to change notification settings

sri85/protractor-cucumber-demo

Repository files navigation

Protractor Cucumber Demo

These selenium tests are written using protractor along with cucumber. Cucumber allows stakeholders like Product Owners, Business analysts to describe test scenarios in plain English.

Framework features:

  1. In addition to this , this framework produces a html report which can be shared with stakeholders and also helps in debugging. The html reports can be found under htmlReports directory.

  2. Ability to capture screenshots on failure which are later attached to the report.

  3. Sends message to slack on completion of test execution.

Instructions for running tests

Pre-requisities

  1. NodeJs
  2. Chrome Browser

Steps

  1. Navigate to moo-e2e folder
  2. Do npm install
  3. Run npm run webdriver-update(This updates all the selenium drivers)
  4. Run npm run webdriver-start(This starts the selenium server)
  5. You can confirm this by visiting this URL
  6. Open a new terminal window and run npm test which runs all the tests.
  7. To shut the selenium server just press ctrl+c in terminal window where the selenium server is running.

Easter-Eggs

Alternatively if you don't want to run the tests in a local chrome browser or you do not have chrome installed on your machine you could run the tests in a docker selenium grid. For this to happen , make sure you have docker installed on your system.

Now run docker-compose up -d, this should spin up a docker selenium grid with one chrome node.

If you are impatient and would like to speed up the test execution increase the chrome nodes by docker-compose scale chromenode=2 and then run npm run paralleltest

FootNotes:

All the above commands have been tested on OsX, have not really checked that these work on other platforms.(Linux should be fine , Windows not really sure)