summary refs log tree commit diff
path: root/webclient/test/protractor.conf.js
diff options
context:
space:
mode:
authorKegan Dougal <kegan@matrix.org>2014-09-22 15:00:23 +0100
committerKegan Dougal <kegan@matrix.org>2014-09-22 15:00:23 +0100
commit90f5eb12701bb7e623c176aa123aad41652f3417 (patch)
treedbc10aa2976e06a10523f64c86312f111c809746 /webclient/test/protractor.conf.js
parentUpdated test README to include a section on environment-protractor.js (diff)
downloadsynapse-90f5eb12701bb7e623c176aa123aad41652f3417.tar.xz
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.
Diffstat (limited to '')
-rw-r--r--webclient/test/protractor.conf.js11
1 files changed, 8 insertions, 3 deletions
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();
+    }
 }