@@ -91,8 +91,8 @@ def do_behave_run(
91
91
if selected_tests [test_number ].get ():
92
92
full_run_command += " "
93
93
test_to_run = test
94
- if test .startswith ("(GROUP) " ):
95
- test_to_run = test .split ("(GROUP) " )[1 ]
94
+ if test .startswith ("(GROUP) " ):
95
+ test_to_run = test .split ("(GROUP) " )[1 ]
96
96
full_run_command += test_to_run .split (" => " )[0 ]
97
97
else :
98
98
full_run_command += test .split (" => " )[0 ]
@@ -108,6 +108,10 @@ def do_behave_run(
108
108
full_run_command += " -D rs"
109
109
elif "(-D rs -D crumbs)" in rs_string :
110
110
full_run_command += " -D rs -D crumbs"
111
+ elif "(-D rcs)" in rs_string :
112
+ full_run_command += " -D rcs"
113
+ elif "(-D rcs -D crumbs)" in rs_string :
114
+ full_run_command += " -D rcs -D crumbs"
111
115
112
116
if quiet_mode :
113
117
full_run_command += " --quiet"
@@ -173,7 +177,7 @@ def do_behave_run(
173
177
send_window_to_front (root )
174
178
175
179
176
- def create_tkinter_gui (tests , command_string ):
180
+ def create_tkinter_gui (tests , command_string , t_count , f_count , s_tests ):
177
181
root = tk .Tk ()
178
182
root .title ("SeleniumBase Behave Commander | GUI for Behave" )
179
183
root .minsize (820 , 656 )
@@ -193,8 +197,10 @@ def create_tkinter_gui(tests, command_string):
193
197
194
198
options_list = [
195
199
"New Session Per Test (Default)" ,
196
- "Reuse Session for all tests (-D rs)" ,
197
- "Reuse Session / clear cookies (-D rs -D crumbs)" ,
200
+ "Reuse Session for ALL the tests (-D rs)" ,
201
+ "Reuse Session and clear cookies (-D rs -D crumbs)" ,
202
+ "Reuse Session in the SAME class/feature (-D rcs)" ,
203
+ "Reuse Session in class and clear cookies (-D rcs -D crumbs)" ,
198
204
]
199
205
rsx = tk .StringVar (root )
200
206
rsx .set (options_list [2 ])
@@ -239,13 +245,17 @@ def create_tkinter_gui(tests, command_string):
239
245
chk .pack ()
240
246
241
247
tk .Label (root , text = "" ).pack ()
248
+ plural = "s"
249
+ if f_count == 1 :
250
+ plural = ""
242
251
run_display = (
243
- "Select from %s tests : "
244
- "(If NO TESTS are selected, then ALL TESTS will run )"
245
- % len (tests )
252
+ "Select from %s rows (%s feature%s with %s scenarios) : "
253
+ "(All tests will run if none are selected )"
254
+ % ( len (tests ), f_count , plural , t_count )
246
255
)
247
- if len (tests ) == 1 :
248
- run_display = "Only ONE TEST was found: (Will run automatically)"
256
+ if t_count == 1 :
257
+ run_display = "Only ONE TEST was found and will be run:"
258
+ tests = s_tests
249
259
tk .Label (root , text = run_display , fg = "blue" ).pack ()
250
260
text_area = ScrolledText (
251
261
root , width = 100 , height = 12 , wrap = "word" , state = tk .DISABLED
@@ -399,6 +409,7 @@ def main():
399
409
file_scenario_count = {}
400
410
f_count = 0
401
411
s_count = 0
412
+ t_count = 0
402
413
if is_windows :
403
414
output = output .decode ("latin1" )
404
415
else :
@@ -436,13 +447,14 @@ def main():
436
447
feature_name = feature_name .split (" # " )[- 1 ]
437
448
s_count = file_scenario_count [str (f_count )]
438
449
filename = filename .strip ()
439
- t_name = "(GROUP) %s => %s" % (filename , feature_name )
440
- t_name += " <> (%s Total)" % s_count
450
+ t_name = "(GROUP) %s => %s" % (filename , feature_name )
451
+ t_name += " <> (%s Total)" % s_count
441
452
f_tests .append (t_name )
442
453
elif (
443
454
row .startswith (" Scenario: " )
444
455
or row .startswith (" Scenario Outline: " )
445
456
):
457
+ t_count += 1
446
458
line_num = row .split (":" )[- 1 ]
447
459
scenario_name = None
448
460
if row .startswith (" Scenario: " ):
@@ -470,7 +482,7 @@ def main():
470
482
print (error_msg )
471
483
return
472
484
473
- create_tkinter_gui (tests , command_string )
485
+ create_tkinter_gui (tests , command_string , t_count , f_count , s_tests )
474
486
475
487
476
488
if __name__ == "__main__" :
0 commit comments