From 52c22990d443955b95dcc5eba405afae6fa4664a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 07:39:49 +0000 Subject: [PATCH 1/3] Initial plan From 4dfe41d0ce7278a9c6d4f275210d6ad94d4a7ea5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 07:42:05 +0000 Subject: [PATCH 2/3] refactor: centralize module testing Agent-Logs-Url: https://github.com/NethServer/ns8-kickstart/sessions/669e9cf5-11a4-4c54-8231-628f1d104c8f Co-authored-by: andre8244 <4612169+andre8244@users.noreply.github.com> --- .github/workflows/test-module.yml | 14 +++----- .gitignore | 2 ++ README.md | 9 ++--- test-module.sh | 36 ------------------- .../{kickstart.robot => 10__kickstart.robot} | 2 +- tests/15__ui.robot | 34 ++++++++++++++++++ 6 files changed, 44 insertions(+), 53 deletions(-) delete mode 100755 test-module.sh rename tests/{kickstart.robot => 10__kickstart.robot} (93%) create mode 100644 tests/15__ui.robot diff --git a/.github/workflows/test-module.yml b/.github/workflows/test-module.yml index e079fd3..2490444 100644 --- a/.github/workflows/test-module.yml +++ b/.github/workflows/test-module.yml @@ -12,15 +12,11 @@ on: types: [completed] jobs: - module: - if: ${{ github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == '' }} - uses: NethServer/ns8-github-actions/.github/workflows/module-info.yml@v1 - run_tests: - needs: module - uses: NethServer/ns8-github-actions/.github/workflows/test-on-digitalocean-infra.yml@v1 + run: + name: "Run tests" + uses: NethServer/ns8-github-actions/.github/workflows/test-module.yml@v1 with: - args: "ghcr.io/${{needs.module.outputs.owner}}/${{needs.module.outputs.name}}:${{needs.module.outputs.tag}}" - repo_ref: ${{needs.module.outputs.sha}} - debug_shell: ${{ github.event.inputs.debug_shell == 'true' || false }} + ui_tests_strategy: on_renovate_ui_change + debug_shell: ${{ github.event.inputs.debug_shell == 'true' }} secrets: do_token: ${{ secrets.do_token }} diff --git a/.gitignore b/.gitignore index 6704566..d123a22 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,5 @@ dist # TernJS port file .tern-port + +tests/outputs/ diff --git a/README.md b/README.md index 449f151..23dc029 100644 --- a/README.md +++ b/README.md @@ -86,14 +86,9 @@ To uninstall the instance: remove-module --no-preserve kickstart1 -## Testing +## Running tests locally -Test the module using the `test-module.sh` script: - - - ./test-module.sh ghcr.io/nethserver/kickstart:latest - -The tests are made using [Robot Framework](https://robotframework.org/) +This module uses the NS8 standard testing infrastructure. For instructions on how to run the test suite locally, refer to the [Running tests locally](https://github.com/NethServer/ns8-github-actions/blob/v1/README.md#running-tests-locally) section of the ns8-github-actions README. ## UI translation diff --git a/test-module.sh b/test-module.sh deleted file mode 100755 index 17b4dba..0000000 --- a/test-module.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash - -# -# Copyright (C) 2023 Nethesis S.r.l. -# SPDX-License-Identifier: GPL-3.0-or-later -# - -LEADER_NODE=$1 -IMAGE_URL=$2 -SSH_KEYFILE=${SSH_KEYFILE:-$HOME/.ssh/id_rsa} - -ssh_key="$(cat $SSH_KEYFILE)" - -podman run -i \ - -v .:/home/pwuser/ns8-module:z \ - --name rf-core-runner ghcr.io/marketsquare/robotframework-browser/rfbrowser-stable:v10.0.3 \ - bash -l -s < /home/pwuser/ns8-key - set -x - pip install -r /home/pwuser/ns8-module/tests/pythonreq.txt - mkdir ~/outputs - cd /home/pwuser/ns8-module - robot -v NODE_ADDR:${LEADER_NODE} \ - -v IMAGE_URL:${IMAGE_URL} \ - -v SSH_KEYFILE:/home/pwuser/ns8-key \ - -d ~/outputs /home/pwuser/ns8-module/tests/ -EOF - -tests_res=$? - -podman cp rf-core-runner:/home/pwuser/outputs tests/ -podman stop rf-core-runner -podman rm rf-core-runner - -exit ${tests_res} diff --git a/tests/kickstart.robot b/tests/10__kickstart.robot similarity index 93% rename from tests/kickstart.robot rename to tests/10__kickstart.robot index e1984f0..e738112 100644 --- a/tests/kickstart.robot +++ b/tests/10__kickstart.robot @@ -7,7 +7,7 @@ Check if kickstart is installed correctly ... return_rc=True Should Be Equal As Integers ${rc} 0 &{output} = Evaluate ${output} - Set Suite Variable ${module_id} ${output.module_id} + Set Global Variable ${module_id} ${output.module_id} Check if kickstart can be configured ${rc} = Execute Command api-cli run module/${module_id}/configure-module --data '{}' diff --git a/tests/15__ui.robot b/tests/15__ui.robot new file mode 100644 index 0000000..e89ed75 --- /dev/null +++ b/tests/15__ui.robot @@ -0,0 +1,34 @@ +*** Settings *** +Library Browser + +*** Variables *** +${ADMIN_USER} admin +${ADMIN_PASSWORD} Nethesis,1234 +${module_id} ${EMPTY} + +*** Keywords *** + +Login to cluster-admin + New Page https://${NODE_ADDR}/cluster-admin/ + Fill Text text="Username" ${ADMIN_USER} + Click button >> text="Continue" + Fill Text text="Password" ${ADMIN_PASSWORD} + Click button >> text="Log in" + Wait For Elements State css=#main-content visible timeout=10s + +*** Test Cases *** + +Take screenshots + [Tags] ui + New Browser chromium headless=True + New Context ignoreHTTPSErrors=True + Login to cluster-admin + Go To https://${NODE_ADDR}/cluster-admin/#/apps/${module_id} + Wait For Elements State iframe >>> h2 >> text="Status" visible timeout=10s + Sleep 5s + Take Screenshot filename=${OUTPUT DIR}/browser/screenshot/1._Status.png + Go To https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}?page=settings + Wait For Elements State iframe >>> h2 >> text="Settings" visible timeout=10s + Sleep 5s + Take Screenshot filename=${OUTPUT DIR}/browser/screenshot/2._Settings.png + Close Browser From 991458596a12b14f7bccb3ee3d88dee2de2dea25 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 24 Apr 2026 08:10:56 +0000 Subject: [PATCH 3/3] refactor: rename 15__ui.robot to 20__ui.robot Agent-Logs-Url: https://github.com/NethServer/ns8-kickstart/sessions/2d6d15ed-501a-4b17-a311-ac98b3109e17 Co-authored-by: andre8244 <4612169+andre8244@users.noreply.github.com> --- tests/{15__ui.robot => 20__ui.robot} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename tests/{15__ui.robot => 20__ui.robot} (100%) diff --git a/tests/15__ui.robot b/tests/20__ui.robot similarity index 100% rename from tests/15__ui.robot rename to tests/20__ui.robot