Skip to content

Commit

Permalink
Fix bat init and disable suspend after login
Browse files Browse the repository at this point in the history
Signed-off-by: Samuli Leivo <[email protected]>
  • Loading branch information
leivos-unikie committed Jan 9, 2025
1 parent 40f98d2 commit 258be77
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion Robot-Framework/resources/gui_keywords.resource
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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}

Expand Down
6 changes: 4 additions & 2 deletions Robot-Framework/test-suites/bat-tests/__init__.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -21,14 +22,15 @@ 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
Log journctl
IF "Lenovo" in "${DEVICE}"
Connect to netvm
GUI Log out
Log out
END
Close All Connections
2 changes: 1 addition & 1 deletion Robot-Framework/test-suites/bat-tests/apps.robot
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***
Expand Down

0 comments on commit 258be77

Please sign in to comment.