forked from datahub-project/datahub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cypress-dev.sh
executable file
·38 lines (28 loc) · 889 Bytes
/
cypress-dev.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -euxo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
if [ "${RUN_QUICKSTART:-true}" == "true" ]; then
source ./run-quickstart.sh
fi
set +x
echo "Activating virtual environment"
source venv/bin/activate
set -x
# set environment variables for the test
source ./set-test-env-vars.sh
LOAD_DATA=$(cat <<EOF
from conftest import build_auth_session, build_graph_client
from tests.cypress.integration_test import ingest_data
auth_session = build_auth_session()
ingest_data(auth_session, build_graph_client(auth_session))
EOF
)
echo -e "$LOAD_DATA" | python
cd tests/cypress
yarn install
source "$DIR/set-cypress-creds.sh"
if [ "${RUN_UI:-true}" == "true" ]; then
npx cypress open \
--env "ADMIN_DISPLAYNAME=$CYPRESS_ADMIN_DISPLAYNAME,ADMIN_USERNAME=$CYPRESS_ADMIN_USERNAME,ADMIN_PASSWORD=$CYPRESS_ADMIN_PASSWORD"
fi