mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-19 17:14:57 +00:00
[ADF-4195] Automation tests for SSO login with implicitFlow false (#4410)
* [ADF-4195] Automation tests for SSO login with implicitFlow false * rebase * fix test sso implicit flow false * lint fix * fix test
This commit is contained in:
parent
a04077679c
commit
355971e0ad
@ -20,14 +20,17 @@ import { SettingsPage } from '../../../pages/adf/settingsPage';
|
||||
import TestConfig = require('../../../test.config');
|
||||
import { browser } from 'protractor';
|
||||
import { NavigationBarPage } from '../../../pages/adf/navigationBarPage';
|
||||
import { LoginPage } from '../../../pages/adf/loginPage';
|
||||
|
||||
describe('Login component - SSO', () => {
|
||||
|
||||
const settingsPage = new SettingsPage();
|
||||
const loginApsPage = new LoginSSOPage();
|
||||
const loginPage = new LoginPage();
|
||||
const navigationBarPage = new NavigationBarPage();
|
||||
let silentLogin, implicitFlow;
|
||||
|
||||
describe('Login component - SSO', () => {
|
||||
describe('Login component - SSO implicit Flow', () => {
|
||||
|
||||
afterEach(() => {
|
||||
navigationBarPage.clickLogoutButton();
|
||||
@ -38,18 +41,16 @@ describe('Login component - SSO', () => {
|
||||
it('[C261050] Should be possible login with SSO', () => {
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false, true, 'alfresco');
|
||||
loginApsPage.clickOnSSOButton();
|
||||
browser.ignoreSynchronization = true;
|
||||
loginApsPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
|
||||
it('[C280667] Should be redirect directly to keycloak without show the login page with silent login', () => {
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, true, true, 'alfresco');
|
||||
browser.ignoreSynchronization = true;
|
||||
loginApsPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
|
||||
});
|
||||
});
|
||||
|
||||
describe('SSO Login Error for login componentO', () => {
|
||||
describe('SSO Login Error for login component', () => {
|
||||
|
||||
it('[C299205] Should display the login error message when the SSO identity service is wrongly configured', () => {
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, 'http://aps22/auth/realms/alfresco', TestConfig.adf.hostIdentity, false, true, 'alfresco');
|
||||
@ -59,4 +60,35 @@ describe('Login component - SSO', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('Login component - SSO Grant type password (implicit flow false)', () => {
|
||||
|
||||
it('[C299158] Should be possible to login with SSO, with grant type password (Implicit Flow false)', () => {
|
||||
implicitFlow = false;
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin, implicitFlow, 'alfresco');
|
||||
|
||||
loginPage.waitForElements();
|
||||
|
||||
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin, implicitFlow, 'alfresco');
|
||||
browser.ignoreSynchronization = true;
|
||||
|
||||
loginPage.enterUsername(TestConfig.adf.adminEmail);
|
||||
loginPage.enterPassword(TestConfig.adf.adminPassword);
|
||||
loginPage.clickSignInButton();
|
||||
|
||||
let isDisplayed = false;
|
||||
|
||||
browser.wait(() => {
|
||||
loginPage.header.isDisplayed().then(
|
||||
() => {
|
||||
isDisplayed = true;
|
||||
},
|
||||
() => {
|
||||
isDisplayed = false;
|
||||
}
|
||||
);
|
||||
return isDisplayed;
|
||||
}, TestConfig.main.timeout, 'Element is not visible ' + loginPage.header.locator());
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -60,7 +60,6 @@ module.exports = {
|
||||
}(),
|
||||
|
||||
hostIdentity: function () {
|
||||
console.log((PROXY + '/auth'));
|
||||
return "http://" + (HOST_IDENTITY ? HOST_IDENTITY : (PROXY + '/auth/admin/realms/alfresco'));
|
||||
}()
|
||||
|
||||
|
@ -188,7 +188,7 @@ export class LoginComponent implements OnInit {
|
||||
onSubmit(values: any) {
|
||||
this.disableError();
|
||||
|
||||
if (this.authService.isOauth() && this.authService.isSSODiscoveryConfigured()) {
|
||||
if (this.authService.isOauth() && !this.authService.isSSODiscoveryConfigured()) {
|
||||
this.errorMsg = 'LOGIN.MESSAGES.SSO-WRONG-CONFIGURATION';
|
||||
this.isError = true;
|
||||
} else {
|
||||
|
@ -27,6 +27,7 @@ export class LoginSSOPage {
|
||||
loginError = element(by.css(`div[data-automation-id="login-error"]`));
|
||||
|
||||
loginSSOIdentityService(username, password) {
|
||||
browser.ignoreSynchronization = true;
|
||||
BrowserVisibility.waitUntilElementIsVisible(this.usernameField);
|
||||
this.enterUsername(username);
|
||||
this.enterPassword(password);
|
||||
|
@ -35,9 +35,9 @@ if (process.env.NAME_TEST) {
|
||||
let args_options = [];
|
||||
|
||||
if (BROWSER_RUN === 'true') {
|
||||
args_options = ['--incognito', '--window-size=1366,768', '--disable-gpu'];
|
||||
args_options = ['--incognito', '--window-size=1366,768', '--disable-gpu', '--disable-web-security'];
|
||||
} else {
|
||||
args_options = ['--incognito', '--headless', '--window-size=1366,768', '--disable-gpu'];
|
||||
args_options = ['--incognito', '--headless', '--window-size=1366,768', '--disable-gpu', '--disable-web-security'];
|
||||
}
|
||||
|
||||
let downloadFolder = path.join(__dirname, 'e2e/downloads');
|
||||
|
Loading…
x
Reference in New Issue
Block a user