Skip to content

Commit

Permalink
Merge pull request #266 from NiceProjectPoland/Test-#219-for-Issue-#126
Browse files Browse the repository at this point in the history
Test Cases for Issue #126 - Verify the field validation is working in the manager plan screen
Issue #219
  • Loading branch information
damies13 authored Jul 19, 2024
2 parents 92ede10 + b1343a2 commit 5fcc855
Show file tree
Hide file tree
Showing 26 changed files with 119 additions and 5 deletions.
41 changes: 40 additions & 1 deletion Tests/Regression/Manager/GUI_Features.robot
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,45 @@ Suite Setup Set Platform
${scenario_name}= test_scenario

*** Test Cases ***
Verify the Field Validation Is Working In the Manager Plan Screen
[Tags] windows-latest ubuntu-latest macos-latest Issue #126
[Setup] Run Keywords
... Set INI Window Size 1200 600 AND
... Set Global Filename And Default Save Path ${robot_data}[0] AND
... Open Manager GUI AND
... Create Robot File name=example.robot file_content=***Test Case***\nExample Test Case\n

@{scenario_names_list}= Create List robots rampup run test script all
&{expected_messages}= Create Dictionary
... robots=Index 1 has no Robots
... rampup=Index 1 Ramp Up is < 10 sec
... run=Index 1 Run is < 10 sec
... test=Index 1 has no Test
... script=Index 1 has no Script
... all=Index 1 has no Robots Index 1 Ramp Up is < 10 sec Index 1 Run is < 10 sec Index 1 has no Script Index 1 has no Test

FOR ${name} IN @{scenario_names_list}
${scenarioname}= Set Variable Issue-#126_${name}
${scenariofile}= Normalize Path ${CURDIR}${/}testdata${/}Issue-#126${/}${scenarioname}.rfs

Copy File ${scenariofile} ${global_path}
Click Button runopen
Open Scenario File OS DIALOG ${scenario_name}
Press key.enter 1 Times
Click Button runplay
Sleep 2
${status}= Run Keyword And Return Status
... Wait For ${platform}_warning_label_no_${name}.png timeout=${20}
Run Keyword If not ${status} Fail msg=Cant find waring label that says: ${expected_messages}[${name}].
Press key.enter 1 Times
Delete Scenario File ${scenario_name}

END

[Teardown] Run Keywords
... Delete Robot File ${robot_data}[0] AND
... Run Keyword Close Manager GUI ${platform}

Verify That Files Get Saved With Correct Extension And Names
[Tags] windows-latest ubuntu-latest macos-latest Issue #39
[Setup] Run Keywords
Expand All @@ -19,7 +58,7 @@ Verify That Files Get Saved With Correct Extension And Names
... Open Agent

${scenario_name}= Set Variable Issue-#39
Log To Console Files to check: scenario file, csv result files
Log To Console Files to check: scenario file, csv result files.
Click Button runsave
Save Scenario File OS DIALOG ${scenario_name}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_all.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 0
delay = 0
rampup = 0
run = 0
test =

13 changes: 13 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_rampup.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 1
delay = 0
rampup = 0
run = 10
test = Example Test Case
script = example.robot

13 changes: 13 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_robots.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 0
delay = 0
rampup = 10
run = 10
test = Example Test Case
script = example.robot

13 changes: 13 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_run.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 1
delay = 0
rampup = 10
run = 0
test = Example Test Case
script = example.robot

12 changes: 12 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_script.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 1
delay = 0
rampup = 10
run = 10
test = test

12 changes: 12 additions & 0 deletions Tests/Regression/Manager/testdata/Issue-#126/Issue-#126_test.rfs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Scenario]
uploadmode = err
scriptcount = 1
graphlist =

[1]
robots = 1
delay = 0
rampup = 10
run = 10
test =
script = example.robot
8 changes: 4 additions & 4 deletions rfswarm_manager/rfswarm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3189,7 +3189,7 @@ def Pre_Run_Checks(self, _event=None):
base.debugmsg(5, "grp", grp)
if "Index" in grp.keys():
if "Robots" not in grp.keys() or grp["Robots"] < 1:
warnings.append("Index {} has no Robots".format(grp["Index"]))
warnings.append("Index {} has no Robots.".format(grp["Index"]))

# RampUp < 10
if "RampUp" not in grp.keys() or grp["RampUp"] < 10:
Expand All @@ -3199,14 +3199,14 @@ def Pre_Run_Checks(self, _event=None):
warnings.append("Index {} Run is < 10 sec.".format(grp["Index"]))

if "Script" not in grp.keys() or len(grp["Script"]) < 1:
warnings.append("Index {} has no Script".format(grp["Index"]))
warnings.append("Index {} has no Script.".format(grp["Index"]))
else:
# ScriptHash
if "ScriptHash" not in grp.keys() or len(grp["ScriptHash"]) < 1:
warnings.append("Index {} Agents don't have Script yet".format(grp["Index"]))
warnings.append("Index {} Agents don't have Script yet.".format(grp["Index"]))

if "Test" not in grp.keys() or len(grp["Test"]) < 1:
warnings.append("Index {} has no Test".format(grp["Index"]))
warnings.append("Index {} has no Test.".format(grp["Index"]))

# warnings.append("Debuging : Don't Run")
return warnings
Expand Down

0 comments on commit 5fcc855

Please sign in to comment.