Skip to content

Commit

Permalink
also check that output files do exist on test
Browse files Browse the repository at this point in the history
  • Loading branch information
phartenfeller committed Nov 14, 2022
1 parent 71c5e51 commit 6bfcec2
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,32 @@
IMAGE_NAME="lct-playwright-image:latest"

function copy_test_files() {
rm -rf /test/$1/output/ || true
rm ./test/$1/lctReporter.js || true
rm ./test/$1/playwright.config.js || true
FOLDER=$1

cp ./test/lctReporter.js ./test/$1
cp ./test/playwright.config.js ./test/$1
rm -rf /test/$FOLDER/output/ || true
rm ./test/$FOLDER/lctReporter.js || true
rm ./test/$FOLDER/playwright.config.js || true

cp ./test/lctReporter.js ./test/$FOLDER
cp ./test/playwright.config.js ./test/$FOLDER
}

function single_file_exists() {
FILE=$1

if [ ! -f "$FILE" ]; then
echo "$FILE not found."
exit 1
else
echo "$FILE found."
fi
}

function test_result_files_exist() {
FOLDER=$1

single_file_exists "./test/$FOLDER/output/results.xml"
single_file_exists "./test/$FOLDER/output/output.log"
}

echo "Launching Test Suite..."
Expand All @@ -17,11 +37,14 @@ chmod -R 777 ./test/*
echo "Starting chromium test..."
copy_test_files "chromium"
docker run --rm --ipc=host -v $(pwd)/test/chromium:/app/volume $IMAGE_NAME
test_result_files_exist "chromium"

echo "Starting firefox test..."
copy_test_files "firefox"
docker run --rm --ipc=host -v $(pwd)/test/firefox:/app/volume $IMAGE_NAME
test_result_files_exist "firefox"

echo "Starting webkit test..."
copy_test_files "webkit"
docker run --rm --ipc=host -v $(pwd)/test/webkit:/app/volume $IMAGE_NAME
test_result_files_exist "webkit"

0 comments on commit 6bfcec2

Please sign in to comment.