-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First attempt at test case for Issue #171
- Loading branch information
Showing
3 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.