Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add e2e tests (Protractor) #50

Merged
merged 8 commits into from
Sep 27, 2017
Merged

Add e2e tests (Protractor) #50

merged 8 commits into from
Sep 27, 2017

Conversation

paulbert
Copy link
Member

@paulbert paulbert commented Sep 20, 2017

This commit adds end to end tests with Protractor for the app with a simple login test to get started.

Tests run on a headless instance of Chrome. To do this, I added a Chrome installation to the Vagrantfile.

Since the tests are running within Vagrant, they also access the CouchDB on port 5984 rather than 2200 as they do in the app. I added an Angular environment file for tests which will swap in that port number, so the tests need to be run with the command npm e2e --environment test.

Currently the tests setup by creating a test user (username is available to tests in the browser.params.user variable and password is always e2e) and teardown by deleting that user. As we secure the app with admin users, this will need to change. Not sure what the ideal solution is for this, but having separate test DBs which cannot replicate to our production instances is my first thought.

Full commands to run the tests:

vagrant ssh
cd /vagrant
ng e2e --environment test

Copy link
Contributor

@empeje empeje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change the travis to run headless e2e test too? @dogi @daisywatson @paulbert ?

Copy link
Member

@dogi dogi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jasmine started

  Login
    ✓ should display page header
    ✓ should login

Executed 2 of 2 specs SUCCESS in 12 secs.
Completed tests and removed new user: e2e_1506525200021
[15:13:47] I/launcher - 0 instance(s) of WebDriver still running
[15:13:47] I/launcher - chrome #01 passed

@dogi dogi merged commit 0bfeabb into master Sep 27, 2017
@lmmrssa lmmrssa deleted the add_e2e branch November 7, 2017 05:46
@empeje empeje mentioned this pull request Nov 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants