Skip to content

Commit

Permalink
First attempt at test case for Issue #171
Browse files Browse the repository at this point in the history
  • Loading branch information
damies13 committed Feb 14, 2024
1 parent 48f58cd commit aa34051
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Tests/Regression/Manager/GUI_Bugs.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
*** Settings ***
Resource GUI_Common.robot

*** Test Cases ***
Issue #171
[Tags] ubuntu-latest windows-latest macos-latest
Open Agent
Open Manager GUI
Click Tab Agents
Sleep 5
Take A Screenshot

Close Manager GUI
Stop Agent
89 changes: 89 additions & 0 deletions Tests/Regression/Manager/GUI_Common.robot
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
*** Settings ***
Library OperatingSystem
Library Process
Library String

Library ImageHorizonLibrary reference_folder=${IMAGE_DIR}

Suite Setup Set Platform

*** Variables ***
${IMAGE_DIR} ${CURDIR}/Images/file_method
${pyfile_manager} ${EXECDIR}${/}rfswarm_manager${/}rfswarm.py
${pyfile_agent} ${EXECDIR}${/}rfswarm_agent${/}rfswarm_agent.py
${process_manager} None
${process_agent} None

*** Keywords ***
Set Platform
[Tags] macos-latest
Set Suite Variable ${platform} macos

Set Platform
[Tags] windows-latest
Set Suite Variable ${platform} windows

Set Platform
[Tags] ubuntu-latest
Set Suite Variable ${platform} ubuntu

Open Agent
[Arguments] ${options}
${process}= Start Process python3 ${pyfile} alias=Agent stdout=${OUTPUT DIR}${/}stdout_agent.txt stderr=${OUTPUT DIR}${/}stderr_agent.txt
Set Test Variable $process_agent ${process}

Open Manager GUI
[Arguments] ${options}
Set Confidence 0.9
${process}= Start Process python3 ${pyfile} alias=Manager stdout=${OUTPUT DIR}${/}stdout_manager.txt stderr=${OUTPUT DIR}${/}stderr_manager.txt
Set Test Variable $process_manager ${process}
Sleep 10
Set Screenshot Folder ${OUTPUT DIR}
Take A Screenshot

Close Manager GUI
[Tags] windows-latest ubuntu-latest
Press Combination Key.esc
Press Combination x Key.ctrl
${result}= Wait For Process ${process_manager} timeout=60
${running}= Is Process Running ${process_manager}
IF not ${running}
Should Be Equal As Integers ${result.rc} 0
ELSE
Take A Screenshot
${result} = Terminate Process ${process_manager}
Fail
END

Close Manager GUI
[Tags] macos-latest
# Press Combination Key.esc
# Press Combination q Key.command
# Click Image manager_${platform}_menu_python3.png
Click Image manager_${platform}_button_closewindow.png
Take A Screenshot
${result}= Wait For Process ${process_manager} timeout=60
${running}= Is Process Running ${process_manager}
IF not ${running}
Should Be Equal As Integers ${result.rc} 0
ELSE
Take A Screenshot
${result} = Terminate Process ${process_manager}
Fail
END

Stop Agent
${result} = Terminate Process ${process_agent}
Should Be Equal As Integers ${result.rc} 0

Click Tab
[Arguments] ${tabname}
${tabnamel}= Convert To Lower Case ${tabname}
${img}= Set Variable manager_${platform}_tab_${tabnamel}.png
Log ${CURDIR}
Log ${IMAGE_DIR}
Wait For ${img} timeout=300
@{coordinates}= Locate ${img}
Click Image ${img}
Sleep 0.1
Take A Screenshot
Empty file.

0 comments on commit aa34051

Please sign in to comment.