Skip to content

Commit 0906dbd

Browse files
committed
Tune help message
1 parent bb28c23 commit 0906dbd

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,20 @@
3333
In addition code is **fully** [type annotated](https://docs.python.org/3/library/typing.html)
3434

3535
## Quick start
36-
From the root directory of your shell run following commands:
36+
From the root directory of your shell run following command:
3737

38-
- Smoke tests
3938
```bash
40-
./run-tests.sh smoke
41-
```
39+
./run-tests.sh help
4240

43-
- Unit tests
44-
```bash
45-
./run-tests.sh unit
46-
```
41+
Tool allows to simplify run of automated tests for POM sample project.
4742

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
5150
```
5251
5352
### Tests (html) report sample

run-tests.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/bin/bash
22

3+
# set of constants to colorize output
34
FAILED_OUT="\033[0;31m"
45
YELLOW_OUT="\033[1;33m"
56
NONE_OUT="\033[0m"
67

78

8-
function pretty-output {
9+
pretty-output() {
910
t="$@xxxx"
1011
c=${replace:--}
1112
echo -e ${t//?/$c}
@@ -14,58 +15,57 @@ function pretty-output {
1415
}
1516

1617

17-
function helper {
18+
helper() {
1819
echo "Tool allows to simplify run of automated tests for POM sample project."
1920
echo ""
2021
echo "Available actions:"
2122
echo -e " - smoke\t\t run automated smoke tests"
2223
echo -e " - unittest\t\t run automated unittest tests"
2324
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"
2526
echo ""
2627
echo -e "Note:\t\t help will be provided in case of no input parameters"
2728
}
2829

2930

30-
function raise-error-message {
31+
raise-error-message() {
3132
echo -e "Invalid ${FAILED_OUT}$1${NONE_OUT} parameter is provided!"
3233
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."
3334
exit 1
3435
}
3536

3637

37-
function clear-trash {
38+
clear-trash() {
3839
local trash='.pytest_cache'
3940
[[ -d "$trash" ]] && echo "removing ${trash} testing trash" && rm -rf ${trash} && echo "environment is cleared"
4041
}
4142

4243

43-
function unit {
44+
unit() {
4445
pytest -m unit
4546
}
4647

4748

48-
function smoke {
49+
smoke() {
4950
pytest -m smoke
5051
}
5152

5253

53-
function all {
54+
all() {
5455
pytest
5556
}
5657

5758

58-
function run-tests {
59+
run-tests() {
5960
local arg=$1
6061
if [[ ${arg} == "smoke" ]] || [[ ${arg} == "unit" ]];
6162
then pretty-output "Running ${arg} suite" && pytest -m "${arg}"; clear-trash
6263
elif [[ ${arg} == "all" ]]
6364
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" ]]
6566
then helper
6667
else raise-error-message "${arg}"
6768
fi
68-
return 0
6969
}
7070

7171
run-tests "$1"

0 commit comments

Comments
 (0)