Fix e2e test (#4981)

* fix core viewer

* increase rendition retry

* sso refresh before test

* general fix test

* try use last proxy

* avoid use proxy

* remove proxy

* fix setting tests

* fix share and sso test

* fix lint exclude

* fix sso

* fix some process services cloud e2e

* fix sso download

* exclude sso test

* fix cloud

* add logout content service test

* add logout core

* add logout search

* redefine global before all

* separate protracotr method

* try

* try multiple attempt before all

* add prefix group and users

* add prefix group and users

* add prefix group and users

* rexecute sso test

* fix process service visibility e2e

* split SSO login test

* fix SSO download

* fix SSO download

* fix some cloud issues

* fix some cloud issues

* fix some cloud issues

* share file fix cs

* fix cloud test
This commit is contained in:
Eugenio Romano
2019-08-08 17:52:45 +02:00
committed by GitHub
parent b7b251fe72
commit f04c135377
181 changed files with 1136 additions and 668 deletions

View File

@@ -276,13 +276,11 @@ async function deployApp(apiService, app, name) {
"version": app.entry.name,
"security": [{"role": "APS_ADMIN", "groups": [], "users": ["admin.adf"]}, {
"role": "APS_USER",
"groups": ["hr"],
"groups": ["hr", "testgroup"],
"users": ["admin.adf"]
}]
};
//console.log(JSON.stringify(bodyParam));
const headerParams = {}, formParams = {}, queryParams = {},
contentTypes = ['application/json'], accepts = ['application/json'];

View File

@@ -14,7 +14,7 @@ echo "====== Parallel lint ====="
npx concurrently -s "all" "npm run lint-lib || exit 1" "npm run stylelint || exit 1" "npm run spellcheck || exit " "ng lint dev || exit 1" "npm run lint-e2e || exit 1" || exit 1
if grep "envalfresco" . -R --exclude-dir={node_modules,.history,.idea,scripts} --exclude=".env.cloud"; then
if grep "envalfresco" . -R --exclude-dir={node_modules,.history,.idea,scripts,dist,e2e-output} --exclude=".env.cloud"; then
echo not permitted word
exit 1
fi

View File

@@ -39,17 +39,16 @@ else
gnu=''
fi
#reset the tmp folder
affected="$(./scripts/affected-libs.sh ${gnu[@]} -b "$BRANCH_NAME")"
echo $affected
libs=(`echo $affected | sed 's/^$/\n/g'`)
if [ $BRANCH_NAME == 'undefined' ]; then
echo "Rebase your branch"
exit 1
fi
#reset the tmp folder
affected="$(./scripts/affected-libs.sh ${gnu[@]} -b "$BRANCH_NAME")"
echo $affected
libs=(`echo $affected | sed 's/^$/\n/g'`)
echo "Builds"
#extensions

View File

@@ -10,6 +10,11 @@ EXEC_VERSION_JSAPI=false
TIMEOUT=15000
SELENIUM_PROMISE_MANAGER=1
DEBUG=false
eval GNU=false
gnu_mode() {
GNU=true
}
show_help() {
echo "Usage: ./scripts/test-e2e-lib.sh -host adf.domain.com -u admin -p admin -e admin"
@@ -38,6 +43,7 @@ show_help() {
echo "-disable-control-flow disable control flow"
echo "-db or --debug run the debugger"
echo "-vjsapi install different version from npm of JS-API defined in the package.json"
echo "-gnu for gnu"
echo "-h or --help"
}
@@ -121,6 +127,7 @@ set_test_folder(){
set_selenium(){
SELENIUM_SERVER=$1
export SELENIUM_SERVER=$SELENIUM_SERVER
}
set_env(){
@@ -188,17 +195,22 @@ while [[ $1 == -* ]]; do
-m|--maxInstances) max_instances $2; shift 2;;
-vjsapi) version_js_api $2; shift 2;;
-disable-control-flow|--disable-control-flow) disable_control_flow; shift;;
-gnu) gnu_mode; shift;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
if $GNU; then
sedi='-i'
else
sedi=('-i' '')
fi
rm -rf ./e2e/downloads/
rm -rf ./e2e-output/screenshots/
export TIMEOUT=$TIMEOUT
export SELENIUM_SERVER=$SELENIUM_SERVER
export SELENIUM_PROMISE_MANAGER=$SELENIUM_PROMISE_MANAGER
if $EXEC_VERSION_JSAPI == true; then
@@ -220,10 +232,26 @@ else
if [[ $LITESERVER == "true" ]]; then
echo "====== Run dist in lite-server ====="
ls demo-shell/dist
if [[ -n "${PROXY_HOST_ADF}" ]]
then
replace="\/"
encoded=${PROXY_HOST_ADF//\//$replace}
sed -e "s/\"bpmHost\": \".*\"/\"bpmHost\": \"${encoded}\"/g" "${sedi[@]}" demo-shell/dist/app.config.json
fi
if [[ -n "${PROXY_HOST_ADF}" ]]
then
replace="\/"
encoded=${PROXY_HOST_ADF//\//$replace}
sed -e "s/\"ecmHost\": \".*\"/\"ecmHost\": \"${encoded}\"/g" "${sedi[@]}" demo-shell/dist/app.config.json
fi
npm run lite-server-e2e>/dev/null & ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
else
if [[ $DEBUG == "true" ]]; then
echo "====== DEBUG ====="
echo "====== DEBUG npm run lite-server-e2e>/dev/null & ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
else====="
node --inspect-brk ./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1
else
./node_modules/protractor/bin/protractor protractor.conf.ts || exit 1

View File

@@ -12,7 +12,7 @@ AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 3 || exit 1)
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 2 -gnu || exit 1)
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]];
then
$RUN_CHECK

