File tree 2 files changed +21
-22
lines changed 2 files changed +21
-22
lines changed Original file line number Diff line number Diff line change 33
33
In addition code is ** fully** [ type annotated] ( https://docs.python.org/3/library/typing.html ) ⭐
34
34
35
35
## Quick start
36
- From the root directory of your shell run following commands :
36
+ From the root directory of your shell run following command :
37
37
38
- - Smoke tests
39
38
``` bash
40
- ./run-tests.sh smoke
41
- ```
39
+ ./run-tests.sh help
42
40
43
- - Unit tests
44
- ``` bash
45
- ./run-tests.sh unit
46
- ```
41
+ Tool allows to simplify run of automated tests for POM sample project.
47
42
48
- - Whole suite
49
- ``` bash
50
- ./run-tests.sh all
43
+ Available actions:
44
+ - smoke run automated smoke tests
45
+ - unittest run automated unittest tests
46
+ - all run all automated tests
47
+ - help display help
48
+
49
+ Note: help will be provided in case of no input parameters
51
50
` ` `
52
51
53
52
# ## Tests (html) report sample
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ # set of constants to colorize output
3
4
FAILED_OUT=" \033[0;31m"
4
5
YELLOW_OUT=" \033[1;33m"
5
6
NONE_OUT=" \033[0m"
6
7
7
8
8
- function pretty-output {
9
+ pretty-output () {
9
10
t=" $@ xxxx"
10
11
c=${replace:- -}
11
12
echo -e ${t// ?/ $c }
@@ -14,58 +15,57 @@ function pretty-output {
14
15
}
15
16
16
17
17
- function helper {
18
+ helper () {
18
19
echo " Tool allows to simplify run of automated tests for POM sample project."
19
20
echo " "
20
21
echo " Available actions:"
21
22
echo -e " - smoke\t\t run automated smoke tests"
22
23
echo -e " - unittest\t\t run automated unittest tests"
23
24
echo -e " - all\t\t\t run all automated tests"
24
- echo -e " - help\t\t\t display help"
25
+ echo -e " - help\t\t\t display help message "
25
26
echo " "
26
27
echo -e " Note:\t\t help will be provided in case of no input parameters"
27
28
}
28
29
29
30
30
- function raise-error-message {
31
+ raise-error-message () {
31
32
echo -e " Invalid ${FAILED_OUT} $1 ${NONE_OUT} parameter is provided!"
32
33
echo -e " Please use ${YELLOW_OUT} smoke${NONE_OUT} or ${YELLOW_OUT} unit${NONE_OUT} or ${YELLOW_OUT} help${NONE_OUT} keys as a flag."
33
34
exit 1
34
35
}
35
36
36
37
37
- function clear-trash {
38
+ clear-trash () {
38
39
local trash=' .pytest_cache'
39
40
[[ -d " $trash " ]] && echo " removing ${trash} testing trash" && rm -rf ${trash} && echo " environment is cleared"
40
41
}
41
42
42
43
43
- function unit {
44
+ unit () {
44
45
pytest -m unit
45
46
}
46
47
47
48
48
- function smoke {
49
+ smoke () {
49
50
pytest -m smoke
50
51
}
51
52
52
53
53
- function all {
54
+ all () {
54
55
pytest
55
56
}
56
57
57
58
58
- function run-tests {
59
+ run-tests () {
59
60
local arg=$1
60
61
if [[ ${arg} == " smoke" ]] || [[ ${arg} == " unit" ]];
61
62
then pretty-output " Running ${arg} suite" && pytest -m " ${arg} " ; clear-trash
62
63
elif [[ ${arg} == " all" ]]
63
64
then pretty-output " Running ${arg} suite" && pytest; clear-trash
64
- elif [[ $# -eq 0 ]] || [[ ${arg} == " --help" ]] || [[ ${arg} == " -h" ]]
65
+ elif [[ $# -eq 0 ]] || [[ ${arg} == " help " ]] || [[ ${arg} == " --help" ]] || [[ ${arg} == " -h" ]]
65
66
then helper
66
67
else raise-error-message " ${arg} "
67
68
fi
68
- return 0
69
69
}
70
70
71
71
run-tests " $1 "
You can’t perform that action at this time.
0 commit comments