Skip to content

Commit 5b15b42

Browse files
authored
Merge pull request #434 from TESTARtool/master_webdriver
Use Chrome for Testing with WebdriverManager for testing web applications
2 parents df373ca + 333eccc commit 5b15b42

55 files changed

Lines changed: 1754 additions & 969 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ updates:
1111
interval: "weekly"
1212
allow:
1313
- dependency-name: "org.seleniumhq.selenium:selenium-java"
14+
- dependency-name: "io.github.bonigarcia:webdrivermanager"
1415
- dependency-name: "io.appium:java-client"

.github/workflows/test-macos-chromedriver.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
name: macOS TESTAR Chromedriver CI tests
22

33
on:
4-
push:
5-
branches: [ master ]
6-
pull_request:
7-
branches: [ master ]
4+
workflow_dispatch:
85

96
jobs:
107
macos:

.github/workflows/test-ubuntu-chromedriver.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
linux:
11-
runs-on: ubuntu-latest
11+
runs-on: ubuntu-22.04
1212
timeout-minutes: 10
1313
continue-on-error: true
1414

@@ -40,7 +40,7 @@ jobs:
4040
- name: Install dependencies
4141
run: |
4242
sudo apt-get update
43-
sudo apt install -y xvfb x11-utils libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xdotool
43+
sudo DEBIAN_FRONTEND=noninteractive apt install -yq xvfb x11-utils libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0 xdotool libxdamage1 libxrandr2 libgbm1 libasound2 libatk-bridge2.0-0 libgtk-3-0 libnss3 libxss1 libxcomposite1 libxshmfence1 libxfixes3 libxext6 libx11-xcb1 libxtst6 libcups2 libdrm2 libpci3
4444
4545
- name: Run webdriver protocol and detect SuspiciousTag while using the State Model
4646
run: xvfb-run ./gradlew runTestWebdriverSuspiciousTagStateModelUbuntu

.github/workflows/test-windows.yml renamed to .github/workflows/test-windows-desktop.yml

Lines changed: 2 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Windows TESTAR CI tests
1+
name: Windows desktop TESTAR CI tests
22

33
on:
44
push:
@@ -9,7 +9,7 @@ on:
99
jobs:
1010
windows:
1111
runs-on: windows-latest
12-
timeout-minutes: 15
12+
timeout-minutes: 10
1313

1414
strategy:
1515
fail-fast: false
@@ -33,14 +33,6 @@ jobs:
3333
- name: Build TESTAR with Gradle
3434
run: ./gradlew build
3535

36-
- name: Save JUnit test results
37-
uses: actions/upload-artifact@v4
38-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
39-
if: failure()
40-
with:
41-
name: Java${{ matrix.java }}-saveJunitTests-artifact
42-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/reports/tests
43-
4436
- name: Prepare installed distribution of TESTAR with Gradle
4537
run: ./gradlew installDist
4638