View File

@@ -13,7 +13,7 @@ AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 3 )
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 2 -gnu )
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]];
then

View File

@@ -10,5 +10,5 @@ AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "insight" || $TRAVIS_PULL_REQUEST == "false" ]];
then
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1;
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --use-dist || exit 1;
./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --folder insights --use-dist -gnu || exit 1;
fi;

View File

@@ -11,7 +11,7 @@ CONTEXT_ENV="process-services-cloud"
AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -host_sso "$E2E_HOST_SSO" -host_bpm "$E2E_HOST_BPM" -host_identity "$E2E_HOST_IDENTITY" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" --use-dist )
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST_BPM" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" -host_sso "$E2E_HOST_SSO" -host_bpm "$E2E_HOST_BPM" -host_identity "$E2E_HOST_IDENTITY" -identity_admin_email "$E2E_ADMIN_EMAIL_IDENTITY" -identity_admin_password "$E2E_ADMIN_PASSWORD_IDENTITY" --use-dist -gnu )
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]];
then

View File

@@ -12,7 +12,7 @@ AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV/")";
node ./scripts/check-env/check-ps-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 3 )
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 2 -gnu )
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "$CONTEXT_ENV" || $TRAVIS_PULL_REQUEST == "false" ]];
then

View File

@@ -12,7 +12,7 @@ AFFECTED_LIBS="$(./scripts/affected-libs.sh -gnu -b $TRAVIS_BRANCH)";
AFFECTED_E2E="$(./scripts/git-util/affected-folder.sh -b $TRAVIS_BRANCH -f "e2e/$CONTEXT_ENV")";
node ./scripts/check-env/check-cs-env.js --host "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" || exit 1
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 3 )
RUN_E2E=$(echo ./scripts/test-e2e-lib.sh -host http://localhost:4200 -proxy "$E2E_HOST" -u "$E2E_USERNAME" -p "$E2E_PASSWORD" -e "$E2E_EMAIL" --use-dist -b -m 2 -gnu )
if [[ $AFFECTED_LIBS =~ "testing" || $AFFECTED_LIBS =~ "content-services" || $TRAVIS_PULL_REQUEST == "false" ]];
then

View File

@@ -14,7 +14,5 @@ echo "Update AMA"
./scripts/travis/update/update-project.sh -gnu -t $GITHUB_TOKEN -n 'Alfresco/alfresco-modeler-app'
echo "Update Workspace"
./scripts/travis/update/update-project.sh -gnu -t $GITHUB_TOKEN -n 'Alfresco/alfresco-process-workspace-app'
echo "Update AMA Activiti"
./scripts/travis/update/update-project.sh -gnu -t $GITHUB_TOKEN -n 'Activiti/activiti-modeling-app'
echo "Update APA Activiti"
./scripts/travis/update/update-project.sh -gnu -t $GITHUB_TOKEN -n 'Alfresco/alfresco-admin-app'