From 9d98f3196e3663eb0f3b1b84921d2e6e061f58e6 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 18 Mar 2019 00:18:56 +0000 Subject: [PATCH] [NO-ISSUE] Fix Core E2E tes (#4450) * fix Identity service in core using internal identity service in test env * fix lint * fix lint * fix login * fix travis yml * remove log script --- .travis.yml | 12 +- e2e/actions/APS-cloud/apiservice.ts | 8 +- e2e/actions/APS-cloud/identity.ts | 116 +++++++++--------- e2e/core/login/login-sso/login-sso.e2e.ts | 37 +++--- e2e/core/user-info-component-cloud.e2e.ts | 6 +- e2e/pages/adf/settingsPage.ts | 41 +++++-- .../apps-section-cloud.e2e.ts | 2 +- .../edit-process-filters-component.e2e.ts | 2 +- .../edit-task-filters-component.e2e.ts | 2 +- .../people-group-cloud-component.e2e.ts | 2 +- .../process-custom-filters.e2e.ts | 2 +- .../process-filters-cloud.e2e.ts | 2 +- .../processList-cloud-component.e2e.ts | 2 +- .../start-process-cloud.e2e.ts | 2 +- .../start-task-custom-app-cloud.e2e.ts | 2 +- .../task-details-cloud.e2e.ts | 2 +- .../task-filters-cloud.e2e.ts | 2 +- .../task-list-properties.e2e.ts | 2 +- .../task-list-selection.e2e.ts | 2 +- .../tasks-custom-filters.e2e.ts | 2 +- e2e/test.config.js | 22 ++-- .../pages/login-sso.page.ts | 2 +- scripts/clean-env.js | 3 - scripts/test-e2e-lib.sh | 4 +- 24 files changed, 151 insertions(+), 128 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07e4764682..d16159f052 100644 --- a/.travis.yml +++ b/.travis.yml @@ -134,7 +134,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "core$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" --host_bpm "$E2E_HOST_BPM" --host_identity "$E2E_HOST_IDENTITY" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder core --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder core --skip-lint --use-dist || exit 1;); fi; - stage: e2e Test # Test process-services name: process-services @@ -143,7 +143,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder process-services --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder process-services --skip-lint --use-dist || exit 1;); fi; - stage: e2e Test # Test content-services name: content-services @@ -152,7 +152,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder content-services --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder content-services --skip-lint --use-dist || exit 1;); fi; - stage: e2e Test # Test search name: search @@ -161,7 +161,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "content-services$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder search --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder search --skip-lint --use-dist || exit 1;); fi; - stage: e2e Test # Test process-services-cloud name: process-services-cloud @@ -170,7 +170,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" --host_bpm "$E2E_HOST_BPM" --host_identity "$E2E_HOST_IDENTITY" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder process-services-cloud --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 --host_sso "$E2E_HOST_SSO" --host_bpm "$E2E_HOST_BPM" --host_identity "$E2E_HOST_IDENTITY" -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder process-services-cloud --skip-lint --use-dist || exit 1;); fi; - stage: e2e Test # Test insights name: insights @@ -179,7 +179,7 @@ jobs: AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)"; if [[ $AFFECTED_LIBS =~ "process-services-cloud$" || $AFFECTED_E2E = "e2e" || $TRAVIS_PULL_REQUEST == "false" ]]; then - (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e $E2E_EMAIL -b --folder insights --skip-lint --use-dist || exit 1;); + (./scripts/test-e2e-lib.sh -host localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -b --folder insights --skip-lint --use-dist || exit 1;); fi; - stage: Create Docker PR script: node ./scripts/move-dist-folder.js --base-href $TRAVIS_BUILD_NUMBER && (./scripts/pr-publish.sh -n $TRAVIS_BUILD_NUMBER -r $REPO_DOCKER -u $USERNAME_DOCKER -p $PASSWORD_DOCKER || exit 1) diff --git a/e2e/actions/APS-cloud/apiservice.ts b/e2e/actions/APS-cloud/apiservice.ts index 6621c6df9a..6ef8cef966 100644 --- a/e2e/actions/APS-cloud/apiservice.ts +++ b/e2e/actions/APS-cloud/apiservice.ts @@ -42,7 +42,13 @@ export class ApiService { }; - apiService: any = new AlfrescoApi(this.config); + apiService: any; + + constructor(clientId: string = 'activiti') { + this.config.oauth2.clientId = clientId; + this.apiService = new AlfrescoApi(this.config); + + } async login(username, password) { await this.apiService.login(username, password); diff --git a/e2e/actions/APS-cloud/identity.ts b/e2e/actions/APS-cloud/identity.ts index 5e41f30b8f..d8b616f3d4 100644 --- a/e2e/actions/APS-cloud/identity.ts +++ b/e2e/actions/APS-cloud/identity.ts @@ -20,74 +20,74 @@ import { Util } from '../../util/util'; export class Identity { - api: ApiService = new ApiService(); + api: ApiService; - async init(username, password) { - await this.api.login(username, password); - } + async init(username: string, password: string, clientId?: string) { + this.api = new ApiService(clientId); + await this.api.login(username, password); + } - async createIdentityUser(username = Util.generateRandomString(5), password = Util.generateRandomString(5)) { - await this.createUser(username); - const user = await this.getUserInfoByUsername(username); - await this.resetPassword(user.id, password); - user.password = password; - return user; - } + async createIdentityUser(username = Util.generateRandomString(5), password = Util.generateRandomString(5)) { + await this.createUser(username); + const user = await this.getUserInfoByUsername(username); + await this.resetPassword(user.id, password); + user.password = password; + return user; + } - async deleteIdentityUser(userId) { - await this.deleteUser(userId); - } + async deleteIdentityUser(userId) { + await this.deleteUser(userId); + } - async createUser(username) { - const path = '/users'; - const method = 'POST'; - const queryParams = {}, postBody = { - 'username': username, - 'firstName': username, - 'lastName': 'LastName', - 'enabled': true, - 'email': username + '@alfresco.com' - }; - const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - return data; - } + async createUser(username) { + const path = '/users'; + const method = 'POST'; + const queryParams = {}, postBody = { + 'username': username, + 'firstName': username, + 'lastName': 'LastName', + 'enabled': true, + 'email': username + '@alfresco.com' + }; + const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + return data; + } - async deleteUser(userId) { - const path = `/users/${userId}`; - const method = 'DELETE'; - const queryParams = {}, postBody = { - }; - const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - return data; - } + async deleteUser(userId) { + const path = `/users/${userId}`; + const method = 'DELETE'; + const queryParams = {}, postBody = {}; + const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + return data; + } - async getUserInfoByUsername(username) { - const path = `/users`; - const method = 'GET'; - const queryParams = { 'username' : username }, postBody = {}; + async getUserInfoByUsername(username) { + const path = `/users`; + const method = 'GET'; + const queryParams = { 'username': username }, postBody = {}; - const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - return data[0]; - } + const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + return data[0]; + } - async resetPassword(id, password) { - const path = `/users/${id}/reset-password`; - const method = 'PUT'; - const queryParams = {}, - postBody = {'type': 'password', 'value': password, 'temporary': false}; + async resetPassword(id, password) { + const path = `/users/${id}/reset-password`; + const method = 'PUT'; + const queryParams = {}, + postBody = { 'type': 'password', 'value': password, 'temporary': false }; - const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - return data; - } + const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + return data; + } - async assignRole(userId, roleId, roleName) { - const path = `/users/${userId}/role-mappings/realm`; - const method = 'POST'; - const queryParams = {}, - postBody = [{'id': roleId, 'name': roleName}]; + async assignRole(userId, roleId, roleName) { + const path = `/users/${userId}/role-mappings/realm`; + const method = 'POST'; + const queryParams = {}, + postBody = [{ 'id': roleId, 'name': roleName }]; - const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); - return data; - } + const data = await this.api.performIdentityOperation(path, method, queryParams, postBody); + return data; + } } diff --git a/e2e/core/login/login-sso/login-sso.e2e.ts b/e2e/core/login/login-sso/login-sso.e2e.ts index 8ab5b74ecd..15430b5865 100644 --- a/e2e/core/login/login-sso/login-sso.e2e.ts +++ b/e2e/core/login/login-sso/login-sso.e2e.ts @@ -26,36 +26,33 @@ describe('Login component - SSO', () => { const settingsPage = new SettingsPage(); const loginApsPage = new LoginSSOPage(); const navigationBarPage = new NavigationBarPage(); - let silentLogin; describe('Login component - SSO', () => { - afterEach(() => { - navigationBarPage.clickLogoutButton(); - browser.executeScript('window.sessionStorage.clear();'); - browser.executeScript('window.localStorage.clear();'); - }); + afterEach(() => { + navigationBarPage.clickLogoutButton(); + browser.executeScript('window.sessionStorage.clear();'); + browser.executeScript('window.localStorage.clear();'); + }); - it('[C261050] Should be possible login in the PS with SSO', () => { - silentLogin = false; - settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); - loginApsPage.clickOnSSOButton(); - browser.ignoreSynchronization = true; - loginApsPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); - }); + 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.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity); - browser.ignoreSynchronization = true; - loginApsPage.loginAPS(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', () => { it('[C299205] Should display the login error message when the SSO identity service is wrongly configured', () => { - silentLogin = false; - settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, 'http://aps22/auth/realms/alfresco', TestConfig.adf.hostIdentity, silentLogin); + 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'); diff --git a/e2e/core/user-info-component-cloud.e2e.ts b/e2e/core/user-info-component-cloud.e2e.ts index 9f9c11f643..a7901b8296 100644 --- a/e2e/core/user-info-component-cloud.e2e.ts +++ b/e2e/core/user-info-component-cloud.e2e.ts @@ -33,13 +33,13 @@ describe('User Info - SSO', () => { let silentLogin, identityUser; beforeAll(async () => { - await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + await identityService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword, 'alfresco'); identityUser = await identityService.createIdentityUser(); silentLogin = false; - settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); + settingsPage.setProviderEcmSso(TestConfig.adf.url, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin, true, 'alfresco'); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(identityUser.username, identityUser.password); + loginSSOPage.loginSSOIdentityService(identityUser.username, identityUser.password); }); afterAll (async () => { diff --git a/e2e/pages/adf/settingsPage.ts b/e2e/pages/adf/settingsPage.ts index a6ae341862..bbdef90c41 100644 --- a/e2e/pages/adf/settingsPage.ts +++ b/e2e/pages/adf/settingsPage.ts @@ -135,12 +135,27 @@ export class SettingsPage { await this.backButton.click(); } - async clickSsoRadioButton () { + async clickSsoRadioButton() { Util.waitUntilElementIsVisible(this.ssoRadioButton); await this.ssoRadioButton.click(); } - async setProviderBpmSso (processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true ) { + async setProviderEcmSso(contentServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true, clientId?: string) { + this.goToSettingsPage(); + this.setProvider(this.ecm.option, this.ecm.text); + Util.waitUntilElementIsNotOnPage(this.bpmText); + Util.waitUntilElementIsVisible(this.ecmText); + await this.clickSsoRadioButton(); + await this.setClientId(clientId); + await this.setContentServicesURL(contentServiceURL); + await this.setAuthHost(authHost); + await this.setIdentityHost(identityHost); + await this.setSilentLogin(silentLogin); + await this.setImplicitFlow(implicitFlow); + await this.clickApply(); + } + + async setProviderBpmSso(processServiceURL, authHost, identityHost, silentLogin = true, implicitFlow = true) { this.goToSettingsPage(); this.setProvider(this.bpm.option, this.bpm.text); Util.waitUntilElementIsVisible(this.bpmText); @@ -155,56 +170,56 @@ export class SettingsPage { await this.clickApply(); } - async setProcessServicesURL (processServiceURL) { + async setProcessServicesURL(processServiceURL) { Util.waitUntilElementIsVisible(this.bpmText); this.bpmText.clear(); this.bpmText.sendKeys(processServiceURL); } - async setClientId () { + async setClientId(clientId: string = TestConfig.adf_aps.clientIdSso) { Util.waitUntilElementIsVisible(this.clientIdText); this.clientIdText.clear(); - this.clientIdText.sendKeys(TestConfig.adf_aps.clientIdSso); + this.clientIdText.sendKeys(clientId); } - async setContentServicesURL (contentServiceURL) { + async setContentServicesURL(contentServiceURL) { Util.waitUntilElementIsClickable(this.ecmText); this.ecmText.clear(); this.ecmText.sendKeys(contentServiceURL); } - clearContentServicesURL () { + clearContentServicesURL() { Util.waitUntilElementIsVisible(this.ecmText); this.ecmText.clear(); this.ecmText.sendKeys('a'); this.ecmText.sendKeys(protractor.Key.BACK_SPACE); } - clearProcessServicesURL () { + clearProcessServicesURL() { Util.waitUntilElementIsVisible(this.bpmText); this.bpmText.clear(); this.bpmText.sendKeys('a'); this.bpmText.sendKeys(protractor.Key.BACK_SPACE); } - async setAuthHost (authHostURL) { + async setAuthHost(authHostURL) { Util.waitUntilElementIsVisible(this.authHostText); await this.authHostText.clear(); await this.authHostText.sendKeys(authHostURL); } - async setIdentityHost (identityHost) { + async setIdentityHost(identityHost) { Util.waitUntilElementIsVisible(this.identityHostText); await this.identityHostText.clear(); await this.identityHostText.sendKeys(identityHost); } - async clickApply () { + async clickApply() { Util.waitUntilElementIsVisible(this.applyButton); await this.applyButton.click(); } - async setSilentLogin (enableToggle) { + async setSilentLogin(enableToggle) { await Util.waitUntilElementIsVisible(this.silentLoginToggleElement); const isChecked = (await this.silentLoginToggleElement.getAttribute('class')).includes('mat-checked'); @@ -216,7 +231,7 @@ export class SettingsPage { return Promise.resolve(); } - async setImplicitFlow (enableToggle) { + async setImplicitFlow(enableToggle) { await Util.waitUntilElementIsVisible(this.implicitFlowElement); const isChecked = (await this.implicitFlowElement.getAttribute('class')).includes('mat-checked'); diff --git a/e2e/process-services-cloud/apps-section-cloud.e2e.ts b/e2e/process-services-cloud/apps-section-cloud.e2e.ts index 39d1f9fdba..a87ac0ed2f 100644 --- a/e2e/process-services-cloud/apps-section-cloud.e2e.ts +++ b/e2e/process-services-cloud/apps-section-cloud.e2e.ts @@ -33,7 +33,7 @@ describe('Applications list', () => { it('[C289910] Should the app be displayed on dashboard when is deployed on APS', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); navigationBarPage.navigateToProcessServicesCloudPage(); appListCloudPage.checkApsContainer(); appListCloudPage.checkAppIsDisplayed(appName); diff --git a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts index 460321fc17..1c0872750c 100644 --- a/e2e/process-services-cloud/edit-process-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-process-filters-component.e2e.ts @@ -43,7 +43,7 @@ describe('Edit process filters cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); }); beforeEach((done) => { diff --git a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts index 3635bacb2b..978eb5c9b4 100644 --- a/e2e/process-services-cloud/edit-task-filters-component.e2e.ts +++ b/e2e/process-services-cloud/edit-task-filters-component.e2e.ts @@ -47,7 +47,7 @@ describe('Edit task filters cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); await tasksService.init(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); assignedTask = await tasksService.createStandaloneTask(assignedTaskName, simpleApp); diff --git a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts index 435f01bcfa..8c348c4ea0 100644 --- a/e2e/process-services-cloud/people-group-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/people-group-cloud-component.e2e.ts @@ -80,7 +80,7 @@ describe('People Groups Cloud Component', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); + loginSSOPage.loginSSOIdentityService(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword); navigationBarPage.navigateToPeopleGroupCloudPage(); }); diff --git a/e2e/process-services-cloud/process-custom-filters.e2e.ts b/e2e/process-services-cloud/process-custom-filters.e2e.ts index 1895056ce0..e097626834 100644 --- a/e2e/process-services-cloud/process-custom-filters.e2e.ts +++ b/e2e/process-services-cloud/process-custom-filters.e2e.ts @@ -57,7 +57,7 @@ describe('Process list cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); navigationBarPage.clickConfigEditorButton(); configEditorPage.clickEditProcessCloudConfiguration(); diff --git a/e2e/process-services-cloud/process-filters-cloud.e2e.ts b/e2e/process-services-cloud/process-filters-cloud.e2e.ts index 34a6b2397e..e9c6731cd4 100644 --- a/e2e/process-services-cloud/process-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/process-filters-cloud.e2e.ts @@ -55,7 +55,7 @@ describe('Process filters cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); await processDefinitionService.init(user, password); let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); diff --git a/e2e/process-services-cloud/processList-cloud-component.e2e.ts b/e2e/process-services-cloud/processList-cloud-component.e2e.ts index 969a190afb..763f945a5c 100644 --- a/e2e/process-services-cloud/processList-cloud-component.e2e.ts +++ b/e2e/process-services-cloud/processList-cloud-component.e2e.ts @@ -52,7 +52,7 @@ describe('Process list cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); await processDefinitionService.init(user, password); let processDefinition = await processDefinitionService.getProcessDefinitions(simpleApp); diff --git a/e2e/process-services-cloud/start-process-cloud.e2e.ts b/e2e/process-services-cloud/start-process-cloud.e2e.ts index 340b61f710..1c278e0da2 100644 --- a/e2e/process-services-cloud/start-process-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-process-cloud.e2e.ts @@ -48,7 +48,7 @@ describe('Start Process', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); navigationBarPage.navigateToProcessServicesCloudPage(); appListCloudComponent.checkApsContainer(); done(); diff --git a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts index ea1c32f6bb..1fa95f7337 100644 --- a/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts +++ b/e2e/process-services-cloud/start-task-custom-app-cloud.e2e.ts @@ -53,7 +53,7 @@ describe('Start Task', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); navigationBarPage.navigateToProcessServicesCloudPage(); appListCloudComponent.checkApsContainer(); appListCloudComponent.checkAppIsDisplayed(appName); diff --git a/e2e/process-services-cloud/task-details-cloud.e2e.ts b/e2e/process-services-cloud/task-details-cloud.e2e.ts index 6c183f81ab..de5db16659 100644 --- a/e2e/process-services-cloud/task-details-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-details-cloud.e2e.ts @@ -54,7 +54,7 @@ describe('Task Header cloud component', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); await tasksService.init(user, password); let createdTaskId = await tasksService.createStandaloneTask(basicCreatedTaskName, simpleApp); diff --git a/e2e/process-services-cloud/task-filters-cloud.e2e.ts b/e2e/process-services-cloud/task-filters-cloud.e2e.ts index 70e4edb5f6..78f02c74f8 100644 --- a/e2e/process-services-cloud/task-filters-cloud.e2e.ts +++ b/e2e/process-services-cloud/task-filters-cloud.e2e.ts @@ -46,7 +46,7 @@ describe('Task filters cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); }); beforeEach((done) => { diff --git a/e2e/process-services-cloud/task-list-properties.e2e.ts b/e2e/process-services-cloud/task-list-properties.e2e.ts index fda1d724ed..4ebf1fe230 100644 --- a/e2e/process-services-cloud/task-list-properties.e2e.ts +++ b/e2e/process-services-cloud/task-list-properties.e2e.ts @@ -68,7 +68,7 @@ describe('Edit task filters and task list properties', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); navigationBarPage.clickConfigEditorButton(); diff --git a/e2e/process-services-cloud/task-list-selection.e2e.ts b/e2e/process-services-cloud/task-list-selection.e2e.ts index 00c7cdb501..7d184a9b84 100644 --- a/e2e/process-services-cloud/task-list-selection.e2e.ts +++ b/e2e/process-services-cloud/task-list-selection.e2e.ts @@ -48,7 +48,7 @@ describe('Task list cloud - selection', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); await tasksService.init(user, password); for (let i = 0; i < noOfTasks; i++) { diff --git a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts index 3b93071f6b..84fe45c216 100644 --- a/e2e/process-services-cloud/tasks-custom-filters.e2e.ts +++ b/e2e/process-services-cloud/tasks-custom-filters.e2e.ts @@ -57,7 +57,7 @@ describe('Task filters cloud', () => { settingsPage.setProviderBpmSso(TestConfig.adf.hostBPM, TestConfig.adf.hostSso, TestConfig.adf.hostIdentity, silentLogin); loginSSOPage.clickOnSSOButton(); browser.ignoreSynchronization = true; - loginSSOPage.loginAPS(user, password); + loginSSOPage.loginSSOIdentityService(user, password); await tasksService.init(user, password); await tasksService.createStandaloneTask(createdTaskName, simpleApp); diff --git a/e2e/test.config.js b/e2e/test.config.js index 10c17cad6e..1cd3375b8d 100644 --- a/e2e/test.config.js +++ b/e2e/test.config.js @@ -3,14 +3,15 @@ * @class config.test.config */ -var HOST = process.env.URL_HOST_ADF; +const HOST = process.env.URL_HOST_ADF; const HOST_BPM = process.env.URL_HOST_BPM_ADF; const HOST_SSO = process.env.URL_HOST_SSO_ADF; const HOST_IDENTITY = process.env.URL_HOST_IDENTITY; -var USERNAME = process.env.USERNAME_ADF; -var PASSWORD = process.env.PASSWORD_ADF; -var EMAIL = process.env.EMAIL_ADF; -var TIMEOUT = parseInt(process.env.TIMEOUT, 10); +const USERNAME = process.env.USERNAME_ADF; +const PASSWORD = process.env.PASSWORD_ADF; +const EMAIL = process.env.EMAIL_ADF; +const TIMEOUT = parseInt(process.env.TIMEOUT, 10); +const PROXY = process.env.PROXY_HOST_ADF; module.exports = { @@ -52,9 +53,16 @@ module.exports = { hostBPM: "http://" + HOST_BPM, - hostSso: "http://" + HOST_SSO, + clientIdSso: "alfresco", - hostIdentity: "http://" + HOST_IDENTITY + hostSso: function () { + return "http://" + (HOST_SSO ? HOST_SSO : (PROXY + '/auth/realms/alfresco')); + }(), + + hostIdentity: function () { + console.log((PROXY + '/auth')); + return "http://" + (HOST_IDENTITY ? HOST_IDENTITY : (PROXY + '/auth/admin/realms/alfresco')); + }() }, diff --git a/lib/testing/src/lib/process-services-cloud/pages/login-sso.page.ts b/lib/testing/src/lib/process-services-cloud/pages/login-sso.page.ts index 87ddd34ff4..14487683bb 100644 --- a/lib/testing/src/lib/process-services-cloud/pages/login-sso.page.ts +++ b/lib/testing/src/lib/process-services-cloud/pages/login-sso.page.ts @@ -26,7 +26,7 @@ export class LoginSSOPage { header = element(by.id('adf-header')); loginError = element(by.css(`div[data-automation-id="login-error"]`)); - loginAPS(username, password) { + loginSSOIdentityService(username, password) { BrowserVisibility.waitUntilElementIsVisible(this.usernameField); this.enterUsername(username); this.enterPassword(password); diff --git a/scripts/clean-env.js b/scripts/clean-env.js index 396bc3ed0a..b5428ac0fc 100644 --- a/scripts/clean-env.js +++ b/scripts/clean-env.js @@ -15,13 +15,10 @@ async function main() { hostEcm: program.host }); - console.log(program.username + program.password); await this.alfrescoJsApi.login(program.username, program.password); await deletetSite(this.alfrescoJsApi); await emptyTrashCan(this.alfrescoJsApi); - - } async function emptyTrashCan(alfrescoJsApi) { diff --git a/scripts/test-e2e-lib.sh b/scripts/test-e2e-lib.sh index fbb9d2b6e9..d3b2bc86b0 100755 --- a/scripts/test-e2e-lib.sh +++ b/scripts/test-e2e-lib.sh @@ -15,11 +15,11 @@ show_help() { echo "-u or --username" echo "-p or --password" echo "-e or --email" - echo "-b or --browser run the test in the browsrwer (No headless mode)" + echo "-b or --browser run the test in the browser (No headless mode)" echo "-s or --spec run a single test file" echo "-f or --folder run a single folder test" echo "--seleniumServer configure a selenium server to use to run the e2e test" - echo "-proxy or --proxy proxy Back end URL to use only possibel to use with -dev option" + echo "-proxy or --proxy proxy Back end URL to use only possible to use with -dev option" echo "-dev or --dev run it against local development environment it will deploy on localhost:4200 the current version of your branch" echo "-host or --host URL of the Front end to test" echo "-host_bpm URL of the Back end to test"