[ACS-4586] Implemented Playwright Framework and add it to CI/CD (#2985)

This commit is contained in:
Kristian Dimitrov
2023-02-16 17:23:08 +00:00
committed by GitHub
parent 197ef8f0e3
commit d68deab2bd
47 changed files with 1413 additions and 117 deletions

View File

@@ -1,4 +1,7 @@
#!/usr/bin/env bash
storage_dir="./storage-state/AdminUserState.json"
rm -rf $storage_dir
# Upload protractor-smartrunner artifact related to this particular job to S3
./scripts/ci/utils/artifact-to-s3.sh -a "$SMART_RUNNER_DIRECTORY" -o "$S3_DBP_FOLDER/protractor-smartrunner-$TRAVIS_JOB_ID.tar.bz2"

View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
npx playwright install chromium

View File

@@ -7,6 +7,7 @@ show_help() {
echo "-target Project target"
echo "-tag Filter project with tag"
echo "-name Filter project with name"
echo "-test-runner Test runner to use (playwright or protractor)"
}
project_target(){
@@ -17,18 +18,27 @@ target_options(){
OPTIONS="$1"
}
test_runner(){
TEST_RUNNER=$1
}
while [[ $1 == -* ]]; do
case "$1" in
-target) project_target $2; shift 2;;
-options) target_options $2; shift 2;;
-test-runner) test_runner $2; shift 2;;
-*) echo "invalid option: $1" 1>&2; show_help; exit 0;;
esac
done
echo "Run alfresco-content-e2e protractor with options $OPTIONS"
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1"
./node_modules/.bin/tsc -p "./e2e/$E2E_TSCONFIG" || exit 1;
./node_modules/.bin/http-server -c-1 $CONTENT_CE_DIST_PATH -p 4200 > /dev/null &\
./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS $E2E_PROTRACTOR_OPTS || exit 1
if [ "$TEST_RUNNER" == "playwright" ]; then
echo "Running playwright tests with options $OPTIONS"
npx playwright test --config $OPTIONS
else
echo "Running protractor tests with options $OPTIONS"
echo "./node_modules/.bin/protractor \"./protractor.conf.js\" $OPTIONS || exit 1"
./node_modules/.bin/protractor "./protractor.conf.js" $OPTIONS $E2E_PROTRACTOR_OPTS || exit 1
fi