add logout sso redirect e2e

This commit is contained in:
Eugenio Romano
2019-03-27 20:08:51 +00:00
parent ded6c4736c
commit 18bf2c58c2
3 changed files with 28 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ import { LoginPage } from '../../../pages/adf/loginPage';
describe('Login component - SSO', () => {
const settingsPage = new SettingsPage();
const loginApsPage = new LoginSSOPage();
const loginSSOPage = new LoginSSOPage();
const loginPage = new LoginPage();
const navigationBarPage = new NavigationBarPage();
let silentLogin, implicitFlow;
@@ -40,13 +40,13 @@ 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();
loginApsPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
loginSSOPage.clickOnSSOButton();
loginSSOPage.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');
loginApsPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
});
});
@@ -54,9 +54,9 @@ describe('Login component - SSO', () => {
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');
loginApsPage.clickOnSSOButton();
loginApsPage.checkLoginErrorIsDisplayed();
expect(loginApsPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
loginSSOPage.clickOnSSOButton();
loginSSOPage.checkLoginErrorIsDisplayed();
expect(loginSSOPage.getLoginErrorMessage()).toContain('SSO Authentication server unreachable');
});
});
@@ -91,4 +91,15 @@ describe('Login component - SSO', () => {
});
});
it('[C280665] Should be possible change the logout redirect URL', () => {
settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, false, true, 'alfresco', '/login');
loginSSOPage.clickOnSSOButton();
loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
navigationBarPage.clickLogoutButton();
browser.getCurrentUrl().then((actualUrl) => {
expect(actualUrl).toEqual(TestConfig.adf.url + '/login');
});
});
});

View File

@@ -44,6 +44,7 @@ export class SettingsPage {
bpmText = element(by.css('input[data-automation-id*="bpmHost"]'));
clientIdText = element(by.css('input[id="clientId"]'));
authHostText = element(by.css('input[id="oauthHost"]'));
logoutUrlText = element(by.css('input[id="logout-url"]'));
basicAuthRadioButton = element(by.cssContainingText('mat-radio-button[id*="mat-radio"]', 'Basic Authentication'));
identityHostText = element(by.css('input[id="identityHost"]'));
ssoRadioButton = element(by.cssContainingText('[id*="mat-radio"]', 'SSO'));
@@ -140,7 +141,7 @@ export class SettingsPage {
await this.ssoRadioButton.click();
}
async setProviderEcmSso(contentServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true, clientId?: string) {
async setProviderEcmSso(contentServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true, clientId?: string, logoutUr: string = '/logout') {
this.goToSettingsPage();
this.setProvider(this.ecm.option, this.ecm.text);
Util.waitUntilElementIsNotOnPage(this.bpmText);
@@ -152,6 +153,7 @@ export class SettingsPage {
await this.setIdentityHost(identityHost);
await this.setSilentLogin(silentLogin);
await this.setImplicitFlow(implicitFlow);
await this.setLogoutUrl(logoutUr);
await this.clickApply();
}
@@ -170,6 +172,12 @@ export class SettingsPage {
await this.clickApply();
}
async setLogoutUrl(logoutUrl) {
Util.waitUntilElementIsPresent(this.logoutUrlText);
this.logoutUrlText.clear();
this.logoutUrlText.sendKeys(logoutUrl);
}
async setProcessServicesURL(processServiceURL) {
Util.waitUntilElementIsVisible(this.bpmText);
this.bpmText.clear();

View File

@@ -125,7 +125,7 @@
<mat-form-field class="adf-full-width" floatLabel="Redirect Uri Logout">
<mat-label>{{ 'CORE.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}</mat-label>
<input matInput placeholder="{{ 'CORE.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}"
<input id="logout-url" matInput placeholder="{{ 'CORE.HOST_SETTINGS.REDIRECT_LOGOUT'| translate }}"
name="redirectUriLogout" formControlName="redirectUriLogout">
</mat-form-field>
</div>