-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.sh
executable file
·146 lines (128 loc) · 3.55 KB
/
runner.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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
#!/bin/bash
BROWSER="firefox"
HEADLESS="true"
HUB="localhost"
# Read command-line arguments
while [ $# -gt 0 ]; do
case $1 in
--browser)
BROWSER="$2"
shift 2
;;
--headless)
HEADLESS="$2"
shift 2
;;
*)
echo "Unknown option $1"
exit 1
;;
esac
done
# Change variable values to lowercase
BROWSER=${BROWSER,,}
mkdir /tmp/test
cp tests-python/file.xml /tmp/test/
echo "################"
echo "# Python tests #"
echo "################"
echo "python: " $(python3 --version)
cd tests-python
export PYTHONPATH=$(pwd)
# pip install --break-system-packages -r requirements.txt
pip install -r requirements.txt
playwright install
rfbrowser init
echo =================
echo Python - Cucumber
echo =================
behave cucumber/features/petstore.feature
echo ===================
echo Python - Playwright
echo ===================
# pytest web_playwright/tests/webform_test.py
if [ $BROWSER = "msedge" ] || [ $BROWSER = "chrome" ]; then
pytest web_playwright/tests/ --browser-channel $BROWSER
else
pytest web_playwright/tests/ --browser $BROWSER
fi
echo =================
echo Python - Selenium
echo =================
pytest web_selenium/tests/ --driver $BROWSER # --hub $HUB
echo ===============
echo Python - Pytest
echo ===============
pytest web_pytest/tests/ --driver $BROWSER \
--alluredir /tmp \
--html=../reporting/report-pytest/index.html \
--css=report.css
echo ========================
echo Python - Robot Framework
echo ========================
robot --outputdir ../reporting/report-robot --variable BROWSER:${BROWSER} --variable DRIVER:headless${BROWSER} \
--listener allure_robotframework:../reporting/allure-results/python ./
unset PYTHONPATH
cd ..
echo "#################"
echo "# Node.js tests #"
echo "#################"
echo "node.js: " $(nodejs --version)
echo "npm: " $(npm --version)
cd tests-nodejs
npm install
npx playwright install
echo ==================
echo Node.js - Cucumber
echo ==================
npx cucumber-js cucumber/features/petstore.feature
echo ====================
echo Node.js - Playwright
echo ====================
# npx playwright test webform.spec.ts
npx playwright test --project $BROWSER
echo =================
echo Node.js - Cypress
echo =================
# npx cypress run --spec web_cypress/tests/webform.cy.js
if [ $BROWSER = "msedge" ]; then
npx cypress run --browser edge --headless
else
npx cypress run --browser $BROWSER --headless
fi
cd ..
echo "##############"
echo "# Java tests #"
echo "##############"
echo "java: " $(java --version)
echo "maven: " $(mvn --version)
cd tests-java
mvn dependency:resolve
echo ===================
echo Java - Rest-Assured
echo ===================
mvn -Dtest="rest_api_rest_assured/**" test
echo =================
echo Java - Playwright
echo =================
# mvn -Dtest="web_playwright/WebFormTest" test
mvn -Dtest="web_playwright/**" -Dbrowser=$BROWSER test
echo ===============
echo Java - Selenium
echo ===============
mvn -Dtest="web_selenium/**" -Dbrowser=$BROWSER test # -Dhub=$HUB test
echo =============
echo Java - Karate
echo =============
# mvn -Dtest="web_karate/**, rest_api_karate/**" -Dbrowser=$BROWSER test
# mvn -Dtest="karate/TestRunner#modularityTest" -Dbrowser=firefox test
mvn -Dtest="karate/TestRunner#allTests" -Dbrowser=$BROWSER test
# Purge weird Allure Karate entries
cd ..
mv tests-java/target/karate-reports reporting/report-karate
for filename in reporting/allure-results/java/*result.json; do
RES=$(egrep '"testCaseName":"\[[0-9]+:[0-9]+\]' $filename)
if [ -n "$RES" ]; then
rm -f $filename
fi
done