diff --git a/Robot-Framework/resources/gui_keywords.resource b/Robot-Framework/resources/gui_keywords.resource index 50eeae7..75f4c3f 100644 --- a/Robot-Framework/resources/gui_keywords.resource +++ b/Robot-Framework/resources/gui_keywords.resource @@ -29,6 +29,8 @@ Log in via GUI Type string and press enter ${USER_PASSWORD} END Verify login + Log To Console Disabling automated lock and suspend + Execute Command systemctl --user stop swayidle Log out [Documentation] Log out and optionally verify that desktop is not available @@ -69,7 +71,6 @@ Locate image on screen IF $pass_status=='PASS' BREAK Sleep 0.5 END - Connect to VM ${GUI_VM} IF $pass_status=='FAIL' FAIL Image recognition failure: ${image_to_be_searched} Log To Console Coordinates: ${coordinates} ${mouse_x} Get From Dictionary ${coordinates} x @@ -79,6 +80,7 @@ Locate image on screen Locate and click [Arguments] ${image_to_be_searched} ${confidence}=0.99 ${iterations}=5 ${mouse_x} ${mouse_y} Locate image on screen ${image_to_be_searched} ${confidence} + Connect to VM ${GUI_VM} Execute Command ydotool mousemove --absolute -x ${mouse_x} -y ${mouse_y} sudo=True sudo_password=${PASSWORD} Execute Command ydotool click 0xC0 sudo=True sudo_password=${PASSWORD} diff --git a/Robot-Framework/test-suites/bat-tests/__init__.robot b/Robot-Framework/test-suites/bat-tests/__init__.robot index 85e4fb2..b55feae 100644 --- a/Robot-Framework/test-suites/bat-tests/__init__.robot +++ b/Robot-Framework/test-suites/bat-tests/__init__.robot @@ -7,6 +7,7 @@ Resource ../../resources/ssh_keywords.resource Resource ../../resources/serial_keywords.resource Resource ../../resources/common_keywords.resource Resource ../../resources/connection_keywords.resource +Resource ../../resources/gui_keywords.resource Suite Setup BAT tests setup Suite Teardown BAT tests teardown @@ -21,14 +22,16 @@ BAT tests setup Connect to VM ${GUI_VM} Save most common icons and paths to icons Create test user - GUI Log in + Log in via GUI END + Switch Connection ${CONNECTION} BAT tests teardown - Connect to ghaf host + ${connection} Connect + Set Global Variable ${CONNECTION} ${connection} Log journctl IF "Lenovo" in "${DEVICE}" Connect to netvm - GUI Log out + Log out END - Close All Connections \ No newline at end of file + Close All Connections diff --git a/Robot-Framework/test-suites/bat-tests/apps.robot b/Robot-Framework/test-suites/bat-tests/apps.robot index 74b6d8a..de245a5 100644 --- a/Robot-Framework/test-suites/bat-tests/apps.robot +++ b/Robot-Framework/test-suites/bat-tests/apps.robot @@ -7,7 +7,7 @@ Force Tags apps Resource ../../resources/ssh_keywords.resource Resource ../../config/variables.robot Resource ../../resources/common_keywords.resource -Test Setup Run Keywords Move cursor AND Switch Connection ${CONNECTION} +Suite Teardown Close All Connections *** Variables *** diff --git a/Robot-Framework/test-suites/bat-tests/business_vm.robot b/Robot-Framework/test-suites/bat-tests/business_vm.robot index d802f26..f497d74 100644 --- a/Robot-Framework/test-suites/bat-tests/business_vm.robot +++ b/Robot-Framework/test-suites/bat-tests/business_vm.robot @@ -8,6 +8,8 @@ Resource ../../resources/ssh_keywords.resource Resource ../../resources/virtualization_keywords.resource Resource ../../config/variables.robot Resource ../../resources/common_keywords.resource +Suite Setup Connect to netvm +Suite Teardown Close All Connections Test Setup Move cursor Test Teardown Kill process @{APP_PIDS} @@ -17,7 +19,6 @@ Test Teardown Kill process @{APP_PIDS} Start Microsoft Outlook on LenovoX1 [Documentation] Start Microsoft Outlook in Business-vm and verify process started [Tags] outlook SP-T176 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Microsoft Outlook" Connect to VM ${BUSINESS_VM} @@ -26,7 +27,6 @@ Start Microsoft Outlook on LenovoX1 Start Microsoft 365 on LenovoX1 [Documentation] Start Microsoft 365 in Business-vm and verify process started [Tags] microsoft365 SP-T178 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Microsoft 365" Connect to VM ${BUSINESS_VM} @@ -35,7 +35,6 @@ Start Microsoft 365 on LenovoX1 Start Microsoft Teams on LenovoX1 [Documentation] Start Microsoft Teams in Business-vm and verify process started [Tags] teams SP-T177 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application Teams Connect to VM ${BUSINESS_VM} @@ -44,7 +43,6 @@ Start Microsoft Teams on LenovoX1 Start Trusted Browser on LenovoX1 [Documentation] Start Trusted Browser in Business-vm and verify process started [Tags] trusted_browser SP-T179 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Trusted Browser" Connect to VM ${BUSINESS_VM} @@ -53,7 +51,6 @@ Start Trusted Browser on LenovoX1 Start Video Editor on LenovoX1 [Documentation] Start Video Editor in Business-vm and verify process started [Tags] video_editor SP-T244 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Video Editor" Connect to VM ${BUSINESS_VM} @@ -62,7 +59,6 @@ Start Video Editor on LenovoX1 Start Text Editor on LenovoX1 [Documentation] Start Text Editor in Business-vm and verify process started [Tags] text_editor SP-T243 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Text Editor" Connect to VM ${BUSINESS_VM} @@ -71,7 +67,6 @@ Start Text Editor on LenovoX1 Start Xarchiver on LenovoX1 [Documentation] Start Xarchiver in Business-vm and verify process started [Tags] xarchiver SP-T242 - Connect to netvm Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Start XDG application "Xarchiver" Connect to VM ${BUSINESS_VM} diff --git a/Robot-Framework/test-suites/logging-tests/check_logs.robot b/Robot-Framework/test-suites/bat-tests/check_logs.robot similarity index 94% rename from Robot-Framework/test-suites/logging-tests/check_logs.robot rename to Robot-Framework/test-suites/bat-tests/check_logs.robot index 3610dde..a040880 100644 --- a/Robot-Framework/test-suites/logging-tests/check_logs.robot +++ b/Robot-Framework/test-suites/bat-tests/check_logs.robot @@ -3,12 +3,12 @@ *** Settings *** Documentation Testing logging -Force Tags logging lenovo-x1 +Force Tags bat logging lenovo-x1 Resource ../../config/variables.robot Resource ../../resources/ssh_keywords.resource Resource ../../resources/connection_keywords.resource Library DateTime -Suite Setup Set Variables ${DEVICE} +Suite Setup Connect to netvm Suite Teardown Close All Connections @@ -21,7 +21,6 @@ ${GRAFANA_LOGS} https://loki.ghaflogs.vedenemo.dev Check Grafana logs [Documentation] Check that all virtual machines are sending logs to Grafana [Tags] SP-T172 - [Setup] Connect to netvm [Teardown] Remove Wifi configuration ${TEST_WIFI_SSID} Configure wifi ${NETVM_SSH} ${TEST_WIFI_SSID} ${TEST_WIFI_PSWD} Check Internet Connection diff --git a/Robot-Framework/test-suites/bat-tests/gui-vm.robot b/Robot-Framework/test-suites/bat-tests/gui-vm.robot index 696a86e..ab59d97 100644 --- a/Robot-Framework/test-suites/bat-tests/gui-vm.robot +++ b/Robot-Framework/test-suites/bat-tests/gui-vm.robot @@ -7,8 +7,10 @@ Force Tags gui-vm-apps bat lenovo-x1 Resource ../../resources/ssh_keywords.resource Resource ../../config/variables.robot Resource ../../resources/common_keywords.resource -Test Setup Run Keywords Connect to netvm AND Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} +Test Setup Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} Test Teardown Gui-vm apps teardown +Suite Setup Connect to netvm +Suite Teardown Close All Connections *** Variables *** @@ -56,9 +58,8 @@ Start File Manager on LenovoX1 *** Keywords *** Gui-vm apps teardown - Connect to VM ${GUI_VM} + Move cursor Kill process @{APP_PIDS} - Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} - ${app_log} Execute command cat output.log + # Connect to VM ${GUI_VM} ${USER_LOGIN} ${USER_PASSWORD} + ${app_log} Execute command cat /tmp/output.log Log ${app_log} - Move cursor diff --git a/Robot-Framework/test-suites/bat-tests/timesync.robot b/Robot-Framework/test-suites/bat-tests/timesync.robot index 506d27b..e80ff03 100644 --- a/Robot-Framework/test-suites/bat-tests/timesync.robot +++ b/Robot-Framework/test-suites/bat-tests/timesync.robot @@ -3,6 +3,7 @@ *** Settings *** Documentation Testing time synchronization +Force Tags bat timesync Resource ../../resources/ssh_keywords.resource Resource ../../config/variables.robot Library ../../lib/TimeLibrary.py @@ -19,7 +20,7 @@ ${change_time} ${EMPTY} Time synchronization [Documentation] Stop timesyncd, change time on ghaf host and check that time was changed ... Start timesyncd and check that time was synchronized - [Tags] bat SP-T97 nuc orin-agx orin-nx riscv + [Tags] SP-T97 nuc orin-agx orin-nx riscv lenovo-x1 ${host} Connect Check that time is correct timezone=UTC diff --git a/Robot-Framework/test-suites/video-tests/video.robot b/Robot-Framework/test-suites/bat-tests/video.robot similarity index 98% rename from Robot-Framework/test-suites/video-tests/video.robot rename to Robot-Framework/test-suites/bat-tests/video.robot index e48b711..2a8b6cb 100644 --- a/Robot-Framework/test-suites/video-tests/video.robot +++ b/Robot-Framework/test-suites/bat-tests/video.robot @@ -3,7 +3,7 @@ *** Settings *** Documentation Testing camera application -Force Tags video lenovo-x1 +Force Tags bat video lenovo-x1 Resource ../../__framework__.resource Resource ../../resources/serial_keywords.resource Resource ../../resources/common_keywords.resource