forked from invoiceninja/invoiceninja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dusk.sh
64 lines (43 loc) · 1.66 KB
/
dusk.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
n=1
TYPE=${!n}
if [ -z "$TYPE" ]; then
TYPE="all"
fi
echo "$ RUNNING: '$TYPE'"
echo "$ php artisan optimize"
php artisan optimize
echo "=========================================="
GENERIC_TESTS=`find tests/Browser/ClientPortal/ -maxdepth 1 -type f -name '*.php'`
if [ $TYPE == 'gateways' ]; then
GENERIC_TESTS=""
echo "$ Skippping generic tests."
echo "=========================================="
fi
for TEST_CLASS in $GENERIC_TESTS; do
echo "Test class: $TEST_CLASS"
echo "$ php artisan migrate:fresh --seed"
php artisan migrate:fresh --seed &> /dev/null
echo "$ php artisan ninja:create-single-account"
php artisan ninja:create-single-account &> /dev/null
echo "$ php artisan dusk $TEST_CLASS"
php -d memory_limit=1G artisan dusk ${@:2} --stop-on-error --stop-on-failure $TEST_CLASS || exit 1
echo "=========================================="
done || exit 1
GATEWAY_TESTS=`find tests/Browser/ClientPortal/Gateways/ -type f -name '*.php'`
if [ $TYPE == 'generic' ]; then
GATEWAY_TESTS=""
echo "$ Skippping gateway tests."
echo "=========================================="
fi
for TEST_CLASS in $GATEWAY_TESTS; do
echo "Test class: $TEST_CLASS"
echo "$ php artisan migrate:fresh --seed"
php artisan migrate:fresh --seed &> /dev/null
echo "$ php artisan ninja:create-single-account"
php artisan ninja:create-single-account &> /dev/null
echo "$ php artisan dusk $TEST_CLASS"
php -d memory_limit=1G artisan dusk ${@:2} --stop-on-error --stop-on-failure $TEST_CLASS || exit 1
echo "=========================================="
done || exit 1
echo 'All tests completed successfully.'