From 9cc667851ca508a404571d1087f3bf6251849c3b Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sun, 30 Apr 2023 20:17:51 +0530 Subject: [PATCH] feat: run integration tests using nightwatch js --- Makefile | 3 +++ scripts/integration.sh | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100755 scripts/integration.sh diff --git a/Makefile b/Makefile index d3befa05..a73d4fc7 100644 --- a/Makefile +++ b/Makefile @@ -123,6 +123,9 @@ test: frontend-test frontend ## Run all available tests cargo test --no-fail-fast # ./scripts/tests.sh +test.integration: ## run integration tests with nightwatch.js + ./scripts/integration.sh + xml-test-coverage: migrate ## Generate code coverage report in XML format $(call cache_bust) cargo tarpaulin -t 1200 --out Xml diff --git a/scripts/integration.sh b/scripts/integration.sh new file mode 100755 index 00000000..4a0b02d3 --- /dev/null +++ b/scripts/integration.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -Eeuo pipefail +trap cleanup SIGINT SIGTERM ERR EXIT + +readonly PROJECT_ROOT=$(realpath $(dirname $(dirname "${BASH_SOURCE[0]}"))) + +source $PROJECT_ROOT/scripts/lib.sh + + + +docker-compose down -v --remove-orphans || true +docker-compose up -d +cd $(mktemp -d) +git clone https://github.com/mCaptcha/integration . +yarn install +npx nightwatch ./test/mCaptcha.ts +cd $PROJECT_ROOT +docker-compose down -v --remove-orphans || true