From 90f5eb12701bb7e623c176aa123aad41652f3417 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 22 Sep 2014 15:00:23 +0100 Subject: Set required environment variables for e2e testing. Added an 'id' to the login button so it can be automatically triggered. Also, added an onPrepare section to protractor.conf to do the login. --- webclient/test/README | 8 ++++++-- webclient/test/protractor.conf.js | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) (limited to 'webclient/test') diff --git a/webclient/test/README b/webclient/test/README index 088181afc0..c13010e614 100644 --- a/webclient/test/README +++ b/webclient/test/README @@ -16,8 +16,12 @@ on. If you do, edit the config to point to that url): webdriver-manager start Create a file "environment-protractor.js" in this directory and type: - var seleniumAddress = 'http://localhost:4444/wd/hub'; - + module.exports = { + seleniumAddress: 'http://localhost:4444/wd/hub', + loginUrl: "http://localhost:8008/_matrix/client/#/login", + username: "YOUR_TEST_USERNAME", + password: "YOUR_TEST_PASSWORD" + } Running e2e tests: protractor protractor.conf.js diff --git a/webclient/test/protractor.conf.js b/webclient/test/protractor.conf.js index 66f4df5407..720096b390 100644 --- a/webclient/test/protractor.conf.js +++ b/webclient/test/protractor.conf.js @@ -1,6 +1,11 @@ var env = require("./environment-protractor.js"); - exports.config = { - seleniumAddress: env.seleniumAddress, - specs: ['e2e/*.spec.js'] + seleniumAddress: env.seleniumAddress, + specs: ['e2e/*.spec.js'], + onPrepare: function() { + browser.driver.get(env.loginUrl); + browser.driver.findElement(by.id("user_id")).sendKeys(env.username); + browser.driver.findElement(by.id("password")).sendKeys(env.password); + browser.driver.findElement(by.id("login")).click(); + } } -- cgit 1.4.1