aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Böhm <felixboehm@gmx.de>2014-08-29 19:56:42 +0200
committerFelix Böhm <felixboehm@gmx.de>2014-08-29 19:56:54 +0200
commitc39dfad25a2272cb7ecf38bb5fef9fda7fa3f2ba (patch)
tree1d6f75007ecc6bde26adc4c6de2a3fea0d2f5785
parent41c5327fca7bd0b1e6c6a4ed20ded4e58bdac92c (diff)
downloadnextcloud-server-c39dfad25a2272cb7ecf38bb5fef9fda7fa3f2ba.tar.gz
nextcloud-server-c39dfad25a2272cb7ecf38bb5fef9fda7fa3f2ba.zip
fix login suite
-rw-r--r--tests/acceptance/tests/login/authentication_spec.js9
-rw-r--r--tests/acceptance/tests/pages/login.page.js9
2 files changed, 11 insertions, 7 deletions
diff --git a/tests/acceptance/tests/login/authentication_spec.js b/tests/acceptance/tests/login/authentication_spec.js
index f331e33fdc8..ad02db40922 100644
--- a/tests/acceptance/tests/login/authentication_spec.js
+++ b/tests/acceptance/tests/login/authentication_spec.js
@@ -3,7 +3,7 @@ var UserPage = require('../pages/user.page.js');
var FirstRunWizardPage = require('../pages/firstRunWizard.page.js');
var Screenshot = require('../helper/screenshot.js');
-describe('Authentication', function() {
+ddescribe('Authentication', function() {
var params = browser.params;
var loginPage;
@@ -31,7 +31,7 @@ describe('Authentication', function() {
new Screenshot(png, 'LoginPage.png');
});
- expect(loginPage.isLoginPage()).toBeTruthy();
+ expect(loginPage.isCurrentPage()).toBeTruthy();
});
it('should meet the locator dependencies', function() {
@@ -57,6 +57,7 @@ describe('Authentication', function() {
new Screenshot(png, 'LoginAsAdmin.png');
});
expect(browser.getCurrentUrl()).toContain('index.php/apps/files/');
+ expect(loginPage.isCurrentPage()).toBeFalsy();
});
it('should return to the login page after logout', function() {
@@ -68,11 +69,13 @@ describe('Authentication', function() {
});
it('should not login with wrong credentials', function() {
- loginPage.login('wrongName', 'wrongPass');
+ loginPage.fillUserCredentilas('wrongName', 'wrongPass');
+ loginPage.loginButton.click();
browser.takeScreenshot().then(function (png) {
new Screenshot(png, 'LoginWrong.png');
});
expect(browser.getCurrentUrl()).not.toContain('index.php/apps/files/');
+ expect(loginPage.isCurrentPage()).toBeTruthy();
});
it('should have rights to visit user management after admin login', function() {
diff --git a/tests/acceptance/tests/pages/login.page.js b/tests/acceptance/tests/pages/login.page.js
index 5244a7f094d..b7019fa54a6 100644
--- a/tests/acceptance/tests/pages/login.page.js
+++ b/tests/acceptance/tests/pages/login.page.js
@@ -11,15 +11,16 @@
// On Page when logged in
this.menuButton = element(by.id('expand'));
this.logoutButton = element(by.id('logout'));
- this.newButton = element(by.css('#new a'));
+ this.newButton = element(by.id('expandDisplayName'));
};
LoginPage.prototype.get = function() {
browser.get(this.url);
};
- LoginPage.prototype.isLoginPage = function() {
- return !!this.loginForm;
+ LoginPage.prototype.isCurrentPage = function() {
+
+ return this.loginForm.isPresent();
};
LoginPage.prototype.fillUserCredentilas = function(user, pass) {
@@ -32,7 +33,7 @@
this.loginButton.click();
var button = this.newButton;
browser.wait(function() {
- return button.isDisplayed();
+ return button.isPresent();
}, 5000, 'load files content');
};