-
Notifications
You must be signed in to change notification settings - Fork 7
/
show_test_suites.sh
executable file
·87 lines (71 loc) · 1.66 KB
/
show_test_suites.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
# Abort immediately if a command fails
set -e
echo
echo "------------------------"; echo
echo " Hello friend."; echo;
echo "------------------------"; echo
tool="${TEENA__TOOL}"
options=("BOA" "Ripley" "SuiteC")
function set_tool {
input=$(echo "${1}" | tr '[:upper:]' '[:lower:]')
case "${input}" in
"boa")
tool='boac'
friendly_tool_name=${options[0]}
;;
"boac")
tool='boac'
friendly_tool_name=${options[0]}
;;
"ripley")
tool='ripley'
friendly_tool_name=${options[2]}
;;
"suitec")
tool='squiggy'
friendly_tool_name=${options[3]}
;;
*)
echo "[ERROR] Invalid option: ${REPLY}"
exit 1
;;
esac
}
# ----
options=("BOA" "Ripley" "SuiteC")
echo 'Which tool are you testing?'; echo
if [ -z "${tool}" ]
then
PS3=$'\nEnter: '
select opt in "${options[@]}"; do
set_tool "${opt}"
break
done
else
set_tool "${tool}"
fi
# ----
echo; echo "${friendly_tool_name} Selenium scripts:"; echo
case "${tool}" in
"boac")
pattern="${tool}_*_spec.rb"
prefix="spec/${tool}/${tool}_"
;;
*)
pattern="*_spec.rb"
prefix="spec/${tool}/"
;;
esac
find "spec/${tool}" -name "${pattern}" -type f | sort -V | while read line; do
suffix='_spec.rb'
name=${line#"$prefix"}
name=${name%"$suffix"}
echo " ${name}"
done
# ----
echo
echo "--------------------------------"; echo
echo " Thank you and goodnight."; echo
echo "--------------------------------"; echo
exit 0