diff --git a/.github/scripts/run-browser-testing.sh b/.github/scripts/run-browser-testing.sh new file mode 100644 index 0000000..2e394da --- /dev/null +++ b/.github/scripts/run-browser-testing.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +# run next server +npm run dev & +APP_PID=$! + +echo $APP_PID + +echo "next lunching 3000..." + +# wait till the server starts +while ! nc -z localhost 3000; do + sleep 0.1 +done + +echo "run pupperteer browser testing..." +node scripts/browser-test.js + +# exit if pupperteer script failed +RESULT=$? +if [ $RESULT -eq 0 ]; then + echo pupperteer success +else + echo pupperteer failed +fi + +# end server process +# kill $APP_PID \ No newline at end of file diff --git a/.github/workflows/browsertesting.yml b/.github/workflows/browsertesting.yml index a46fa23..e22bb7a 100644 --- a/.github/workflows/browsertesting.yml +++ b/.github/workflows/browsertesting.yml @@ -42,8 +42,8 @@ jobs: id: browser-testing run: | - chmod +x run-browser-testing.sh - ./run-browser-testing.sh + chmod +x .github/scripts/run-browser-testing.sh + ./.github/scripts/run-browser-testing.sh - name: Use the value id: step_two