Files
alfresco-ng2-components/scripts/test-e2e-lib.sh
Denys Vuika 6b24bfb1d4 [ADF-3299] and [ADF-3300] upgrade to Angular and Material 6 (#3579)
* upgrade to HttpClient

* upgrade to Renderer2

* upgrade Document reference

* remove useless test with deprecated ReflectiveInjector

* upgrade to latest typescript

* upgrade libs

* upgrade package scripts

* remove rxjs blacklists and duplicate rules

* add rxjs compat to help with migration

* fix breaking changes

* fix breaking changes in material

* fix breaking changes (material 6)

* upgrade rxjs, ngx-translate and flex layout

* update unit tests

* restore providers

* upgrade deprecated Observable.error

* rebase
fix first configuration problems

* fix style issues commented

* fix core build

* fix lib template errors

* move lib test execution in angular.json

* ignore

* karma conf files

* fix import statement test

* single run option

* update packages reporter

* restore report

* increase timeout

* improve karma conf test configuration

* fix test issues about lint

* fix test analytics

* fix process service test

* content service fix test

* fix logout directive test

* fix core test

* fix build

* update node-sass to latest

* update angular cli dependencies

* improve build script

create directorites and move files only if previous command succeded

* upgrade individual libs to 6.0

* remove old webpack files

* revert sass change

* fix type issues
fix style issues

* fix tslint demo shell issue

* fix peerdependencies

* fix test e2e BC

* package upate

* fix style import issue

* extract-text-webpack-plugin beta

* fix test dist build command

* remove alpha js-api

* fix tslint issue
add banner tslint rule

* upload service fix

* change BC script

* fix test dist script

* increase demo shell timeout test

* verbose copy

* path absolute

* fix script bc

* fix copy part

* fix path warning
fix monaco editor

* remove duplicate header

* remove unused import

* fix align and check ago tests

* add missing import

* fix notification button selector

* [ANGULAR6] fixed core tests

* fix CS test

* fix cs test step 2

* increase travis_wait for dist

* fix attachment PS

* fix checklist test

* use pdf min
2018-08-14 15:42:43 +01:00

123 lines
3.1 KiB
Bash
Executable File

#!/usr/bin/env bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "$DIR/../"
BROWSER_RUN=false
DEVELOPMENT=false
show_help() {
echo "Usage: ./scripts/test-e2e-lib.sh -host adf.domain.com -u admin -p admin -e admin"
echo ""
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 "-s or --spec run a single test file"
echo "-f or --folder run a single folder test"
echo "-proxy or --proxy proxy Back end URL to use only possibel 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 "-save save the error screenshot in the remote env"
echo "-timeout or --timeout override the timeout foe the wait utils"
echo "-h or --help"
}
set_username(){
USERNAME=$1
}
set_password(){
PASSWORD=$1
}
set_email(){
EMAIL=$1
}
set_host(){
HOST=$1
}
set_test(){
SINGLE_TEST=true
NAME_TEST=$1
}
set_browser(){
echo "====== BROWSER RUN ====="
BROWSER_RUN=true
}
set_proxy(){
PROXY=$1
}
set_timeout(){
TIMEOUT=$1
}
set_save_screenshot(){
SAVE_SCREENSHOT=true
}
set_development(){
DEVELOPMENT=true
}
set_test_folder(){
FOLDER=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-h|--help|-\?) show_help; exit 0;;
-u|--username) set_username $2; shift 2;;
-p|--password) set_password $2; shift 2;;
-e|--email) set_email $2; shift 2;;
-f|--folder) set_test_folder $2; shift 2;;
-timeout|--timeout) set_timeout $2; shift 2;;
-b|--browser) set_browser; shift;;
-dev|--dev) set_development; shift;;
-s|--spec) set_test $2; shift 2;;
-save) set_save_screenshot; shift;;
-proxy|--proxy) set_proxy $2; shift 2;;
-host|--host) set_host $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
esac
done
rm -rf ./e2e/downloads/
rm -rf ./e2e-output/screenshots/
export URL_HOST_ADF=$HOST
export USERNAME_ADF=$USERNAME
export PASSWORD_ADF=$PASSWORD
export EMAIL_ADF=$EMAIL
export BROWSER_RUN=$BROWSER_RUN
export PROXY_HOST_ADF=$PROXY
export SAVE_SCREENSHOT=$SAVE_SCREENSHOT
export TIMEOUT=$TIMEOUT
export FOLDER=$FOLDER'/'
if [[ $DEVELOPMENT == "true" ]]; then
echo "====== Run against local development ====="
if [[ $SINGLE_TEST == "true" ]]; then
echo "====== Single test run $NAME_TEST ====="
npm run e2e-lib -- --specs ./e2e/$NAME_TEST || exit 1
else
npm run e2e-lib || exit 1
fi
else
if [[ $SINGLE_TEST == "true" ]]; then
npm install --save-dev jasmine2-protractor-utils -g
echo "====== Single test run $NAME_TEST ====="
webdriver-manager update --gecko=false --versions.chrome=2.38
./node_modules/protractor/bin/protractor protractor.conf.js --specs ./e2e/$NAME_TEST || exit 1
else
webdriver-manager update --gecko=false --versions.chrome=2.38
./node_modules/protractor/bin/protractor protractor.conf.js || exit 1
fi
fi