From cdcff5b4e8b065ab5041f4504a55ffdfb44ba59a Mon Sep 17 00:00:00 2001 From: gmandakini <45559635+gmandakini@users.noreply.github.com> Date: Mon, 18 Feb 2019 15:18:45 +0000 Subject: [PATCH] [ADF-3981] - Should be possible to login with valid credentials (#4231) * in progress * updated the hardcoded url to TestConfig one. --- e2e/core/login/login-component.e2e.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/e2e/core/login/login-component.e2e.ts b/e2e/core/login/login-component.e2e.ts index 9d838e8a14..b28e5b415b 100644 --- a/e2e/core/login/login-component.e2e.ts +++ b/e2e/core/login/login-component.e2e.ts @@ -54,6 +54,8 @@ describe('Login component', () => { password: 'Enter your password to sign in', required: 'Required' }; + let invalidUsername = 'invaliduser'; + let invalidPassword = 'invalidpassword'; beforeAll(async (done) => { this.alfrescoJsApi = new AlfrescoApi({ @@ -250,4 +252,17 @@ describe('Login component', () => { loginPage.checkLoginImgURL('https://rawgit.com/Alfresco/alfresco-ng2-components/master/assets/angular2.png'); }); + it('[C291854] Should be possible login in valid credentials', () => { + browser.get(TestConfig.adf.url); + loginPage.waitForElements(); + expect(loginPage.getSignInButtonIsEnabled()).toBe(false); + loginPage.enterUsername(invalidUsername); + expect(loginPage.getSignInButtonIsEnabled()).toBe(false); + loginPage.enterPassword(invalidPassword); + expect(loginPage.getSignInButtonIsEnabled()).toBe(true); + loginPage.clickSignInButton(); + expect(loginPage.getLoginError()).toEqual(errorMessages.invalid_credentials); + loginPage.login(adminUserModel.id, adminUserModel.password); + }); + });