Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .github/workflows/test-module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,5 @@ dist

# TernJS port file
.tern-port

tests/outputs/
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,9 @@ To uninstall the instance:

remove-module --no-preserve imapsync1

## Testing
## Running tests locally

Test the module using the `test-module.sh` script:


./test-module.sh <NODE_ADDR> ghcr.io/nethserver/imapsync: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 repository.

## UI translation

Expand Down
49 changes: 0 additions & 49 deletions test-module.sh

This file was deleted.

34 changes: 34 additions & 0 deletions tests/30_ui.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
*** Settings ***
Library Browser

*** Variables ***
${ADMIN_USER} admin
${ADMIN_PASSWORD} Nethesis,1234
${imapsync_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/${imapsync_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/${imapsync_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
2 changes: 0 additions & 2 deletions tests/pythonreq.txt

This file was deleted.

Loading