Skip to content

Commit

Permalink
Merge pull request #286 from NiceProjectPoland/Test-#199-for-Issue-#49
Browse files Browse the repository at this point in the history
Test Cases for Issue #49 - Verify if Manager/Agent/Reporter runs with existing/without ini file from current/past version. GUI/NO GUI.
Issue #199
  • Loading branch information
damies13 authored Aug 12, 2024
2 parents 5ce2eb0 + a292120 commit 2e07629
Show file tree
Hide file tree
Showing 8 changed files with 363 additions and 3 deletions.
65 changes: 64 additions & 1 deletion Tests/Regression/Agent/CommandLine_Bugs.robot
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Exclude Libraries With Spaces
Should Be True ${result[0][0]} > 0
Should Be Equal As Numbers ${result[0][0]} 4


Run agent with -x (xml mode)
[Tags] ubuntu-latest windows-latest macos-latest Issue #180
Log To Console ${\n}TAGS: ${TEST TAGS}
Expand Down Expand Up @@ -72,3 +71,67 @@ Check If The Not Buildin Modules Are Included In The Agent Setup File
... Should Contain ${requires} ${i}
... msg="Some modules are not in Agent setup file"
END

Verify If Agent Runs With Existing INI File From Current Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Agent Default Save Path
Run Agent
Sleep 5
${running}= Is Process Running ${process_agent}
IF ${running}
${result}= Terminate Process ${process_agent}
ELSE
Fail msg=Agest is not running!
END

File Should Exist ${location}${/}RFSwarmAgent.ini
File Should Not Be Empty ${location}${/}RFSwarmAgent.ini
Log To Console Running Agent with existing ini file.

Run Agent
Sleep 5
${running}= Is Process Running ${process_agent}
IF ${running}
${result}= Terminate Process ${process_agent}
ELSE
Fail msg=Agest is not running!
END

Verify If Agent Runs With No Existing INI File From Current Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Agent Default Save Path
Remove File ${location}${/}RFSwarmAgent.ini
File Should Not Exist ${location}${/}RFSwarmAgent.ini
Log To Console Running Agent with no existing ini file.

Run Agent
Sleep 5
${running}= Is Process Running ${process_agent}
IF ${running}
${result}= Terminate Process ${process_agent}
ELSE
Fail msg=Agest is not running!
END

