9
9
sbase install chromedriver
10
10
sbase methods
11
11
sbase options
12
+ sbase commander
12
13
sbase mkdir ui_tests
13
14
sbase mkfile new_test.py
14
15
sbase mkrec new_test.py
@@ -78,6 +79,7 @@ def show_basic_usage():
78
79
sc += " install [DRIVER] [OPTIONS]\n "
79
80
sc += " methods (List common Python methods)\n "
80
81
sc += " options (List common pytest options)\n "
82
+ sc += " commander / gui [OPTIONAL PATH or TEST FILE]\n "
81
83
sc += " mkdir [DIRECTORY] [OPTIONS]\n "
82
84
sc += " mkfile [FILE.py] [OPTIONS]\n "
83
85
sc += " mkrec / codegen [FILE.py] [OPTIONS]\n "
@@ -146,6 +148,28 @@ def show_install_usage():
146
148
print ("" )
147
149
148
150
151
+ def show_commander_usage ():
152
+ c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
153
+ c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
154
+ cr = colorama .Style .RESET_ALL
155
+ sc = " " + c2 + "** " + c3 + "commander" + c2 + " **" + cr
156
+ print (sc )
157
+ print ("" )
158
+ print (" Usage:" )
159
+ print (" seleniumbase commander [OPTIONAL PATH or TEST FILE]" )
160
+ print (" OR: sbase commander [OPTIONAL PATH or TEST FILE]" )
161
+ print (" OR: seleniumbase gui [OPTIONAL PATH or TEST FILE]" )
162
+ print (" OR: sbase gui [OPTIONAL PATH or TEST FILE]" )
163
+ print (" Examples:" )
164
+ print (" sbase gui" )
165
+ print (" sbase gui -k agent" )
166
+ print (" sbase gui examples/" )
167
+ print (" sbase gui test_suite.py" )
168
+ print (" Output:" )
169
+ print (" Launches SeleniumBase Commander | GUI for pytest." )
170
+ print ("" )
171
+
172
+
149
173
def show_mkdir_usage ():
150
174
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
151
175
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
@@ -250,6 +274,21 @@ def show_codegen_usage():
250
274
print ("" )
251
275
252
276
277
+ def show_recorder_usage ():
278
+ c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
279
+ c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
280
+ cr = colorama .Style .RESET_ALL
281
+ sc = " " + c2 + "** " + c3 + "recorder" + c2 + " **" + cr
282
+ print (sc )
283
+ print ("" )
284
+ print (" Usage:" )
285
+ print (" seleniumbase recorder" )
286
+ print (" OR: sbase recorder" )
287
+ print (" Output:" )
288
+ print (" Launches the SeleniumBase Recorder Desktop App." )
289
+ print ("" )
290
+
291
+
253
292
def show_mkpres_usage ():
254
293
c2 = colorama .Fore .BLUE + colorama .Back .LIGHTGREEN_EX
255
294
c3 = colorama .Fore .BLUE + colorama .Back .LIGHTYELLOW_EX
@@ -629,7 +668,8 @@ def show_methods():
629
668
sbm += "*.get_attribute(selector, attribute) => Get element attribute.\n "
630
669
sbm += "*.get_title() => Get the title of the current page.\n "
631
670
sbm += "*.switch_to_frame(frame) => Switch into the iframe container.\n "
632
- sbm += "*.switch_to_default_content() => Leave the iframe container.\n "
671
+ sbm += "*.switch_to_default_content() => Exit all iframe containers.\n "
672
+ sbm += "*.switch_to_parent_frame() => Exit from the current iframe.\n "
633
673
sbm += "*.open_new_window() => Open a new window in the same browser.\n "
634
674
sbm += "*.switch_to_window(window) => Switch to the browser window.\n "
635
675
sbm += "*.switch_to_default_window() => Switch to the original window.\n "
@@ -735,10 +775,12 @@ def show_detailed_help():
735
775
print (c6 + " " + c2 + " Commands: " + c6 + " " )
736
776
print (cr )
737
777
show_install_usage ()
778
+ show_commander_usage ()
738
779
show_mkdir_usage ()
739
780
show_mkfile_usage ()
740
781
show_mkrec_usage ()
741
782
show_codegen_usage ()
783
+ show_recorder_usage ()
742
784
show_mkpres_usage ()
743
785
show_mkchart_usage ()
744
786
show_convert_usage ()
@@ -779,6 +821,10 @@ def main():
779
821
else :
780
822
show_basic_usage ()
781
823
show_install_usage ()
824
+ elif command == "commander" or command == "gui" :
825
+ from seleniumbase .console_scripts import sb_commander
826
+
827
+ sb_commander .main ()
782
828
elif (
783
829
command == "recorder"
784
830
or (command == "record" and len (command_args ) == 0 )
@@ -960,6 +1006,14 @@ def main():
960
1006
print ("" )
961
1007
show_install_usage ()
962
1008
return
1009
+ elif command_args [0 ] == "commander" :
1010
+ print ("" )
1011
+ show_commander_usage ()
1012
+ return
1013
+ elif command_args [0 ] == "gui" :
1014
+ print ("" )
1015
+ show_commander_usage ()
1016
+ return
963
1017
elif command_args [0 ] == "mkdir" :
964
1018
print ("" )
965
1019
show_mkdir_usage ()
@@ -976,6 +1030,10 @@ def main():
976
1030
print ("" )
977
1031
show_codegen_usage ()
978
1032
return
1033
+ elif command_args [0 ] == "recorder" :
1034
+ print ("" )
1035
+ show_recorder_usage ()
1036
+ return
979
1037
elif command_args [0 ] == "mkpres" :
980
1038
print ("" )
981
1039
show_mkpres_usage ()
0 commit comments