-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathallure.sh
executable file
·111 lines (99 loc) · 2.25 KB
/
allure.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/bin/bash
BROWSER="firefox"
# Read command-line arguments
while [ $# -gt 0 ]; do
case $1 in
--browser)
BROWSER="$2"
shift 2
;;
*)
echo "Unknown option $1"
exit 1
;;
esac
done
# Browser with initial uppercase
BROWSER=${BROWSER,,}
BROWSER=${BROWSER^}
# Replace Msedge by Edge
if [ $BROWSER = "Msedge" ]; then
BROWSER="Edge"
fi
#
# Java tests
#
cat << EOF > reporting/allure-results/java/environment.properties
Browser = $BROWSER
OpenJDK = 17
Selenium = 4.24.0
Playwright = 1.47.0
Rest-assured = 5.5.0
Karate = 1.4.1
EOF
#Cucumber-JVM = 7.15.0
if [ -f reporting/allure-results/java/job.url ]; then
cat << EOF > reporting/allure-results/java/executor.json
{
"name": "${EXECUTOR_NAME}",
"type": "${EXECUTOR_TYPE}",
"buildName": "Build log",
"buildUrl": "$(cat reporting/allure-results/java/job.url)",
"reportName": "Demo Java report"
}
EOF
fi
allure generate \
--clean \
--output reporting/allure-reports/report-java \
--single-file reporting/allure-results/java
#
# Node.js tests
#
cat << EOF > reporting/allure-results/nodejs/environment.properties
Browser = $BROWSER
Node.js = 20.13.1
Playwright = 1.47.1
Cucumber.js = 10.9.0
EOF
if [ -f reporting/allure-results/nodejs/job.url ]; then
cat << EOF > reporting/allure-results/nodejs/executor.json
{
"name": "${EXECUTOR_NAME}",
"type": "${EXECUTOR_TYPE}",
"buildName": "Build log",
"buildUrl": "$(cat reporting/allure-results/nodejs/job.url)",
"reportName": "Demo Node.js report"
}
EOF
fi
allure generate \
--clean \
--output reporting/allure-reports/report-nodejs \
--single-file reporting/allure-results/nodejs
#
# Python tests
#
cat << EOF > reporting/allure-results/python/environment.properties
Browser = $BROWSER
Python = 3.10.12
Behave = 1.2.6
Selenium = 4.24.0
Playwright = 1.47.0
RobotFramework = 7.1
EOF
if [ -f reporting/allure-results/python/job.url ]; then
cat << EOF > reporting/allure-results/python/executor.json
{
"name": "${EXECUTOR_NAME}",
"type": "${EXECUTOR_TYPE}",
"buildName": "Build log",
"buildUrl": "$(cat reporting/allure-results/python/job.url)",
"reportName": "Demo Python report"
}
EOF
fi
allure generate \
--clean \
--output reporting/allure-reports/report-python \
--single-file reporting/allure-results/python