@@ -146,63 +138,3 @@ jobs:
146138
with:
147139
name: Java${{ matrix.java }}-runTestDesktopGenericStateModelCustomAbstraction-artifact
148140
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/notepad_state_model_custom
149-
150-
- name: Run webdriver protocol and detect SuspiciousTag while using the State Model
151-
run: ./gradlew runTestWebdriverSuspiciousTagStateModel
152-
- name: Save runTestWebdriverSuspiciousTagStateModel HTML report artifact
153-
uses: actions/upload-artifact@v4
154-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
155-
if: failure()
156-
with:
157-
name: Java${{ matrix.java }}-runTestWebdriverSuspiciousTagStateModel-artifact
158-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_and_suspicious
159-
160-
- name: Run webdriver to login in parabank and detect browser console error
161-
run: ./gradlew runTestWebdriverParabankLoginAndConsoleError
162-
- name: Save runTestWebdriverParabankLoginAndConsoleError HTML report artifact
163-
uses: actions/upload-artifact@v4
164-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
165-
if: failure()
166-
with:
167-
name: Java${{ matrix.java }}-runTestWebdriverParabankLoginAndConsoleError-artifact
168-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_login_console_error
169-
170-
- name: Run webdriver to login in parabank using form filling
171-
run: ./gradlew runTestWebdriverParabankFormFilling
172-
- name: Save runTestWebdriverParabankFormFilling HTML report artifact
173-
uses: actions/upload-artifact@v4
174-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
175-
if: failure()
176-
with:
177-
name: Java${{ matrix.java }}-runTestWebdriverParabankFormFilling-artifact
178-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_form_filling
179-
180-
- name: Run webdriver to login in parabank and execute webdriver remote actions
181-
run: ./gradlew runTestWebdriverParabankRemoteActions
182-
- name: Save runTestWebdriverParabankRemoteActions HTML report artifact
183-
uses: actions/upload-artifact@v4
184-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
185-
if: failure()
186-
with:
187-
name: Java${{ matrix.java }}-runTestWebdriverParabankRemoteActions-artifact
188-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_remote_actions
189-
190-
- name: Run TESTAR Replay mode with a web page to check that replayed correctly
191-
run: ./gradlew runTestWebdriverCorrectReplay
192-
- name: Save runTestWebdriverCorrectReplay HTML report artifact
193-
uses: actions/upload-artifact@v4
194-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
195-
if: failure()
196-
with:
197-
name: Java${{ matrix.java }}-runTestWebdriverCorrectReplay-artifact
198-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_replay
199-
200-
- name: Run TESTAR Replay mode to detect a not replayable button
201-
run: ./gradlew runTestWebdriverUnreplayable
202-
- name: Save runTestWebdriverUnreplayable HTML report artifact
203-
uses: actions/upload-artifact@v4
204-
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
205-
if: failure()
206-
with:
207-
name: Java${{ matrix.java }}-runTestWebdriverUnreplayable-artifact
208-
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_unreplayable
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Windows webdriver TESTAR CI tests
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
windows:
11+
runs-on: windows-latest
12+
timeout-minutes: 10
13+
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
java: [ '11', '17', '21' ]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Set up Java ${{ matrix.java }}
22+
uses: actions/setup-java@v4
23+
with:
24+
distribution: 'corretto'
25+
java-version: ${{ matrix.java }}
26+
27+
- name: Grant execute permission for gradlew
28+
run: chmod +x gradlew
29+
30+
- name: Prepare TESTAR protocols
31+
run: ./gradlew init_workflow_test
32+
33+
- name: Build TESTAR with Gradle
34+
run: ./gradlew build
35+
36+
- name: Prepare installed distribution of TESTAR with Gradle
37+
run: ./gradlew installDist
38+
39+
- name: Run webdriver protocol and detect SuspiciousTag while using the State Model
40+
run: ./gradlew runTestWebdriverSuspiciousTagStateModel
41+
- name: Save runTestWebdriverSuspiciousTagStateModel HTML report artifact
42+
uses: actions/upload-artifact@v4
43+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
44+
if: failure()
45+
with:
46+
name: Java${{ matrix.java }}-runTestWebdriverSuspiciousTagStateModel-artifact
47+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_and_suspicious
48+
49+
- name: Run webdriver to login in parabank and detect browser console error
50+
run: ./gradlew runTestWebdriverParabankLoginAndConsoleError
51+
- name: Save runTestWebdriverParabankLoginAndConsoleError HTML report artifact
52+
uses: actions/upload-artifact@v4
53+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
54+
if: failure()
55+
with:
56+
name: Java${{ matrix.java }}-runTestWebdriverParabankLoginAndConsoleError-artifact
57+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_login_console_error
58+
59+
- name: Run webdriver to login in parabank using form filling
60+
run: ./gradlew runTestWebdriverParabankFormFilling
61+
- name: Save runTestWebdriverParabankFormFilling HTML report artifact
62+
uses: actions/upload-artifact@v4
63+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
64+
if: failure()
65+
with:
66+
name: Java${{ matrix.java }}-runTestWebdriverParabankFormFilling-artifact
67+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_form_filling
68+
69+
- name: Run webdriver to login in parabank and execute webdriver remote actions
70+
run: ./gradlew runTestWebdriverParabankRemoteActions
71+
- name: Save runTestWebdriverParabankRemoteActions HTML report artifact
72+
uses: actions/upload-artifact@v4
73+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
74+
if: failure()
75+
with:
76+
name: Java${{ matrix.java }}-runTestWebdriverParabankRemoteActions-artifact
77+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_remote_actions
78+
79+
- name: Run TESTAR Replay mode with a web page to check that replayed correctly
80+
run: ./gradlew runTestWebdriverCorrectReplay
81+
- name: Save runTestWebdriverCorrectReplay HTML report artifact
82+
uses: actions/upload-artifact@v4
83+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
84+
if: failure()
85+
with:
86+
name: Java${{ matrix.java }}-runTestWebdriverCorrectReplay-artifact
87+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_replay
88+
89+
- name: Run TESTAR Replay mode to detect a not replayable button
90+
run: ./gradlew runTestWebdriverUnreplayable
91+
- name: Save runTestWebdriverUnreplayable HTML report artifact
92+
uses: actions/upload-artifact@v4
93+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
94+
if: failure()
95+
with:
96+
name: Java${{ matrix.java }}-runTestWebdriverUnreplayable-artifact
97+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/webdriver_unreplayable
98+
99+
- name: Check Firefox and Edge browsers paths
100+
run: |
101+
if (Test-Path "C:\Program Files\Mozilla Firefox\firefox.exe") {
102+
Write-Output "Firefox browser found!"
103+
} else {
104+
Write-Output "Firefox browser not found..."
105+
}
106+
if (Test-Path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe") {
107+
Write-Output "Edge browser found!"
108+
} else {
109+
Write-Output "Edge browser not found..."
110+
}
111+
shell: pwsh
112+
113+
- name: Run firefox and webdriver to detect a suspicious message
114+
run: ./gradlew runTestFirefoxWebdriverSuspiciousTagStateModel
115+
- name: Save runTestFirefoxWebdriverSuspiciousTagStateModel HTML report artifact
116+
uses: actions/upload-artifact@v4
117+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
118+
if: failure()
119+
with:
120+
name: Java${{ matrix.java }}-runTestFirefoxWebdriverSuspiciousTagStateModel-artifact
121+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/firefox_webdriver_suspicious_state_model
122+
123+
- name: Run edge and webdriver to detect a suspicious message
124+
run: ./gradlew runTestEdgeWebdriverSuspiciousTagStateModel
125+
- name: Save runTestEdgeWebdriverSuspiciousTagStateModel HTML report artifact
126+
uses: actions/upload-artifact@v4
127+
# Only upload GitHub Actions results if this task fails (Can be replaced with 'if: always()')
128+
if: failure()
129+
with:
130+
name: Java${{ matrix.java }}-runTestEdgeWebdriverSuspiciousTagStateModel-artifact
131+
path: D:/a/TESTAR_dev/TESTAR_dev/testar/target/install/testar/bin/edge_webdriver_suspicious_state_model

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This selenium docker image already contains chromedriver and xvfb
1+
# This selenium docker image already contains webdriver and xvfb
22
FROM selenium/standalone-chrome
33

