Skip to content

Commit

Permalink
Add application tests
Browse files Browse the repository at this point in the history
Signed-off-by: Maarit Härkönen <[email protected]>
  • Loading branch information
maaharko committed Dec 4, 2024
1 parent 055c823 commit 6d55ed2
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 4 deletions.
9 changes: 9 additions & 0 deletions Robot-Framework/resources/ssh_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,18 @@ Start application
${path} Get App Path ${output} ${app_name}
Execute Command nohup sh -c '${path}' > output.log 2>&1 &

Check application name
[Documentation] Check written format of application
[Arguments] ${app_name}
${app_name} Strip String ${app_name} characters="'
${output} Execute Command ls /run/current-system/sw/share/applications/
${app} Get Regexp Matches ${output} (?im)${app_name}
RETURN '${app}[0]'

Start XDG application
[Arguments] ${app_name}
Log To Console ${\n}Starting ${app_name}
${app_name} Check application name ${app_name}
${output} Execute Command cat /run/current-system/sw/share/applications/${app_name}.desktop
${path} Get App Path From Desktop ${output}
Execute Command nohup sh -c '${path}' > output.log 2>&1 &
Expand Down
38 changes: 34 additions & 4 deletions Robot-Framework/test-suites/bat-tests/business_vm.robot
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Suite Teardown Close All Connections
*** Test Cases ***

Start Microsoft Outlook on LenovoX1
[Documentation] Start Microsoft Outlook in dedicated VM and verify process started
[Documentation] Start Microsoft Outlook in Business-vm and verify process started
[Tags] outlook SP-T176
Connect to netvm
Connect to VM ${GUI_VM}
Expand All @@ -25,7 +25,7 @@ Start Microsoft Outlook on LenovoX1
[Teardown] Kill process @{app_pids}

Start Microsoft 365 on LenovoX1
[Documentation] Start Microsoft 365 in dedicated VM and verify process started
[Documentation] Start Microsoft 365 in Business-vm and verify process started
[Tags] microsoft365 SP-T178
Connect to netvm
Connect to VM ${GUI_VM}
Expand All @@ -35,7 +35,7 @@ Start Microsoft 365 on LenovoX1
[Teardown] Kill process @{app_pids}

Start Microsoft Teams on LenovoX1
[Documentation] Start Microsoft Teams in dedicated VM and verify process started
[Documentation] Start Microsoft Teams in Business-vm and verify process started
[Tags] teams SP-T177
Connect to netvm
Connect to VM ${GUI_VM}
Expand All @@ -45,11 +45,41 @@ Start Microsoft Teams on LenovoX1
[Teardown] Kill process @{app_pids}

Start Trusted Browser on LenovoX1
[Documentation] Start Trusted Browser in dedicated VM and verify process started
[Documentation] Start Trusted Browser in Business-vm and verify process started
[Tags] trusted_browser SP-T179
Connect to netvm
Connect to VM ${GUI_VM}
Start XDG application "Trusted Browser"
Connect to VM ${BUSINESS_VM}
Check that the application was started chrome
[Teardown] Kill process @{app_pids}

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}
Start XDG application "Video Editor"
Connect to VM ${BUSINESS_VM}
Check that the application was started lossless
[Teardown] Kill process @{app_pids}

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}
Start XDG application "Text Editor"
Connect to VM ${BUSINESS_VM}
Check that the application was started text-editor
[Teardown] Kill process @{app_pids}

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}
Start XDG application "Xarchiver"
Connect to VM ${BUSINESS_VM}
Check that the application was started xarchiver
[Teardown] Kill process @{app_pids}
59 changes: 59 additions & 0 deletions Robot-Framework/test-suites/bat-tests/gui-vm.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# SPDX-FileCopyrightText: 2022-2024 Technology Innovation Institute (TII)
# SPDX-License-Identifier: Apache-2.0

*** Settings ***
Documentation Testing launching applications on gui-vm
Force Tags gui-vm-apps bat lenovo-x1
Resource ../../resources/ssh_keywords.resource
Resource ../../config/variables.robot
Resource ../../resources/common_keywords.resource
Suite Teardown Close All Connections
Test Setup Run Keywords Connect to netvm AND Connect to VM ${GUI_VM}


*** Variables ***
@{app_pids} ${EMPTY}


*** Test Case ***
Start Calculator on LenovoX1
[Documentation] Start Calculator and verify process started
[Tags] calculator SP-T202
Start XDG application Calculator
Check that the application was started calculator
[Teardown] Kill process @{app_pids}

Start Sticky Notes on LenovoX1
[Documentation] Start Sticky Notes and verify process started
[Tags] sticky_notes SP-T201
Start XDG application 'Sticky Notes'
Check that the application was started sticky-wrapped
[Teardown] Kill process @{app_pids}

Start Control Panel on LenovoX1
[Documentation] Start Control Panel and verify process started
[Tags] control_panel SP-T205
Start XDG application 'Control Panel'
Check that the application was started ctrl-panel
[Teardown] Kill process @{app_pids}

Start Bluetooth Settings on LenovoX1
[Documentation] Start Bluetooth Settings and verify process started
[Tags] bluetooth_settings SP-T204
Start XDG application 'Bluetooth Settings'
Check that the application was started bt-launcher
[Teardown] Kill process @{app_pids}

Start Audio Control on LenovoX1
[Documentation] Start Audio Control and verify process started
[Tags] audio_control SP-T203
Start XDG application 'Audio Control'
Check that the application was started audio-control
[Teardown] Kill process @{app_pids}

Start File Manager on LenovoX1
[Documentation] Start File Manager and verify process started
[Tags] file_manager SP-T206
Start XDG application 'File Manager'
Check that the application was started pcmanfm
[Teardown] Kill process @{app_pids}

0 comments on commit 6d55ed2

Please sign in to comment.