mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
Use the e2e lite-serve (#1390)
* Enable liteserve Fix ecmHost Enable browser open * Be able to pass a different admin credentials * use the e2e liteserve * sync package-lock * Update webdriver * Replace the app.conf values before running e2e. Be able to run e2e on external env * Remove dist mystake * Remove the baseUrl from the contains * Use the docker image * stop postgresql before install * Try the new strategy * regenerate the package lock * Wait for the content to go up * Change travis with start.sh * do not override the baseUrl * Create a different docker compose for e2e Co-authored-by: Adina Parpalita <adina.parpalita@ness.com>
This commit is contained in:
parent
cb26102a99
commit
b240909868
45
.travis.yml
45
.travis.yml
@ -6,7 +6,7 @@ addons:
|
|||||||
chrome: stable
|
chrome: stable
|
||||||
language: node_js
|
language: node_js
|
||||||
node_js:
|
node_js:
|
||||||
- "12.14.0"
|
- '12.14.0'
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
directories:
|
directories:
|
||||||
@ -45,25 +45,44 @@ jobs:
|
|||||||
script:
|
script:
|
||||||
- ng test app --code-coverage --watch=false
|
- ng test app --code-coverage --watch=false
|
||||||
- bash <(curl -s https://codecov.io/bash) -X gcov
|
- bash <(curl -s https://codecov.io/bash) -X gcov
|
||||||
|
|
||||||
- stage: e2e
|
- stage: e2e
|
||||||
name: Test Suite appNavigation&search
|
name: Test Suite appNavigation&search
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite authentication,listViews,navigation,application,pagination,search" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "authentication,listViews,navigation,application,pagination,search"
|
||||||
|
after_script: ./start.sh -d
|
||||||
- name: Test Suite actionsAvailable
|
- name: Test Suite actionsAvailable
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite actionsAvailable" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "actionsAvailable"
|
||||||
|
after_script: ./start.sh -d
|
||||||
- name: Test Suite addRemoveContent
|
- name: Test Suite addRemoveContent
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite addRemoveContent" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "addRemoveContent"
|
||||||
|
after_script: ./start.sh -d
|
||||||
- name: Test Suite manageContent
|
- name: Test Suite manageContent
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite manageContent" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "manageContent"
|
||||||
|
after_script: ./start.sh -d
|
||||||
- name: Test Suite sharingContent&markFavorite
|
- name: Test Suite sharingContent&markFavorite
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite sharingContent" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "sharingContent"
|
||||||
|
after_script: ./start.sh -d
|
||||||
- name: Test Suite viewContent&metadata&extensions
|
- name: Test Suite viewContent&metadata&extensions
|
||||||
before_script: ./scripts/ci/utils/artifact-from-s3.sh -a "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" -o "./dist/app"
|
before_script:
|
||||||
script: SUITE="--suite viewer,infoDrawer,extensions" npm run e2e:docker
|
- ./scripts/ci/job_hooks/before_e2e.sh "$S3_DBP_FOLDER/alfresco-content-app.tar.bz2" "./dist/app"
|
||||||
|
- ./start.sh
|
||||||
|
script: npm run wd:update && ng run app-e2e:e2elite --suite "viewer,infoDrawer,extensions"
|
||||||
|
after_script: ./start.sh -d
|
||||||
|
|
||||||
- stage: Trigger DW
|
- stage: Trigger DW
|
||||||
if: (branch = master OR branch = development OR (tag =~ .*beta.*)) AND type = push
|
if: (branch = master OR branch = development OR (tag =~ .*beta.*)) AND type = push
|
||||||
|
15
angular.json
15
angular.json
@ -156,6 +156,13 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"lite-serve": {
|
||||||
|
"builder": "@angular-custom-builders/lite-serve:dist-serve",
|
||||||
|
"options": {
|
||||||
|
"publicHost": "http://localhost:4200",
|
||||||
|
"outputPath": "dist/app"
|
||||||
|
}
|
||||||
|
},
|
||||||
"extract-i18n": {
|
"extract-i18n": {
|
||||||
"builder": "@angular-devkit/build-angular:extract-i18n",
|
"builder": "@angular-devkit/build-angular:extract-i18n",
|
||||||
"options": {
|
"options": {
|
||||||
@ -244,6 +251,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"e2elite": {
|
||||||
|
"builder": "@angular-devkit/build-angular:protractor",
|
||||||
|
"options": {
|
||||||
|
"protractorConfig": "protractor.conf.js",
|
||||||
|
"webdriverUpdate": false,
|
||||||
|
"devServerTarget": "app:lite-serve"
|
||||||
|
}
|
||||||
|
},
|
||||||
"lint": {
|
"lint": {
|
||||||
"builder": "@angular-devkit/build-angular:tslint",
|
"builder": "@angular-devkit/build-angular:tslint",
|
||||||
"options": {
|
"options": {
|
||||||
|
151
docker-compose.e2e.yml
Normal file
151
docker-compose.e2e.yml
Normal file
@ -0,0 +1,151 @@
|
|||||||
|
version: '2'
|
||||||
|
|
||||||
|
services:
|
||||||
|
alfresco:
|
||||||
|
image: alfresco/alfresco-content-repository-community:latest
|
||||||
|
mem_limit: 1500m
|
||||||
|
depends_on:
|
||||||
|
- auth
|
||||||
|
volumes:
|
||||||
|
- ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: '
|
||||||
|
-Ddb.driver=org.postgresql.Driver
|
||||||
|
-Ddb.username=alfresco
|
||||||
|
-Ddb.password=alfresco
|
||||||
|
-Ddb.url=jdbc:postgresql://postgres:5432/alfresco
|
||||||
|
-Dsolr.host=solr6
|
||||||
|
-Dsolr.port=8983
|
||||||
|
-Dsolr.secureComms=none
|
||||||
|
-Dsolr.base.url=/solr
|
||||||
|
-Dindex.subsystem.name=solr6
|
||||||
|
-Dalfresco.host=localhost
|
||||||
|
-Dalfresco.port=8080
|
||||||
|
-Daos.baseUrlOverwrite=http://localhost:8080/alfresco/aos
|
||||||
|
-Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
|
||||||
|
-Ddeployment.method=DOCKER_COMPOSE
|
||||||
|
-Dlocal.transform.service.enabled=true
|
||||||
|
-DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
|
||||||
|
-DlocalTransform.imagemagick.url=http://imagemagick:8090/
|
||||||
|
-DlocalTransform.libreoffice.url=http://libreoffice:8090/
|
||||||
|
-DlocalTransform.tika.url=http://tika:8090/
|
||||||
|
-DlocalTransform.misc.url=http://transform-misc:8090/
|
||||||
|
-Dlegacy.transform.service.enabled=true
|
||||||
|
-Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
|
||||||
|
-Djodconverter.url=http://libreoffice:8090/
|
||||||
|
-Dimg.url=http://imagemagick:8090/
|
||||||
|
-Dtika.url=http://tika:8090/
|
||||||
|
-Dtransform.misc.url=http://transform-misc:8090/
|
||||||
|
-Dcsrf.filter.enabled=false
|
||||||
|
|
||||||
|
-Didentity-service.enable-basic-auth=true
|
||||||
|
-Didentity-service.authentication.validation.failure.silent=false
|
||||||
|
-Didentity-service.auth-server-url=http://${HOST_IP}:8085/auth
|
||||||
|
-Didentity-service.realm=alfresco
|
||||||
|
-Didentity-service.resource=alfresco
|
||||||
|
|
||||||
|
${AIMS_PROPS}
|
||||||
|
-Xms1500m -Xmx1500m
|
||||||
|
'
|
||||||
|
|
||||||
|
alfresco-pdf-renderer:
|
||||||
|
image: alfresco/alfresco-pdf-renderer:2.1.0
|
||||||
|
mem_limit: 1g
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: ' -Xms256m -Xmx512m'
|
||||||
|
ports:
|
||||||
|
- 8090:8090
|
||||||
|
|
||||||
|
imagemagick:
|
||||||
|
image: alfresco/alfresco-imagemagick:2.1.0
|
||||||
|
mem_limit: 1g
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: ' -Xms256m -Xmx512m'
|
||||||
|
ports:
|
||||||
|
- 8091:8090
|
||||||
|
|
||||||
|
libreoffice:
|
||||||
|
image: alfresco/alfresco-libreoffice:2.1.0
|
||||||
|
mem_limit: 1g
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: ' -Xms256m -Xmx512m'
|
||||||
|
ports:
|
||||||
|
- 8092:8090
|
||||||
|
|
||||||
|
tika:
|
||||||
|
image: alfresco/alfresco-tika:2.1.0
|
||||||
|
mem_limit: 1g
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: ' -Xms256m -Xmx512m'
|
||||||
|
ports:
|
||||||
|
- 8093:8090
|
||||||
|
|
||||||
|
transform-misc:
|
||||||
|
image: alfresco/alfresco-transform-misc:2.1.0
|
||||||
|
mem_limit: 1g
|
||||||
|
environment:
|
||||||
|
JAVA_OPTS: ' -Xms256m -Xmx512m'
|
||||||
|
ports:
|
||||||
|
- 8094:8090
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:11.4
|
||||||
|
mem_limit: 512m
|
||||||
|
environment:
|
||||||
|
- POSTGRES_PASSWORD=alfresco
|
||||||
|
- POSTGRES_USER=alfresco
|
||||||
|
- POSTGRES_DB=alfresco
|
||||||
|
command: postgres -c max_connections=300 -c log_min_messages=LOG
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
|
||||||
|
solr6:
|
||||||
|
image: alfresco/alfresco-search-services:1.4.0
|
||||||
|
mem_limit: 2g
|
||||||
|
environment:
|
||||||
|
#Solr needs to know how to register itself with Alfresco
|
||||||
|
- SOLR_ALFRESCO_HOST=alfresco
|
||||||
|
- SOLR_ALFRESCO_PORT=8080
|
||||||
|
#Alfresco needs to know how to call solr
|
||||||
|
- SOLR_SOLR_HOST=solr6
|
||||||
|
- SOLR_SOLR_PORT=8983
|
||||||
|
#Create the default alfresco and archive cores
|
||||||
|
- SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive
|
||||||
|
#HTTP by default
|
||||||
|
- ALFRESCO_SECURE_COMMS=none
|
||||||
|
- 'SOLR_JAVA_MEM=-Xms2g -Xmx2g'
|
||||||
|
ports:
|
||||||
|
- 8083:8983 #Browser port
|
||||||
|
|
||||||
|
activemq:
|
||||||
|
image: alfresco/alfresco-activemq:5.15.8
|
||||||
|
mem_limit: 1g
|
||||||
|
ports:
|
||||||
|
- 8161:8161 # Web Console
|
||||||
|
- 5672:5672 # AMQP
|
||||||
|
- 61616:61616 # OpenWire
|
||||||
|
- 61613:61613 # STOMP
|
||||||
|
|
||||||
|
proxy:
|
||||||
|
image: alfresco/acs-community-ngnix:1.0.0
|
||||||
|
mem_limit: 128m
|
||||||
|
depends_on:
|
||||||
|
- alfresco
|
||||||
|
volumes:
|
||||||
|
- ./docker/proxy/nginx.conf:/etc/nginx/nginx.conf
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
links:
|
||||||
|
- alfresco
|
||||||
|
|
||||||
|
auth:
|
||||||
|
image: jboss/keycloak:4.8.3.Final
|
||||||
|
volumes:
|
||||||
|
- ./docker/auth/alfresco-realm.json:/tmp/alfresco-realm.json
|
||||||
|
environment:
|
||||||
|
- KEYCLOAK_USER=admin
|
||||||
|
- KEYCLOAK_PASSWORD=admin
|
||||||
|
- KEYCLOAK_IMPORT=/tmp/alfresco-realm.json
|
||||||
|
- DB_VENDOR=h2
|
||||||
|
ports:
|
||||||
|
- 8085:8080
|
@ -29,10 +29,6 @@ http {
|
|||||||
proxy_pass http://alfresco:8080;
|
proxy_pass http://alfresco:8080;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /content-app/ {
|
|
||||||
proxy_pass http://content-app:8080/;
|
|
||||||
}
|
|
||||||
|
|
||||||
location /alfresco/ {
|
location /alfresco/ {
|
||||||
proxy_pass http://alfresco:8080;
|
proxy_pass http://alfresco:8080;
|
||||||
}
|
}
|
||||||
@ -40,9 +36,5 @@ http {
|
|||||||
location /api-explorer/ {
|
location /api-explorer/ {
|
||||||
proxy_pass http://alfresco:8080/api-explorer/;
|
proxy_pass http://alfresco:8080/api-explorer/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /share/ {
|
|
||||||
proxy_pass http://share:8080;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,11 +34,6 @@ export const USE_HASH_STRATEGY = true;
|
|||||||
// Repository configs
|
// Repository configs
|
||||||
export const REPO_API_TENANT = '-default-';
|
export const REPO_API_TENANT = '-default-';
|
||||||
|
|
||||||
// Admin details
|
|
||||||
export const ADMIN_USERNAME = 'admin';
|
|
||||||
export const ADMIN_PASSWORD = 'admin';
|
|
||||||
export const ADMIN_FULL_NAME = 'Administrator';
|
|
||||||
|
|
||||||
export const E2E_ROOT_PATH = __dirname;
|
export const E2E_ROOT_PATH = __dirname;
|
||||||
|
|
||||||
// Dates
|
// Dates
|
||||||
|
@ -26,7 +26,7 @@ import { browser, ExpectedConditions as EC } from 'protractor';
|
|||||||
import { LoginComponent } from '../components/components';
|
import { LoginComponent } from '../components/components';
|
||||||
import { Page } from './page';
|
import { Page } from './page';
|
||||||
|
|
||||||
import { ADMIN_USERNAME, ADMIN_PASSWORD, BROWSER_WAIT_TIMEOUT, APP_ROUTES } from '../configs';
|
import { BROWSER_WAIT_TIMEOUT, APP_ROUTES } from '../configs';
|
||||||
|
|
||||||
export class LoginPage extends Page {
|
export class LoginPage extends Page {
|
||||||
login: LoginComponent = new LoginComponent(this.appRoot);
|
login: LoginComponent = new LoginComponent(this.appRoot);
|
||||||
@ -54,7 +54,7 @@ export class LoginPage extends Page {
|
|||||||
|
|
||||||
async loginWithAdmin() {
|
async loginWithAdmin() {
|
||||||
await this.load();
|
await this.load();
|
||||||
return this.loginWith(ADMIN_USERNAME, ADMIN_PASSWORD);
|
return this.loginWith(browser.params.ADMIN_USERNAME, browser.params.ADMIN_PASSWORD);
|
||||||
}
|
}
|
||||||
|
|
||||||
async tryLoginWith(username: string, password?: string) {
|
async tryLoginWith(username: string, password?: string) {
|
||||||
|
@ -48,7 +48,7 @@ describe('Share a file', () => {
|
|||||||
const viewer = new Viewer();
|
const viewer = new Viewer();
|
||||||
const page = new BrowsingPage();
|
const page = new BrowsingPage();
|
||||||
const { dataTable, toolbar } = page;
|
const { dataTable, toolbar } = page;
|
||||||
const shareLinkPreUrl = `${browser.baseUrl}/#/preview/s/`;
|
const shareLinkPreUrl = `/#/preview/s/`;
|
||||||
|
|
||||||
const apis = {
|
const apis = {
|
||||||
admin: new RepoClient(),
|
admin: new RepoClient(),
|
||||||
|
@ -25,14 +25,13 @@
|
|||||||
|
|
||||||
import { browser } from 'protractor';
|
import { browser } from 'protractor';
|
||||||
import { AlfrescoApi } from '@alfresco/js-api';
|
import { AlfrescoApi } from '@alfresco/js-api';
|
||||||
import { RepoClientAuth } from '../repo-client-models';
|
|
||||||
|
|
||||||
export abstract class RepoApi {
|
export abstract class RepoApi {
|
||||||
alfrescoJsApi = new AlfrescoApi();
|
alfrescoJsApi = new AlfrescoApi();
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private username: string = RepoClientAuth.DEFAULT_USERNAME,
|
private username: string = browser.params.ADMIN_USERNAME,
|
||||||
private password: string = RepoClientAuth.DEFAULT_PASSWORD
|
private password: string = browser.params.ADMIN_PASSWORD
|
||||||
) {
|
) {
|
||||||
this.alfrescoJsApi.setConfig(browser.params.config);
|
this.alfrescoJsApi.setConfig(browser.params.config);
|
||||||
}
|
}
|
||||||
@ -47,6 +46,8 @@ export abstract class RepoApi {
|
|||||||
|
|
||||||
protected handleError(message: string, response: any) {
|
protected handleError(message: string, response: any) {
|
||||||
console.log(`\n--- ${message} error :`);
|
console.log(`\n--- ${message} error :`);
|
||||||
|
console.log('\t>>> username: ', this.username);
|
||||||
|
console.log('\t>>> JSON: ', JSON.stringify(browser.params.config));
|
||||||
if ( response.status && response.response ) {
|
if ( response.status && response.response ) {
|
||||||
try {
|
try {
|
||||||
console.log('\t>>> Status: ', response.status);
|
console.log('\t>>> Status: ', response.status);
|
||||||
|
@ -1,39 +0,0 @@
|
|||||||
/*!
|
|
||||||
* @license
|
|
||||||
* Alfresco Example Content Application
|
|
||||||
*
|
|
||||||
* Copyright (C) 2005 - 2020 Alfresco Software Limited
|
|
||||||
*
|
|
||||||
* This file is part of the Alfresco Example Content Application.
|
|
||||||
* If the software was purchased under a paid Alfresco license, the terms of
|
|
||||||
* the paid license agreement will prevail. Otherwise, the software is
|
|
||||||
* provided under the following open source license terms:
|
|
||||||
*
|
|
||||||
* The Alfresco Example Content Application is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Lesser General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* The Alfresco Example Content Application is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Lesser General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Lesser General Public License
|
|
||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
import {
|
|
||||||
ADMIN_USERNAME,
|
|
||||||
ADMIN_PASSWORD
|
|
||||||
} from '../../configs';
|
|
||||||
|
|
||||||
export class RepoClientAuth {
|
|
||||||
static DEFAULT_USERNAME: string = ADMIN_USERNAME;
|
|
||||||
static DEFAULT_PASSWORD: string = ADMIN_PASSWORD;
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
public username: string = RepoClientAuth.DEFAULT_USERNAME,
|
|
||||||
public password: string = RepoClientAuth.DEFAULT_PASSWORD
|
|
||||||
) {}
|
|
||||||
}
|
|
@ -23,8 +23,7 @@
|
|||||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { RepoClientAuth } from './repo-client-models';
|
import { browser } from 'protractor';
|
||||||
|
|
||||||
import { PeopleApi } from './apis/people/people-api';
|
import { PeopleApi } from './apis/people/people-api';
|
||||||
import { NodesApi } from './apis/nodes/nodes-api';
|
import { NodesApi } from './apis/nodes/nodes-api';
|
||||||
import { CommentsApi } from './apis/comments/comments-api';
|
import { CommentsApi } from './apis/comments/comments-api';
|
||||||
@ -39,8 +38,8 @@ import { AuthenticationApi } from './apis/authentication/authentication-api';
|
|||||||
|
|
||||||
export class RepoClient {
|
export class RepoClient {
|
||||||
constructor(
|
constructor(
|
||||||
private username: string = RepoClientAuth.DEFAULT_USERNAME,
|
private username: string = browser.params.ADMIN_USERNAME,
|
||||||
private password: string = RepoClientAuth.DEFAULT_PASSWORD
|
private password: string = browser.params.ADMIN_PASSWORD
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
private get auth() {
|
private get auth() {
|
||||||
|
1098
package-lock.json
generated
1098
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -22,7 +22,7 @@
|
|||||||
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
||||||
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080/content-app} $SUITE",
|
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080/content-app} $SUITE",
|
||||||
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
|
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
|
||||||
"wait:app": "wait-on http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/alfresco/ -t 1000000 && wait-on http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/content-app/ -t 400000",
|
"wait:app": "wait-on http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/alfresco/ -t 1000000",
|
||||||
"start:docker": "./start.sh",
|
"start:docker": "./start.sh",
|
||||||
"stop:docker": "./start.sh -d",
|
"stop:docker": "./start.sh -d",
|
||||||
"e2e:docker": "./start.sh && npm run e2e && ./start.sh -d",
|
"e2e:docker": "./start.sh && npm run e2e && ./start.sh -d",
|
||||||
@ -44,6 +44,7 @@
|
|||||||
"@alfresco/adf-core": "3.7.0",
|
"@alfresco/adf-core": "3.7.0",
|
||||||
"@alfresco/adf-extensions": "3.7.0",
|
"@alfresco/adf-extensions": "3.7.0",
|
||||||
"@alfresco/js-api": "3.7.0",
|
"@alfresco/js-api": "3.7.0",
|
||||||
|
"@angular-custom-builders/lite-serve": "0.0.2",
|
||||||
"@angular/animations": "7.2.15",
|
"@angular/animations": "7.2.15",
|
||||||
"@angular/cdk": "^7.3.7",
|
"@angular/cdk": "^7.3.7",
|
||||||
"@angular/common": "7.2.15",
|
"@angular/common": "7.2.15",
|
||||||
@ -64,6 +65,7 @@
|
|||||||
"@ngrx/store": "^7.4.0",
|
"@ngrx/store": "^7.4.0",
|
||||||
"@ngrx/store-devtools": "^7.4.0",
|
"@ngrx/store-devtools": "^7.4.0",
|
||||||
"@ngx-translate/core": "^11.0.1",
|
"@ngx-translate/core": "^11.0.1",
|
||||||
|
"browser-sync": "^2.26.7",
|
||||||
"core-js": "^2.5.7",
|
"core-js": "^2.5.7",
|
||||||
"hammerjs": "2.0.8",
|
"hammerjs": "2.0.8",
|
||||||
"minimatch-browser": "^1.0.0",
|
"minimatch-browser": "^1.0.0",
|
||||||
@ -87,6 +89,7 @@
|
|||||||
"ajv-cli": "^3.0.0",
|
"ajv-cli": "^3.0.0",
|
||||||
"chrome-remote-interface": "^0.26.1",
|
"chrome-remote-interface": "^0.26.1",
|
||||||
"codelyzer": "^5.2.2",
|
"codelyzer": "^5.2.2",
|
||||||
|
"commander": "^4.0.1",
|
||||||
"cpr": "^3.0.1",
|
"cpr": "^3.0.1",
|
||||||
"cspell": "^3.2.17",
|
"cspell": "^3.2.17",
|
||||||
"dotenv": "6.2.0",
|
"dotenv": "6.2.0",
|
||||||
|
@ -9,11 +9,13 @@ const fs = require('fs');
|
|||||||
|
|
||||||
const projectRoot = path.resolve(__dirname);
|
const projectRoot = path.resolve(__dirname);
|
||||||
const downloadFolder = `${projectRoot}/e2e-downloads`;
|
const downloadFolder = `${projectRoot}/e2e-downloads`;
|
||||||
|
const E2E_HOST = process.env.E2E_HOST || 'http://localhost',
|
||||||
|
E2E_PORT = process.env.E2E_PORT || 4200,
|
||||||
|
BROWSER_RUN = process.env.BROWSER_RUN;
|
||||||
const width = 1366;
|
const width = 1366;
|
||||||
const height = 768;
|
const height = 768;
|
||||||
|
|
||||||
const REPO_API_HOST = process.env.REPO_API_HOST || 'http://localhost:8080';
|
const API_HOST = process.env.API_HOST || 'http://localhost:8080';
|
||||||
|
|
||||||
function rmDir(dirPath) {
|
function rmDir(dirPath) {
|
||||||
try {
|
try {
|
||||||
@ -31,7 +33,7 @@ function rmDir(dirPath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const appConfig = {
|
const appConfig = {
|
||||||
ecmHost: REPO_API_HOST,
|
hostEcm: API_HOST,
|
||||||
providers: 'ECM',
|
providers: 'ECM',
|
||||||
authType: 'BASIC'
|
authType: 'BASIC'
|
||||||
};
|
};
|
||||||
@ -41,7 +43,9 @@ exports.config = {
|
|||||||
|
|
||||||
params: {
|
params: {
|
||||||
config: appConfig,
|
config: appConfig,
|
||||||
downloadFolder: downloadFolder
|
downloadFolder: downloadFolder,
|
||||||
|
ADMIN_USERNAME: process.env.ADMIN_EMAIL || 'admin',
|
||||||
|
ADMIN_PASSWORD: process.env.ADMIN_PASSWORD || 'admin'
|
||||||
},
|
},
|
||||||
|
|
||||||
specs: [
|
specs: [
|
||||||
@ -112,7 +116,8 @@ exports.config = {
|
|||||||
},
|
},
|
||||||
args: [
|
args: [
|
||||||
'--incognito',
|
'--incognito',
|
||||||
'--headless',
|
...(BROWSER_RUN === 'true' ? [] : ['--headless']),
|
||||||
|
'--disable-web-security',
|
||||||
'--remote-debugging-port=9222',
|
'--remote-debugging-port=9222',
|
||||||
'--disable-gpu',
|
'--disable-gpu',
|
||||||
'--no-sandbox'
|
'--no-sandbox'
|
||||||
@ -122,7 +127,8 @@ exports.config = {
|
|||||||
|
|
||||||
directConnect: true,
|
directConnect: true,
|
||||||
|
|
||||||
// baseUrl: 'http://localhost:8080',
|
baseUrl: `${E2E_HOST}${E2E_PORT ? `:${E2E_PORT}` : ''}`,
|
||||||
|
|
||||||
getPageTimeout: 50000,
|
getPageTimeout: 50000,
|
||||||
|
|
||||||
framework: 'jasmine',
|
framework: 'jasmine',
|
||||||
|
54
scripts/app-config-replace.js
Executable file
54
scripts/app-config-replace.js
Executable file
@ -0,0 +1,54 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
const program = require('commander');
|
||||||
|
require('dotenv').config({ path: process.env.ENV_FILE });
|
||||||
|
const fs = require('fs');
|
||||||
|
|
||||||
|
const API_HOST = process.env.API_HOST || 'api';
|
||||||
|
const OAUTH_HOST = process.env.OAUTH_HOST || 'keycloak';
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
apiHost: {
|
||||||
|
flags: '-a, --api-host',
|
||||||
|
description: "set apiHost's and ecmHost's value with API_HOST",
|
||||||
|
set: appConfig => {
|
||||||
|
appConfig.ecmHost = API_HOST;
|
||||||
|
appConfig.aosHost = API_HOST + '/alfresco/aos';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
oauthHost: {
|
||||||
|
flags: '-o, --oauth-host',
|
||||||
|
description: "set oauth2.host's value with OAUTH_HOST",
|
||||||
|
set: appConfig => {
|
||||||
|
appConfig.authType = 'OAUTH';
|
||||||
|
appConfig.oauth2.host = OAUTH_HOST;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
program
|
||||||
|
.version('0.0.1')
|
||||||
|
.requiredOption(
|
||||||
|
'-c, --config <path>',
|
||||||
|
'path to the app.config.json to reset its values with env vars'
|
||||||
|
);
|
||||||
|
|
||||||
|
Object.keys(options).forEach(option => {
|
||||||
|
program.option(options[option].flags, options[option].description);
|
||||||
|
});
|
||||||
|
|
||||||
|
program.parse(process.argv);
|
||||||
|
|
||||||
|
fs.readFile(program.config, (err, appConfigString) => {
|
||||||
|
if (err) throw err;
|
||||||
|
let appConfig = JSON.parse(appConfigString);
|
||||||
|
|
||||||
|
Object.keys(options).forEach(option => {
|
||||||
|
if (program[option]) {
|
||||||
|
options[option].set(appConfig);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
let appConfigReplacedJson = JSON.stringify(appConfig);
|
||||||
|
fs.writeFileSync(program.config, appConfigReplacedJson);
|
||||||
|
});
|
7
scripts/ci/job_hooks/before_e2e.sh
Executable file
7
scripts/ci/job_hooks/before_e2e.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
FROM=$1;
|
||||||
|
TO=$2;
|
||||||
|
|
||||||
|
./scripts/ci/utils/artifact-from-s3.sh -a "$FROM" -o "$TO"
|
||||||
|
node "./scripts/app-config-replace.js" --config="$TO/app.config.json" -a
|
31
start.sh
31
start.sh
@ -38,9 +38,6 @@ set_wait(){
|
|||||||
WAIT=$1
|
WAIT=$1
|
||||||
}
|
}
|
||||||
|
|
||||||
redeploy_aca(){
|
|
||||||
REDEPLOY_ACA="true"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Defaults
|
# Defaults
|
||||||
WAIT="true"
|
WAIT="true"
|
||||||
@ -48,7 +45,6 @@ SET_HOST_IP=""
|
|||||||
HOST_PORT="8080"
|
HOST_PORT="8080"
|
||||||
KEYCLOAK="false"
|
KEYCLOAK="false"
|
||||||
AIMS_PROPS=""
|
AIMS_PROPS=""
|
||||||
REDEPLOY_ACA="false"
|
|
||||||
|
|
||||||
while [[ $1 == -* ]]; do
|
while [[ $1 == -* ]]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -56,7 +52,6 @@ while [[ $1 == -* ]]; do
|
|||||||
-k|--keycloak) set_keycloak; shift;;
|
-k|--keycloak) set_keycloak; shift;;
|
||||||
-wp|--windows-path) set_windows_path; shift;;
|
-wp|--windows-path) set_windows_path; shift;;
|
||||||
-d|--down) down; shift;;
|
-d|--down) down; shift;;
|
||||||
-aca) redeploy_aca; shift;;
|
|
||||||
-w|--wait) set_wait $2; shift 2;;
|
-w|--wait) set_wait $2; shift 2;;
|
||||||
-hi|--host-ip) set_host_ip $2; shift 2;;
|
-hi|--host-ip) set_host_ip $2; shift 2;;
|
||||||
-hp|--host-port) set_host_port $2; shift 2;;
|
-hp|--host-port) set_host_port $2; shift 2;;
|
||||||
@ -72,41 +67,21 @@ else
|
|||||||
fi
|
fi
|
||||||
echo "HOST_IP: ${HOST_IP}"
|
echo "HOST_IP: ${HOST_IP}"
|
||||||
|
|
||||||
URL_FRAGMENT="content-app"
|
|
||||||
export APP_URL="http://${HOST_IP}:${HOST_PORT}/${URL_FRAGMENT}"
|
|
||||||
echo "Content Workspace: ${APP_URL}"
|
|
||||||
|
|
||||||
if [[ $KEYCLOAK == "true" ]]; then
|
if [[ $KEYCLOAK == "true" ]]; then
|
||||||
export APP_CONFIG_AUTH_TYPE="OAUTH"
|
|
||||||
export APP_CONFIG_OAUTH2_HOST="http://${HOST_IP}:8085/auth/realms/alfresco"
|
|
||||||
echo "Realm: ${APP_CONFIG_OAUTH2_HOST}"
|
|
||||||
export APP_CONFIG_OAUTH2_CLIENTID="alfresco"
|
|
||||||
export APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true
|
|
||||||
export APP_CONFIG_OAUTH2_SILENT_LOGIN=true
|
|
||||||
export APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="${APP_URL}/assets/silent-refresh.html"
|
|
||||||
export APP_CONFIG_OAUTH2_REDIRECT_LOGIN="${APP_URL}/"
|
|
||||||
export APP_CONFIG_OAUTH2_REDIRECT_LOGOUT="/$URL_FRAGMENT/logout"
|
|
||||||
# export APP_BASE_SHARE_URL="${APP_URL}#/preview/s"
|
|
||||||
|
|
||||||
AIMS_PROPS="-Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm"
|
AIMS_PROPS="-Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export AIMS_PROPS=${AIMS_PROPS}
|
export AIMS_PROPS=${AIMS_PROPS}
|
||||||
|
|
||||||
if [[ $REDEPLOY_ACA == "true" ]]; then
|
|
||||||
echo "Redeploy content-app"
|
|
||||||
docker-compose up --detach --build content-app
|
|
||||||
else
|
|
||||||
echo "Start docker compose"
|
echo "Start docker compose"
|
||||||
docker-compose up -d --build
|
docker-compose -f docker-compose.e2e.yml up -d --build
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $WAIT == "true" ]]; then
|
if [[ $WAIT == "true" ]]; then
|
||||||
echo "http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/$URL_FRAGMENT/"
|
echo "Waiting for the content ..."
|
||||||
echo "Waiting for the app ..."
|
|
||||||
HOST_IP=$HOST_IP HOST_PORT=$HOST_PORT npm run wait:app
|
HOST_IP=$HOST_IP HOST_PORT=$HOST_PORT npm run wait:app
|
||||||
if [ $? == 1 ]; then
|
if [ $? == 1 ]; then
|
||||||
echo "Waiting failed -> exit 1"
|
echo "Waiting failed -> exit 1"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user