Verify If Agent Runs With Existing INI File From Previous Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Agent Default Save Path
Remove File ${location}${/}RFSwarmAgent.ini
File Should Not Exist ${location}${/}RFSwarmAgent.ini
${v1_0_0_inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#49${/}v1_0_0${/}RFSwarmAgent.ini
Copy File ${v1_0_0_inifile} ${location}
File Should Exist ${location}${/}RFSwarmAgent.ini
File Should Not Be Empty ${location}${/}RFSwarmAgent.ini
Log To Console Running Agent with existing ini file.

Run Agent
Sleep 5
${running}= Is Process Running ${process_agent}
IF ${running}
${result}= Terminate Process ${process_agent}
ELSE
Fail msg=Agest is not running!
END
13 changes: 13 additions & 0 deletions Tests/Regression/Agent/CommandLine_Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,17 @@ Get Install Requires From Setup File

RETURN ${refactored_requires}

Get Agent PIP Data
Run Process pip show rfswarm-agent alias=data
${pip_data} Get Process Result data
Should Not Be Empty ${pip_data.stdout} msg=Agent must be installed with pip
Log ${pip_data.stdout}
RETURN ${pip_data.stdout}

Get Agent Default Save Path
${pip_data}= Get Agent PIP Data
${pip_data_list}= Split String ${pip_data}
${i}= Get Index From List ${pip_data_list} Location:
${location}= Set Variable ${pip_data_list}[${i + 1}]
RETURN ${location}${/}rfswarm_agent${/}
#
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[Agent]
agentname =
agentdir =
xmlmode = False
excludelibraries = BuiltIn,String,OperatingSystem,perftest
properties =
swarmmanager = http://localhost:8138/

137 changes: 137 additions & 0 deletions Tests/Regression/Manager/GUI_Bugs.robot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,144 @@
Resource GUI_Common.robot
Suite Setup Set Platform

*** Variables ***
@{robot_data}= example.robot Example Test Case
${scenario_name}= test_scenario

*** Test Cases ***
Verify If Manager Runs With Existing INI File From Current Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Run Keywords
... Set Global Filename And Default Save Path ${robot_data}[0] AND
... Open Manager GUI AND
... Run Keyword Close Manager GUI ${platform}

File Should Exist ${global_path}${/}RFSwarmManager.ini
File Should Not Be Empty ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with existing ini file.
Open Manager GUI
TRY
Click Tab Run
Wait For manager_${platform}_button_stoprun.png timeout=30
Click Tab Plan
EXCEPT
Fail msg=RFSwarm Manager is not responding!
END
Run Keyword Close Manager GUI ${platform}

Verify If Manager Runs With No Existing INI File From Current Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Set Global Filename And Default Save Path ${robot_data}[0]

Remove File ${global_path}${/}RFSwarmManager.ini
File Should Not Exist ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with no existing ini file.
Open Manager GUI
TRY
Click Tab Run
Wait For manager_${platform}_button_stoprun.png timeout=30
Click Tab Plan
EXCEPT
Fail msg=RFSwarm Manager is not responding!
END
Run Keyword Close Manager GUI ${platform}

Verify If Manager Runs With Existing INI File From Previous Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Set Global Filename And Default Save Path ${robot_data}[0]

Remove File ${global_path}${/}RFSwarmManager.ini
File Should Not Exist ${global_path}${/}RFSwarmManager.ini
${v1_0_0_inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#49${/}v1_0_0${/}RFSwarmManager.ini
Copy File ${v1_0_0_inifile} ${global_path}
File Should Exist ${global_path}${/}RFSwarmManager.ini
File Should Not Be Empty ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with existing ini file.
Open Manager GUI
TRY
Click Tab Run
Wait For manager_${platform}_button_stoprun.png timeout=30
Click Tab Plan
EXCEPT
Fail msg=RFSwarm Manager is not responding!
END
Run Keyword Close Manager GUI ${platform}

Verify If Manager Runs With Existing INI File From Current Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Set Global Filename And Default Save Path ${robot_data}[0]

@{mngr_options} Create List -n

Open Manager GUI ${mngr_options}
${running}= Is Process Running ${process_manager}
IF not ${running}
Fail msg=Manager is not running!
END
${result} = Terminate Process ${process_manager}
${running}= Is Process Running ${process_manager}
IF ${running}
Fail msg=Manager did not close!
END

File Should Exist ${global_path}${/}RFSwarmManager.ini
File Should Not Be Empty ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with existing ini file.
Open Manager GUI ${mngr_options}
${running}= Is Process Running ${process_manager}
IF not ${running}
Fail msg=Manager is not running!
END
${result} = Terminate Process ${process_manager}
${running}= Is Process Running ${process_manager}
IF ${running}
Fail msg=Manager did not close!
END

Verify If Manager Runs With No Existing INI File From Current Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Set Global Filename And Default Save Path ${robot_data}[0]

@{mngr_options} Create List -n
Remove File ${global_path}${/}RFSwarmManager.ini
File Should Not Exist ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with no existing ini file.

Open Manager GUI ${mngr_options}
${running}= Is Process Running ${process_manager}
IF not ${running}
Fail msg=Manager is not running!
END
${result} = Terminate Process ${process_manager}
${running}= Is Process Running ${process_manager}
IF ${running}
Fail msg=Manager did not close!
END

Verify If Manager Runs With Existing INI File From Previous Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Set Global Filename And Default Save Path ${robot_data}[0]

@{mngr_options} Create List -n
Remove File ${global_path}${/}RFSwarmManager.ini
File Should Not Exist ${global_path}${/}RFSwarmManager.ini
${v1_0_0_inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#49${/}v1_0_0${/}RFSwarmManager.ini
Copy File ${v1_0_0_inifile} ${global_path}
File Should Exist ${global_path}${/}RFSwarmManager.ini
File Should Not Be Empty ${global_path}${/}RFSwarmManager.ini
Log To Console Running Manager with existing ini file.

Open Manager GUI ${mngr_options}
${running}= Is Process Running ${process_manager}
IF not ${running}
Fail msg=Manager is not running!
END
${result} = Terminate Process ${process_manager}
${running}= Is Process Running ${process_manager}
IF ${running}
Fail msg=Manager did not close!
END

# # Test for Issue #171 moved to agent test suite, can easily be tested for via the command line
# Issue #171
# [Tags] ubuntu-latest windows-latest macos-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[GUI]
win_width = 800
win_height = 390
graph_list =

[Plan]
scriptdir =
scenariodir =
scenariofile =

[Run]
resultsdir =
display_index = False
display_iteration = False
display_sequence = False
display_percentile = 90

[Server]
bindip =
bindport = 8138

112 changes: 110 additions & 2 deletions Tests/Regression/Reporter/GUI_Bugs.robot
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,108 @@ Library XML use_lxml=True
Test Teardown Close GUI

*** Test Cases ***
Verify If Reporter Runs With Existing INI File From Current Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
[Setup] Run Keywords
... Open GUI AND
... Sleep 5 AND
... Close GUI

${location}= Get Reporter Default Save Path
File Should Exist ${location}${/}RFSwarmReporter.ini
File Should Not Be Empty ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with existing ini file.
Open GUI
TRY
Sleep 10
Click Section test_result_summary
Click #double click needed. Maybe delete after eel module implemetation
Wait For reporter_${platform}_option_datatable.png timeout=${30}
EXCEPT
Fail msg=Reporter is not responding!
END

Verify If Reporter Runs With No Existing INI File From Current Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Reporter Default Save Path
Remove File ${location}${/}RFSwarmReporter.ini
File Should Not Exist ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with no existing ini file.
Open GUI
TRY
Sleep 10
Click Section test_result_summary
Click #double click needed. Maybe delete after eel module implemetation
Wait For reporter_${platform}_option_datatable.png timeout=${30}
EXCEPT
Fail msg=Reporter is not responding!
END

Verify If Reporter Runs With Existing INI File From Previous Version
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Reporter Default Save Path
Remove File ${location}${/}RFSwarmReporter.ini
File Should Not Exist ${location}${/}RFSwarmReporter.ini
${v1_0_0_inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#49${/}v1_0_0${/}RFSwarmReporter.ini
Copy File ${v1_0_0_inifile} ${location}
File Should Exist ${location}${/}RFSwarmReporter.ini
File Should Not Be Empty ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with existing ini file.
Open GUI
TRY
Sleep 10
Click Section test_result_summary
Click #double click needed. Maybe delete after eel module implemetation
Wait For reporter_${platform}_option_datatable.png timeout=${30}
EXCEPT
Fail msg=Reporter is not responding!
END

Verify If Reporter Runs With Existing INI File From Current Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Reporter Default Save Path
Open GUI -n
${result}= Wait For Process ${process} timeout=60
Check Result ${result}

File Should Exist ${location}${/}RFSwarmReporter.ini
File Should Not Be Empty ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with existing ini file.
Open GUI -n
${result}= Wait For Process ${process} timeout=60
Check Result ${result}

Verify If Reporter Runs With No Existing INI File From Current Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Reporter Default Save Path
Remove File ${location}${/}RFSwarmReporter.ini
File Should Not Exist ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with no existing ini file.

Open GUI -n
${result}= Wait For Process ${process} timeout=60
Check Result ${result}

Verify If Reporter Runs With Existing INI File From Previous Version NO GUI
[Tags] windows-latest ubuntu-latest macos-latest Issue #49
${location}= Get Reporter Default Save Path
Remove File ${location}${/}RFSwarmReporter.ini
File Should Not Exist ${location}${/}RFSwarmReporter.ini
${v1_0_0_inifile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#49${/}v1_0_0${/}RFSwarmReporter.ini
Copy File ${v1_0_0_inifile} ${location}
File Should Exist ${location}${/}RFSwarmReporter.ini
File Should Not Be Empty ${location}${/}RFSwarmReporter.ini
Log To Console Running Reporter with existing ini file.

Open GUI -n
${result}= Wait For Process ${process} timeout=60
Check Result ${result}

First Run
[Tags] ubuntu-latest macos-latest windows-latest Issue #147
Log To Console ${\n}TAGS: ${TEST TAGS}
Expand All @@ -25,8 +127,14 @@ First Run
New Data Table Section
[Tags] ubuntu-latest macos-latest windows-latest Issue #149 Issue #150
Log To Console ${\n}TAGS: ${TEST TAGS}
Open GUI
Wait For Status PreviewLoaded
${testdata}= Set Variable Issue-#147
${resultdata}= Set Variable 20230320_185055_demo
${basefolder}= Set Variable ${CURDIR}${/}testdata${/}${testdata}
Should Exist ${basefolder}
Log to console basefolder: ${basefolder} console=True
${resultfolder}= Set Variable ${basefolder}${/}${resultdata}
Open GUI -d ${resultfolder}
Run Keyword And Continue On Failure Wait For Status PreviewLoaded
# Click Section toc
# This should click Report
Click Section Report
Expand Down
Binary file not shown.
Loading

0 comments on commit 2e07629

Please sign in to comment.