diff --git a/webclient/login/login.html b/webclient/login/login.html
index 6297ec4d42ec4b0fc4bab1f4f5166a6540dec980..6b321f8fc5ab2b8d886a65643898b07de5dffb9e 100644
--- a/webclient/login/login.html
+++ b/webclient/login/login.html
@@ -23,7 +23,7 @@
                     <br/>
                     <input id="password" size="32" type="password" ng-model="account.password" placeholder="Password"/>
                     <br/><br/>
-                    <button ng-click="login()" ng-disabled="!account.user_id || !account.password || !account.homeserver">Login</button>
+                    <button id="login" ng-click="login()" ng-disabled="!account.user_id || !account.password || !account.homeserver">Login</button>
                     <br/><br/>
                 </div>
 
diff --git a/webclient/test/README b/webclient/test/README
index 088181afc0ec1c044c2e3e51df487fff85000b78..c13010e6149bc43533daa3bc20b11b8df423efb1 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 66f4df54075ceb630869d8ed461c355c68322bc2..720096b3906f35982b8300ad27540a924f9d9a9b 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();
+    }
 }