44
# Update image dependencies and java

Dockerfile.android

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This docker image already contains chromedriver and xvfb
1+
# This docker image already contains webdriver and xvfb
22
FROM selenium/standalone-chrome
33

44
# Update image dependencies and java

Dockerfile.seleniarm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Seleniarm docker image for ARM architectures
22
# https://github.com/TESTARtool/TESTAR_dev/issues/374
3-
# This seleniarm docker image already contains chromedriver and xvfb
3+
# This seleniarm docker image already contains webdriver and xvfb
44
FROM seleniarm/standalone-chromium
55

66
# Update image dependencies and java

README.Docker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Mount /testar/bin/settings to a certal location to have the settings configurati
77
Take care of setting ShowVisualSettingsDialog to False in the settings file as well.
88
Take care of the following settings in the used settings file:
99
- Mode should be Generate
10-
- SUTConnectorValue should contain the reference "/usr/bin/chromedriver" (the internal chromedriver of the Docker container)
10+
- SUTConnectorValue should indicate the web URL to test (TESTAR will automatically download chrome for testing)
1111
- VisualizeActions should be false
1212
- ShowVisualSettingsDialogOnStartup should be false
1313
- FlashFeedback should be false

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,16 @@ If you encounter any errors, please create an issue and provide details about yo
193193

194194
### Ubuntu (For Web systems under test)
195195

196-
- Ubuntu 20 and 22 LTS are operating system versions that have been used to run the chromedriver package of TESTAR for testing web applications.
197-
``NOTE:`` It is important to use an environment with Graphical User Interface or to install and enable the Xvfb (X virtual framebuffer) server.
196+
- Ubuntu 22 LTS are operating system versions that have been used to run the webdriver package of TESTAR for testing web applications.
197+
``GUI testing NOTE:`` It is important to use an environment with Graphical User Interface or to install and enable the Xvfb (X virtual framebuffer) server.
198+
``Chrome NOTE2`` Chrome for testing requires additional runtime libraries, such as`libasound2` library.
198199

199-
### macOS (For Web systems under test)
200+
- Ubuntu 24 LTS introduces updated libraries, and `libasound2` is now replaced by `libasound2t64`. Be sure to install this newer package to ensure Chrome runs correctly.
200201

201-
- macOS Monterey-ADM64 (version 12) and Sonoma-ARM (version 14) operating systems have been used in the GitHub Action to run the chromedriver package of TESTAR for testing web applications.
202-
``NOTE:`` The ADM64 and ARM architectures require different software components, such as seleniarm docker images and chromedriver arm versions.
202+
### Temporally unsupported: macOS (For Web systems under test)
203+
204+
- macOS Monterey-ADM64 (version 12) and Sonoma-ARM (version 14) operating systems have been used in the GitHub Action to run the webdriver package of TESTAR for testing web applications.
205+
``NOTE:`` The ADM64 and ARM architectures require different software components, such as seleniarm docker images and webdriver arm versions.
203206

204207
### Android
205208

0 commit comments

Comments
 (0)