-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathentrypoint.sh
executable file
·24 lines (19 loc) · 1.15 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh -l
# create a function that recieves a file as input
test_selenium () {
echo "################### Running Selenium Tests ###################"
echo "Running tests for '$1' using '$2'"
echo "##############################################################"
echo "\n"
FILE_NAME=$(basename $1)
# run tests for each browser
echo "Running tests for Chrome"
JEST_JUNIT_OUTPUT_DIR=$GITHUB_WORKSPACE/reports JEST_JUNIT_OUTPUT_NAME=selenium-chrome-tests-report-$FILE_NAME.xml selenium-side-runner -c "browserName=chrome goog:chromeOptions.args=[headless, no-sandbox, remote-debugging-port=9222, disable-web-security, disable-features=IsolateOrigins,site-per-process]" -z $GITHUB_WORKSPACE/screenshots --output-directory $GITHUB_WORKSPACE/reports -j " --reporters=jest-junit --reporters=default " --timeout 5000 --base-url $2 $1
echo "######## Tests complete for '$1' ########\n"
}
for file in $(find $GITHUB_WORKSPACE -name '*.side'); do
# extract base url from the file and use that if $BASE_URL is empty
DEFAULT_URL=$(cat $file | jq -r '.url')
NEW_BASE_URL=${BASE_URL:-$DEFAULT_URL}
test_selenium $file $NEW_BASE_URL
done