Skip to content

Commit af43452

Browse files
committed
ci: add UI test workflow for Renovate PRs (wip)
1 parent 4fa716d commit af43452

4 files changed

Lines changed: 38 additions & 14 deletions

File tree

.github/workflows/test-renovate-ui.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: Test UI on Renovate PRs
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
branches:
67
- main
8+
paths:
9+
- "ui/**"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
13+
cancel-in-progress: true
714

815
jobs:
916
check-author:
@@ -13,8 +20,10 @@ jobs:
1320
is_renovate: ${{ steps.check.outputs.is_renovate }}
1421
steps:
1522
- id: check
23+
env:
24+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
1625
run: |
17-
if [[ "${{ github.actor }}" == "renovate[bot]" ]]; then
26+
if [[ -z "$PR_AUTHOR" || "$PR_AUTHOR" == "renovate[bot]" ]]; then
1827
echo "is_renovate=true" >> "$GITHUB_OUTPUT"
1928
else
2029
echo "is_renovate=false" >> "$GITHUB_OUTPUT"
@@ -34,7 +43,7 @@ jobs:
3443
permissions: {}
3544
uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@v1
3645

37-
run_tests:
46+
run_ui_tests:
3847
needs: module
3948
permissions: {}
4049
uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@v1

ui/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,6 @@ pnpm-debug.log*
2121
*.njsproj
2222
*.sln
2323
*.sw?
24+
25+
# tests outputs
26+
tests/outputs

ui/test-ui.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
#
4-
# Copyright (C) 2023 Nethesis S.r.l.
4+
# Copyright (C) 2026 Nethesis S.r.l.
55
# SPDX-License-Identifier: GPL-3.0-or-later
66
#
77

ui/tests/test_ui.robot

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Suite Setup Connect to the node
55

66
*** Variables ***
77
${SSH_KEYFILE} %{HOME}/.ssh/id_ecdsa
8+
${ADMIN_USER} admin
9+
${ADMIN_PASSWORD} Nethesis,12345
810

911
*** Keywords ***
1012
Connect to the node
@@ -13,27 +15,37 @@ Connect to the node
1315
${output} = Execute Command systemctl is-system-running --wait
1416
Should Be True '${output}' == 'running' or '${output}' == 'degraded'
1517

18+
Login to cluster-admin
19+
New Page https://${NODE_ADDR}/cluster-admin/
20+
Fill Text text="Username" ${ADMIN_USER}
21+
Click button >> text="Continue"
22+
Fill Text text="Password" ${ADMIN_PASSWORD}
23+
Click button >> text="Log in"
24+
Wait For Elements State css=#main-content visible timeout=10s
25+
1626
*** Test Cases ***
17-
Install nethsecurity-controller module
27+
Install module
1828
${output} ${rc} = Execute Command add-module ${IMAGE_URL} 1
1929
... return_rc=True
2030
Should Be Equal As Integers ${rc} 0
2131
&{output} = Evaluate ${output}
2232
Set Suite Variable ${module_id} ${output.module_id}
2333

24-
Take screenshot of Status page
25-
New Browser chromium headless=True
26-
New Page https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}
27-
Take Screenshot filename=${OUTPUT DIR}/nethsecurity-controller-status.png
28-
Close Browser
29-
30-
Take screenshot of Settings page
34+
Take screenshots
3135
New Browser chromium headless=True
32-
New Page https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}?page=settings
33-
Take Screenshot filename=${OUTPUT DIR}/nethsecurity-controller-settings.png
36+
New Context ignoreHTTPSErrors=True
37+
Login to cluster-admin
38+
Go To https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}
39+
Wait For Elements State iframe >>> h2 >> text="Status" visible timeout=10s
40+
Sleep 5s
41+
Take Screenshot filename=${OUTPUT DIR}/browser/screenshot/status.png
42+
Go To https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}?page=settings
43+
Wait For Elements State iframe >>> h2 >> text="Settings" visible timeout=10s
44+
Sleep 5s
45+
Take Screenshot filename=${OUTPUT DIR}/browser/screenshot/settings.png
3446
Close Browser
3547

36-
Remove nethsecurity-controller module
48+
Remove module
3749
${rc} = Execute Command remove-module --no-preserve ${module_id}
3850
... return_rc=True return_stdout=False
3951
Should Be Equal As Integers ${rc} 0

0 commit comments

Comments
 (0)