Skip to content

End to end testing using Protractor! A Detailed Guide step by step including bugs

ctevans edited this page Apr 1, 2016 · 8 revisions

###Things before running tests:

1: All tests were performed using the Chrome browser. I cannot guarantee that they will work on other browsers.

2: The webpage MUST be in full screen mode, errors occur otherwise.

3: Please do not interact with the webpage launched by the tests.

4: Seemingly irrelevant details that may impact tests; tests were ran only on a 4k resolution.

###How to download, set up, and run the tests.

VERY CRITICAL: If you follow the main protractor installation guide you WILL NOT be able to use these tests. We're using a different version of protractor specific to our version of angular.

#1: Install protractor globally: npm install -g protractor@2

The protractor webpage however says this, THIS DOES NOT WORK: npm install -g protractor

https://github.com/angular/protractor#compatibility

#2: Obtain the webdriver manager: webdriver-manager update

####Now to run the tests:

1: Ensure that you have the back end AND front end running.

Backend: In the backend folder use the command: "rails s"

Frontend: In the frontend folder use the command node server.js

2: Now make sure the webdriver is running using the command: "webdriver-manager start"

3: In the frontend/tests folder use the command: "protractor conf.js

***NOTE: This will run the "main core" of tests, this does not include submit + edit tests as those tests have an extremely unique bug described below.

###Known (bugs?) oddities with testing:

Sometimes (random 50% chance) there will be an issue with the tests that raises the following message (or something quite similar).

  1. Search Test functioning input of ditype Message: UnknownError: unknown error: Element is not clickable at point (761, 578). Other element would receive the click:

or

  1. Search Test submitting a postdoc appointment Message: ElementNotVisibleError: element not visible

This is due to the fact that in the submit page there is a clickable dropdown box that must be clicked. Protractor seems to not click it at seemingly random times. However, the code is there and it does function the other 50% of the time without issue. Unsure how to resolve.

Overall when these elements have errors they cause errors throughout the entire submit page testing (Which yes, is very concerning), despite the tests having had previously worked during creation.