diff --git a/.github/workflows/test-module.yml b/.github/workflows/test-module.yml index b161d25..aebbf5d 100644 --- a/.github/workflows/test-module.yml +++ b/.github/workflows/test-module.yml @@ -22,6 +22,6 @@ jobs: statuses: write uses: NethServer/ns8-github-actions/.github/workflows/test-module-qemu.yml@v1 with: - ui_tests_strategy: never + ui_tests_strategy: on_renovate_ui_change debug_shell: ${{ github.event.inputs.debug_shell == 'true' }} # Other inputs: https://github.com/NethServer/ns8-github-actions/blob/v1/docs/test-module-qemu.md#inputs diff --git a/tests/wordpress.robot b/tests/wordpress.robot index c717d6c..a730a28 100644 --- a/tests/wordpress.robot +++ b/tests/wordpress.robot @@ -2,6 +2,10 @@ Library SSHLibrary Resource api.resource +*** Variables *** +${ADMIN_USER} admin +${ADMIN_PASSWORD} Nethesis,1234 + *** Test Cases *** Check if wordpress is installed correctly ${output} ${rc} = Execute Command add-module ${IMAGE_URL} 1 @@ -27,12 +31,40 @@ Check postgresql path is configured Check if wordpress works as expected Wait Until Keyword Succeeds 20 times 3 seconds Ping wordpress +Take screenshots + [Tags] ui + Import Library Browser + 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 + Go To https://${NODE_ADDR}/cluster-admin/#/apps/${module_id}?page=about + Wait For Elements State iframe >>> h2 >> text="About" visible timeout=10s + Sleep 5s + Take Screenshot filename=${OUTPUT DIR}/browser/screenshot/3._About.png + Close Browser + Check if wordpress is removed correctly ${rc} = Execute Command remove-module --no-preserve ${module_id} ... return_rc=True return_stdout=False Should Be Equal As Integers ${rc} 0 *** 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 + Ping wordpress ${out} ${err} ${rc} = Execute Command curl -k -f -H 'Host: wordpress.domain.org' https://127.0.0.1/wp-admin/install.php ... return_rc=True return_stdout=True return_stderr=True