2023-04-30 14:47:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-06-26 08:29:03 +00:00
|
|
|
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2023-04-30 14:47:51 +00:00
|
|
|
set -Eeuo pipefail
|
|
|
|
trap cleanup SIGINT SIGTERM ERR EXIT
|
|
|
|
|
|
|
|
readonly PROJECT_ROOT=$(realpath $(dirname $(dirname "${BASH_SOURCE[0]}")))
|
|
|
|
|
|
|
|
source $PROJECT_ROOT/scripts/lib.sh
|
|
|
|
|
2023-04-30 15:40:59 +00:00
|
|
|
is_ci(){
|
|
|
|
if [ -z ${CI+x} ];
|
|
|
|
then
|
|
|
|
return 1
|
|
|
|
else
|
|
|
|
return 0
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2023-04-30 14:47:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
docker-compose down -v --remove-orphans || true
|
|
|
|
docker-compose up -d
|
|
|
|
cd $(mktemp -d)
|
2023-04-30 15:40:59 +00:00
|
|
|
pwd
|
|
|
|
find
|
2023-04-30 14:47:51 +00:00
|
|
|
git clone https://github.com/mCaptcha/integration .
|
2023-04-30 15:40:59 +00:00
|
|
|
|
|
|
|
if is_ci
|
|
|
|
then
|
|
|
|
yarn install
|
|
|
|
xvfb-run --auto-servernum npm run test.firefox
|
2023-07-03 12:26:30 +00:00
|
|
|
xvfb-run --auto-servernum npm run test.chrome
|
2023-04-30 15:40:59 +00:00
|
|
|
else
|
|
|
|
yarn install
|
|
|
|
npx nightwatch ./test/mCaptcha.ts
|
|
|
|
fi
|
|
|
|
|
2023-04-30 14:47:51 +00:00
|
|
|
cd $PROJECT_ROOT
|
|
|
|
docker-compose down -v --remove-orphans || true
|