seleniumbase 4.24.10__py3-none-any.whl → 4.33.15__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. sbase/__init__.py +1 -0
  2. sbase/steps.py +7 -0
  3. seleniumbase/__init__.py +16 -7
  4. seleniumbase/__version__.py +1 -1
  5. seleniumbase/behave/behave_sb.py +97 -32
  6. seleniumbase/common/decorators.py +16 -7
  7. seleniumbase/config/proxy_list.py +3 -3
  8. seleniumbase/config/settings.py +4 -0
  9. seleniumbase/console_scripts/logo_helper.py +47 -8
  10. seleniumbase/console_scripts/run.py +345 -335
  11. seleniumbase/console_scripts/sb_behave_gui.py +5 -12
  12. seleniumbase/console_scripts/sb_caseplans.py +6 -13
  13. seleniumbase/console_scripts/sb_commander.py +5 -12
  14. seleniumbase/console_scripts/sb_install.py +62 -54
  15. seleniumbase/console_scripts/sb_mkchart.py +13 -20
  16. seleniumbase/console_scripts/sb_mkdir.py +11 -17
  17. seleniumbase/console_scripts/sb_mkfile.py +69 -43
  18. seleniumbase/console_scripts/sb_mkpres.py +13 -20
  19. seleniumbase/console_scripts/sb_mkrec.py +88 -21
  20. seleniumbase/console_scripts/sb_objectify.py +30 -30
  21. seleniumbase/console_scripts/sb_print.py +5 -12
  22. seleniumbase/console_scripts/sb_recorder.py +16 -11
  23. seleniumbase/core/browser_launcher.py +1658 -221
  24. seleniumbase/core/detect_b_ver.py +7 -8
  25. seleniumbase/core/log_helper.py +42 -27
  26. seleniumbase/core/mysql.py +1 -4
  27. seleniumbase/core/proxy_helper.py +35 -30
  28. seleniumbase/core/recorder_helper.py +24 -5
  29. seleniumbase/core/sb_cdp.py +1951 -0
  30. seleniumbase/core/sb_driver.py +162 -8
  31. seleniumbase/core/settings_parser.py +6 -0
  32. seleniumbase/core/style_sheet.py +10 -0
  33. seleniumbase/extensions/recorder.zip +0 -0
  34. seleniumbase/fixtures/base_case.py +1234 -632
  35. seleniumbase/fixtures/constants.py +10 -1
  36. seleniumbase/fixtures/js_utils.py +171 -144
  37. seleniumbase/fixtures/page_actions.py +177 -13
  38. seleniumbase/fixtures/page_utils.py +25 -53
  39. seleniumbase/fixtures/shared_utils.py +97 -11
  40. seleniumbase/js_code/active_css_js.py +1 -1
  41. seleniumbase/js_code/recorder_js.py +1 -1
  42. seleniumbase/plugins/base_plugin.py +2 -3
  43. seleniumbase/plugins/driver_manager.py +340 -65
  44. seleniumbase/plugins/pytest_plugin.py +276 -47
  45. seleniumbase/plugins/sb_manager.py +412 -99
  46. seleniumbase/plugins/selenium_plugin.py +122 -17
  47. seleniumbase/translate/translator.py +0 -7
  48. seleniumbase/undetected/__init__.py +59 -52
  49. seleniumbase/undetected/cdp.py +0 -1
  50. seleniumbase/undetected/cdp_driver/__init__.py +1 -0
  51. seleniumbase/undetected/cdp_driver/_contradict.py +110 -0
  52. seleniumbase/undetected/cdp_driver/browser.py +829 -0
  53. seleniumbase/undetected/cdp_driver/cdp_util.py +458 -0
  54. seleniumbase/undetected/cdp_driver/config.py +334 -0
  55. seleniumbase/undetected/cdp_driver/connection.py +639 -0
  56. seleniumbase/undetected/cdp_driver/element.py +1168 -0
  57. seleniumbase/undetected/cdp_driver/tab.py +1323 -0
  58. seleniumbase/undetected/dprocess.py +4 -7
  59. seleniumbase/undetected/options.py +6 -8
  60. seleniumbase/undetected/patcher.py +11 -13
  61. seleniumbase/undetected/reactor.py +0 -1
  62. seleniumbase/undetected/webelement.py +16 -3
  63. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/LICENSE +1 -1
  64. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/METADATA +299 -252
  65. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/RECORD +68 -70
  66. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/WHEEL +1 -1
  67. sbase/ReadMe.txt +0 -2
  68. seleniumbase/ReadMe.md +0 -25
  69. seleniumbase/common/ReadMe.md +0 -71
  70. seleniumbase/console_scripts/ReadMe.md +0 -731
  71. seleniumbase/drivers/ReadMe.md +0 -27
  72. seleniumbase/extensions/ReadMe.md +0 -12
  73. seleniumbase/masterqa/ReadMe.md +0 -61
  74. seleniumbase/resources/ReadMe.md +0 -31
  75. seleniumbase/resources/favicon.ico +0 -0
  76. seleniumbase/utilities/selenium_grid/ReadMe.md +0 -84
  77. seleniumbase/utilities/selenium_ide/ReadMe.md +0 -111
  78. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/entry_points.txt +0 -0
  79. {seleniumbase-4.24.10.dist-info → seleniumbase-4.33.15.dist-info}/top_level.txt +0 -0
@@ -41,87 +41,89 @@ sbase grid-node start --hub=127.0.0.1
41
41
  import colorama
42
42
  import sys
43
43
  import time
44
+ from contextlib import suppress
44
45
  from seleniumbase.config import settings
45
46
  from seleniumbase.fixtures import constants
46
47
  from seleniumbase.fixtures import shared_utils
47
48
 
48
- if shared_utils.is_windows() and hasattr(colorama, "just_fix_windows_console"):
49
- colorama.just_fix_windows_console()
50
- else:
51
- colorama.init(autoreset=True)
52
-
53
-
54
- def show_usage():
55
- show_basic_usage()
56
- sc = ""
57
- sc += ' Type "sbase help [COMMAND]" for specific command info.\n'
58
- sc += ' For info on all commands, type: "seleniumbase --help".\n'
59
- sc += ' Use "pytest" for running tests.\n'
60
- if "linux" not in sys.platform:
61
- c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
62
- c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
63
- c3 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
64
- c4 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
65
- cr = colorama.Style.RESET_ALL
66
- sc = sc.replace("seleniumbase", c1 + "selenium" + c2 + "base" + cr)
67
- sc = sc.replace("sbase", c1 + "s" + c2 + "base" + cr)
68
- sc = sc.replace("pytest", c3 + "pytest" + cr)
69
- sc = sc.replace("--help", c4 + "--help" + cr)
70
- sc = sc.replace("help", c4 + "help" + cr)
71
- print(sc)
72
-
73
49
 
74
50
  def show_basic_usage():
75
51
  from seleniumbase.console_scripts import logo_helper
76
52
 
77
53
  seleniumbase_logo = logo_helper.get_seleniumbase_logo()
78
54
  print(seleniumbase_logo)
55
+ time.sleep(0.035)
79
56
  print("")
80
- time.sleep(0.28) # Enough time to see the logo
57
+ time.sleep(0.031)
81
58
  show_package_location()
59
+ time.sleep(0.031)
82
60
  show_version_info()
61
+ time.sleep(0.031)
83
62
  print("")
84
- time.sleep(0.62) # Enough time to see the version
63
+ time.sleep(0.555) # Enough time to see the logo & version
85
64
  sc = ""
86
- sc += ' * USAGE: "seleniumbase [COMMAND] [PARAMETERS]"\n'
87
- sc += ' * OR: "sbase [COMMAND] [PARAMETERS]"\n'
88
- sc += "\n"
89
- sc += "COMMANDS:\n"
90
- sc += " get / install [DRIVER] [OPTIONS]\n"
91
- sc += " methods (List common Python methods)\n"
92
- sc += " options (List common pytest options)\n"
93
- sc += " behave-options (List common behave options)\n"
94
- sc += " gui / commander [OPTIONAL PATH or TEST FILE]\n"
95
- sc += " behave-gui (SBase Commander for Behave)\n"
96
- sc += " caseplans [OPTIONAL PATH or TEST FILE]\n"
97
- sc += " mkdir [DIRECTORY] [OPTIONS]\n"
98
- sc += " mkfile [FILE.py] [OPTIONS]\n"
99
- sc += " mkrec / codegen [FILE.py] [OPTIONS]\n"
100
- sc += " recorder (Open Recorder Desktop App.)\n"
101
- sc += " record (If args: mkrec. Else: App.)\n"
102
- sc += " mkpres [FILE.py] [LANG]\n"
103
- sc += " mkchart [FILE.py] [LANG]\n"
104
- sc += " print [FILE] [OPTIONS]\n"
105
- sc += " translate [SB_FILE.py] [LANG] [ACTION]\n"
106
- sc += " convert [WEBDRIVER_UNITTEST_FILE.py]\n"
107
- sc += " extract-objects [SB_FILE.py]\n"
108
- sc += " inject-objects [SB_FILE.py] [OPTIONS]\n"
109
- sc += " objectify [SB_FILE.py] [OPTIONS]\n"
110
- sc += " revert-objects [SB_FILE.py] [OPTIONS]\n"
111
- sc += " encrypt / obfuscate\n"
112
- sc += " decrypt / unobfuscate\n"
113
- sc += " proxy (Start a basic proxy server)\n"
114
- sc += " download server (Get Selenium Grid JAR file)\n"
115
- sc += " grid-hub [start|stop] [OPTIONS]\n"
116
- sc += " grid-node [start|stop] --hub=[HOST/IP]\n"
117
- sc += ' * (EXAMPLE: "sbase get chromedriver") *\n'
65
+ sc += "╭──────────────────────────────────────────────────╮\n"
66
+ sc += '│ * USAGE: "seleniumbase [COMMAND] [PARAMETERS]" │\n'
67
+ sc += '│ * OR: "sbase [COMMAND] [PARAMETERS]" │\n'
68
+ sc += "│ │\n"
69
+ sc += " COMMANDS: PARAMETERS / DESCRIPTIONS: │\n"
70
+ sc += "│ get / install [DRIVER_NAME] [OPTIONS] │\n"
71
+ sc += "│ methods (List common Python methods) │\n"
72
+ sc += "options (List common pytest options) │\n"
73
+ sc += "│ behave-options (List common behave options) │\n"
74
+ sc += "gui / commander [OPTIONAL PATH or TEST FILE] │\n"
75
+ sc += "│ behave-gui (SBase Commander for Behave) │\n"
76
+ sc += "│ caseplans [OPTIONAL PATH or TEST FILE] │\n"
77
+ sc += "│ mkdir [DIRECTORY] [OPTIONS] │\n"
78
+ sc += "│ mkfile [FILE.py] [OPTIONS] │\n"
79
+ sc += "│ mkrec / codegen [FILE.py] [OPTIONS] │\n"
80
+ sc += "│ recorder (Open Recorder Desktop App.) │\n"
81
+ sc += "│ record (If args: mkrec. Else: App.) │\n"
82
+ sc += "│ mkpres [FILE.py] [LANG] │\n"
83
+ sc += "│ mkchart [FILE.py] [LANG] │\n"
84
+ sc += "│ print [FILE] [OPTIONS] │\n"
85
+ sc += "│ translate [SB_FILE.py] [LANG] [ACTION] │\n"
86
+ sc += "│ convert [WEBDRIVER_UNITTEST_FILE.py] │\n"
87
+ sc += "│ extract-objects [SB_FILE.py] │\n"
88
+ sc += "│ inject-objects [SB_FILE.py] [OPTIONS] │\n"
89
+ sc += "│ objectify [SB_FILE.py] [OPTIONS] │\n"
90
+ sc += "│ revert-objects [SB_FILE.py] [OPTIONS] │\n"
91
+ sc += "│ encrypt / obfuscate │\n"
92
+ sc += "│ decrypt / unobfuscate │\n"
93
+ sc += "│ proxy (Start a basic proxy server) │\n"
94
+ sc += "│ download server (Get Selenium Grid JAR file) │\n"
95
+ sc += "grid-hub [start|stop] [OPTIONS] │\n"
96
+ sc += "│ grid-node [start|stop] --hub=[HOST/IP] │\n"
97
+ sc += "│ │\n"
98
+ sc += '│ * EXAMPLE => "sbase get chromedriver stable" │\n'
99
+ sc += '│ * For command info => "sbase help [COMMAND]" │\n'
100
+ sc += '│ * For info on all commands => "sbase --help" │\n'
101
+ sc += "╰──────────────────────────────────────────────────╯"
118
102
  sc += ""
103
+ bordered_sc = sc
119
104
  if "linux" not in sys.platform:
120
105
  c1 = colorama.Fore.BLUE + colorama.Back.LIGHTCYAN_EX
121
106
  c2 = colorama.Fore.BLUE + colorama.Back.LIGHTGREEN_EX
107
+ c3 = colorama.Fore.BLUE + colorama.Back.LIGHTYELLOW_EX
108
+ c4 = colorama.Fore.MAGENTA + colorama.Back.LIGHTYELLOW_EX
122
109
  cr = colorama.Style.RESET_ALL
123
110
  sc = sc.replace("seleniumbase", c1 + "selenium" + c2 + "base" + cr)
124
111
  sc = sc.replace("sbase", c1 + "s" + c2 + "base" + cr)
112
+ sc = sc.replace("[COMMAND]", c3 + "[COMMAND]" + cr)
113
+ sc = sc.replace("--help", c4 + "--help" + cr)
114
+ sc = sc.replace("help", c4 + "help" + cr)
115
+ with suppress(Exception):
116
+ print(sc)
117
+ return
118
+ sc = bordered_sc.replace("╮\n", "")
119
+ sc = sc.replace("╭", "").replace("╮", "").replace("│", "")
120
+ sc = sc.replace("╰", "").replace("╯", "").replace("─", "")
121
+ if "linux" not in sys.platform:
122
+ sc = sc.replace("seleniumbase", c1 + "selenium" + c2 + "base" + cr)
123
+ sc = sc.replace("sbase", c1 + "s" + c2 + "base" + cr)
124
+ sc = sc.replace("[COMMAND]", c3 + "[COMMAND]" + cr)
125
+ sc = sc.replace("--help", c4 + "--help" + cr)
126
+ sc = sc.replace("help", c4 + "help" + cr)
125
127
  print(sc)
126
128
 
127
129
 
@@ -133,33 +135,33 @@ def show_install_usage():
133
135
  print(sc)
134
136
  print("")
135
137
  print(" Usage:")
136
- print(" seleniumbase install [DRIVER_NAME] [OPTIONS]")
137
- print(" OR: seleniumbase get [DRIVER_NAME] [OPTIONS]")
138
- print(" OR: sbase install [DRIVER_NAME] [OPTIONS]")
139
- print(" OR: sbase get [DRIVER_NAME] [OPTIONS]")
140
- print(" (Drivers: chromedriver, geckodriver, edgedriver")
141
- print(" iedriver, uc_driver)")
138
+ print(" seleniumbase install [DRIVER_NAME] [OPTIONS]")
139
+ print(" OR: seleniumbase get [DRIVER_NAME] [OPTIONS]")
140
+ print(" OR: sbase install [DRIVER_NAME] [OPTIONS]")
141
+ print(" OR: sbase get [DRIVER_NAME] [OPTIONS]")
142
+ print(" (Drivers: chromedriver, geckodriver,")
143
+ print(" edgedriver, iedriver, uc_driver)")
142
144
  print(" Options:")
143
- print(" VERSION Specify the version to download.")
144
- print(" Tries to detect the needed version.")
145
- print(" If using chromedriver or edgedriver,")
146
- print(" you can use the major version integer.")
145
+ print(" VERSION Specify the version to download.")
146
+ print(" Tries to detect the needed version.")
147
+ print(" If using chromedriver or edgedriver,")
148
+ print(" you can use the major version integer.")
147
149
  print()
148
- print(" -p OR --path Also copy the driver to /usr/local/bin")
150
+ print(" -p / --path Also copy driver to /usr/local/bin")
149
151
  print(" Examples:")
150
- print(" sbase get chromedriver")
151
- print(" sbase get geckodriver")
152
- print(" sbase get edgedriver")
153
- print(" sbase get chromedriver 114")
154
- print(" sbase get chromedriver 114.0.5735.90")
155
- print(" sbase get chromedriver stable")
156
- print(" sbase get chromedriver beta")
157
- print(" sbase get chromedriver -p")
152
+ print(" sbase get chromedriver")
153
+ print(" sbase get geckodriver")
154
+ print(" sbase get edgedriver")
155
+ print(" sbase get chromedriver 114")
156
+ print(" sbase get chromedriver 114.0.5735.90")
157
+ print(" sbase get chromedriver stable")
158
+ print(" sbase get chromedriver beta")
159
+ print(" sbase get chromedriver -p")
158
160
  print(" Output:")
159
- print(" Downloads the webdriver to seleniumbase/drivers/")
160
- print(" (chromedriver is required for Chrome automation)")
161
- print(" (geckodriver is required for Firefox automation)")
162
- print(" (edgedriver is required for MS__Edge automation)")
161
+ print(" Downloads the webdriver to seleniumbase/drivers/")
162
+ print(" (chromedriver is required for Chrome automation)")
163
+ print(" (geckodriver is required for Firefox automation)")
164
+ print(" (edgedriver is required for MS__Edge automation)")
163
165
  print("")
164
166
 
165
167
 
@@ -171,18 +173,18 @@ def show_commander_usage():
171
173
  print(sc)
172
174
  print("")
173
175
  print(" Usage:")
174
- print(" seleniumbase commander [OPTIONAL PATH or TEST FILE]")
175
- print(" OR: sbase commander [OPTIONAL PATH or TEST FILE]")
176
- print(" OR: seleniumbase gui [OPTIONAL PATH or TEST FILE]")
177
- print(" OR: sbase gui [OPTIONAL PATH or TEST FILE]")
176
+ print(" seleniumbase commander [OPTIONAL PATH or TEST FILE]")
177
+ print(" OR: sbase commander [OPTIONAL PATH or TEST FILE]")
178
+ print(" OR: seleniumbase gui [OPTIONAL PATH or TEST FILE]")
179
+ print(" OR: sbase gui [OPTIONAL PATH or TEST FILE]")
178
180
  print(" Examples:")
179
- print(" sbase gui")
180
- print(" sbase gui -k agent")
181
- print(" sbase gui -m marker2")
182
- print(" sbase gui test_suite.py")
183
- print(" sbase gui offline_examples/")
181
+ print(" sbase gui")
182
+ print(" sbase gui -k agent")
183
+ print(" sbase gui -m marker2")
184
+ print(" sbase gui test_suite.py")
185
+ print(" sbase gui offline_examples/")
184
186
  print(" Output:")
185
- print(" Launches SeleniumBase Commander | GUI for pytest.")
187
+ print(" Launches SeleniumBase Commander | GUI for pytest.")
186
188
  print("")
187
189
 
188
190
 
@@ -194,16 +196,16 @@ def show_behave_gui_usage():
194
196
  print(sc)
195
197
  print("")
196
198
  print(" Usage:")
197
- print(" seleniumbase behave-gui [OPTIONAL PATH or TEST FILE]")
198
- print(" seleniumbase gui-behave [OPTIONAL PATH or TEST FILE]")
199
- print(" OR: sbase behave-gui [OPTIONAL PATH or TEST FILE]")
200
- print(" OR: sbase gui-behave [OPTIONAL PATH or TEST FILE]")
199
+ print(" seleniumbase behave-gui [OPTIONAL PATH or TEST FILE]")
200
+ print(" seleniumbase gui-behave [OPTIONAL PATH or TEST FILE]")
201
+ print(" OR: sbase behave-gui [OPTIONAL PATH or TEST FILE]")
202
+ print(" OR: sbase gui-behave [OPTIONAL PATH or TEST FILE]")
201
203
  print(" Examples:")
202
- print(" sbase behave-gui")
203
- print(" sbase behave-gui features/")
204
- print(" sbase behave-gui features/calculator.feature")
204
+ print(" sbase behave-gui")
205
+ print(" sbase behave-gui features/")
206
+ print(" sbase behave-gui features/calculator.feature")
205
207
  print(" Output:")
206
- print(" Launches SeleniumBase Commander | GUI for Behave.")
208
+ print(" Launches SeleniumBase Commander | GUI for Behave.")
207
209
  print("")
208
210
 
209
211
 
@@ -215,16 +217,16 @@ def show_caseplans_usage():
215
217
  print(sc)
216
218
  print("")
217
219
  print(" Usage:")
218
- print(" seleniumbase caseplans [OPTIONAL PATH or TEST FILE]")
219
- print(" OR: sbase caseplans [OPTIONAL PATH or TEST FILE]")
220
+ print(" seleniumbase caseplans [OPTIONAL PATH or TEST FILE]")
221
+ print(" OR: sbase caseplans [OPTIONAL PATH or TEST FILE]")
220
222
  print(" Examples:")
221
- print(" sbase caseplans")
222
- print(" sbase caseplans -k agent")
223
- print(" sbase caseplans -m marker2")
224
- print(" sbase caseplans test_suite.py")
225
- print(" sbase caseplans offline_examples/")
223
+ print(" sbase caseplans")
224
+ print(" sbase caseplans -k agent")
225
+ print(" sbase caseplans -m marker2")
226
+ print(" sbase caseplans test_suite.py")
227
+ print(" sbase caseplans offline_examples/")
226
228
  print(" Output:")
227
- print(" Launches the SeleniumBase Case Plans Generator.")
229
+ print(" Launches the SeleniumBase Case Plans Generator.")
228
230
  print("")
229
231
 
230
232
 
@@ -236,18 +238,18 @@ def show_mkdir_usage():
236
238
  print(sc)
237
239
  print("")
238
240
  print(" Usage:")
239
- print(" seleniumbase mkdir [DIRECTORY] [OPTIONS]")
240
- print(" OR: sbase mkdir [DIRECTORY] [OPTIONS]")
241
+ print(" seleniumbase mkdir [DIRECTORY] [OPTIONS]")
242
+ print(" OR: sbase mkdir [DIRECTORY] [OPTIONS]")
241
243
  print(" Example:")
242
- print(" sbase mkdir ui_tests")
244
+ print(" sbase mkdir ui_tests")
243
245
  print(" Options:")
244
- print(" -b / --basic (Only config files. No tests added.)")
246
+ print(" -b / --basic (Only config files. No tests added.)")
245
247
  print(" Output:")
246
- print(" Creates a new folder for running SBase scripts.")
247
- print(" The new folder contains default config files,")
248
- print(" sample tests for helping new users get started,")
249
- print(" and Python boilerplates for setting up customized")
250
- print(" test frameworks.")
248
+ print(" Creates a new folder for running SBase scripts.")
249
+ print(" The new folder contains default config files,")
250
+ print(" sample tests for helping new users get started,")
251
+ print(" and Python boilerplates for setting up customized")
252
+ print(" test frameworks.")
251
253
  print("")
252
254
 
253
255
 
@@ -259,36 +261,38 @@ def show_mkfile_usage():
259
261
  print(sc)
260
262
  print("")
261
263
  print(" Usage:")
262
- print(" seleniumbase mkfile [FILE.py] [OPTIONS]")
263
- print(" OR: sbase mkfile [FILE.py] [OPTIONS]")
264
+ print(" seleniumbase mkfile [FILE.py] [OPTIONS]")
265
+ print(" OR: sbase mkfile [FILE.py] [OPTIONS]")
264
266
  print(" Example:")
265
- print(" sbase mkfile new_test.py")
267
+ print(" sbase mkfile new_test.py")
266
268
  print(" Options:")
267
- print(" -b / --basic (Basic boilerplate / single-line test)")
268
- print(" -r / --rec (adds Pdb+ breakpoint for Recorder Mode)")
269
- print(" --url=URL (makes the test start on a specific page)")
269
+ print(" --uc (UC Mode boilerplate using SB context manager)")
270
+ print(" -b / --basic (Basic boilerplate / single-line test)")
271
+ print(" -r / --rec (Adds Pdb+ breakpoint for Recorder Mode)")
272
+ print(" --url=URL (Makes the test start on a specific page)")
270
273
  print(" Language Options:")
271
- print(" --en / --English | --zh / --Chinese")
272
- print(" --nl / --Dutch | --fr / --French")
273
- print(" --it / --Italian | --ja / --Japanese")
274
- print(" --ko / --Korean | --pt / --Portuguese")
275
- print(" --ru / --Russian | --es / --Spanish")
274
+ print(" --en / --English | --zh / --Chinese")
275
+ print(" --nl / --Dutch | --fr / --French")
276
+ print(" --it / --Italian | --ja / --Japanese")
277
+ print(" --ko / --Korean | --pt / --Portuguese")
278
+ print(" --ru / --Russian | --es / --Spanish")
276
279
  print(" Syntax Formats:")
277
- print(" --bc / --basecase (BaseCase class inheritance)")
278
- print(" --pf / --pytest-fixture (sb pytest fixture)")
279
- print(" --cf / --class-fixture (class + sb pytest fixture)")
280
- print(" --cm / --context-manager (SB context manager)")
281
- print(" --dc / --driver-context (DriverContext manager)")
282
- print(" --dm / --driver-manager (Driver manager)")
280
+ print(" --bc / --basecase (BaseCase class inheritance)")
281
+ print(" --pf / --pytest-fixture (sb pytest fixture)")
282
+ print(" --cf / --class-fixture (class + sb pytest fixture)")
283
+ print(" --cm / --context-manager (SB context manager)")
284
+ print(" --dc / --driver-context (DriverContext manager)")
285
+ print(" --dm / --driver-manager (Driver manager)")
283
286
  print(" Output:")
284
- print(" Creates a new SBase test file with boilerplate code.")
285
- print(" If the file already exists, an error is raised.")
286
- print(" By default, uses English with BaseCase inheritance,")
287
- print(" and creates a boilerplate with common SeleniumBase")
288
- print(' methods: "open", "type", "click", "assert_element",')
289
- print(' and "assert_text". If using the basic boilerplate')
290
- print(' option, only the "open" method is included. Only the')
291
- print(" BaseCase format supports Languages or Recorder Mode.")
287
+ print(" Creates a new SBase test file with boilerplate code.")
288
+ print(" If the file already exists, an error is raised.")
289
+ print(" By default, uses English with BaseCase inheritance,")
290
+ print(" and creates a boilerplate with common SeleniumBase")
291
+ print(' methods: "open", "type", "click", "assert_element",')
292
+ print(' and "assert_text". If using the basic boilerplate')
293
+ print(' option, only the "open" method is included. Only the')
294
+ print(" BaseCase format supports Languages or Recorder Mode.")
295
+ print(" UC Mode automatically uses English with SB() format.")
292
296
  print("")
293
297
 
294
298
 
@@ -300,21 +304,22 @@ def show_mkrec_usage():
300
304
  print(sc)
301
305
  print("")
302
306
  print(" Usage:")
303
- print(" seleniumbase mkrec [FILE.py] [OPTIONS]")
304
- print(" OR: sbase mkrec [FILE.py] [OPTIONS]")
307
+ print(" seleniumbase mkrec [FILE.py] [OPTIONS]")
308
+ print(" OR: sbase mkrec [FILE.py] [OPTIONS]")
305
309
  print(" Examples:")
306
- print(" sbase mkrec new_test.py")
307
- print(" sbase mkrec new_test.py --url=wikipedia.org")
310
+ print(" sbase mkrec new_test.py")
311
+ print(" sbase mkrec new_test.py --url=wikipedia.org")
308
312
  print(" Options:")
309
- print(" --url=URL (Sets the initial start page URL.)")
310
- print(" --edge (Use Edge browser instead of Chrome.)")
311
- print(" --gui / --headed (Use headed mode on Linux.)")
312
- print(" --uc / --undetected (Use undetectable mode.)")
313
- print(" --overwrite (Overwrite file when it exists.)")
314
- print(" --behave (Also output Behave/Gherkin files.)")
313
+ print(" --url=URL (Sets the initial start page URL.)")
314
+ print(" --edge (Use Edge browser instead of Chrome.)")
315
+ print(" --gui / --headed (Use headed mode on Linux.)")
316
+ print(" --uc / --undetected (Use undetectable mode.)")
317
+ print(" --ee (Use SHIFT + ESC to end the recording.)")
318
+ print(" --overwrite (Overwrite file when it exists.)")
319
+ print(" --behave (Also output Behave/Gherkin files.)")
315
320
  print(" Output:")
316
- print(" Creates a new SeleniumBase test using the Recorder.")
317
- print(" If the filename already exists, an error is raised.")
321
+ print(" Creates a new SeleniumBase test using the Recorder.")
322
+ print(" If the filename already exists, an error is raised.")
318
323
  print("")
319
324
 
320
325
 
@@ -326,21 +331,22 @@ def show_codegen_usage():
326
331
  print(sc)
327
332
  print("")
328
333
  print(" Usage:")
329
- print(" seleniumbase codegen [FILE.py] [OPTIONS]")
330
- print(" OR: sbase codegen [FILE.py] [OPTIONS]")
334
+ print(" seleniumbase codegen [FILE.py] [OPTIONS]")
335
+ print(" OR: sbase codegen [FILE.py] [OPTIONS]")
331
336
  print(" Examples:")
332
- print(" sbase codegen new_test.py")
333
- print(" sbase codegen new_test.py --url=wikipedia.org")
337
+ print(" sbase codegen new_test.py")
338
+ print(" sbase codegen new_test.py --url=wikipedia.org")
334
339
  print(" Options:")
335
- print(" --url=URL (Sets the initial start page URL.)")
336
- print(" --edge (Use Edge browser instead of Chrome.)")
337
- print(" --gui / --headed (Use headed mode on Linux.)")
338
- print(" --uc / --undetected (Use undetectable mode.)")
339
- print(" --overwrite (Overwrite file when it exists.)")
340
- print(" --behave (Also output Behave/Gherkin files.)")
340
+ print(" --url=URL (Sets the initial start page URL.)")
341
+ print(" --edge (Use Edge browser instead of Chrome.)")
342
+ print(" --gui / --headed (Use headed mode on Linux.)")
343
+ print(" --uc / --undetected (Use undetectable mode.)")
344
+ print(" --ee (Use SHIFT + ESC to end the recording.)")
345
+ print(" --overwrite (Overwrite file when it exists.)")
346
+ print(" --behave (Also output Behave/Gherkin files.)")
341
347
  print(" Output:")
342
- print(" Creates a new SeleniumBase test using the Recorder.")
343
- print(" If the filename already exists, an error is raised.")
348
+ print(" Creates a new SeleniumBase test using the Recorder.")
349
+ print(" If the filename already exists, an error is raised.")
344
350
  print("")
345
351
 
346
352
 
@@ -352,13 +358,13 @@ def show_recorder_usage():
352
358
  print(sc)
353
359
  print("")
354
360
  print(" Usage:")
355
- print(" seleniumbase recorder [OPTIONS]")
356
- print(" OR: sbase recorder [OPTIONS]")
361
+ print(" seleniumbase recorder [OPTIONS]")
362
+ print(" OR: sbase recorder [OPTIONS]")
357
363
  print(" Options:")
358
- print(" --uc / --undetected (Use undetectable mode.)")
359
- print(" --behave (Also output Behave/Gherkin files.)")
364
+ print(" --uc / --undetected (Use undetectable mode.)")
365
+ print(" --behave (Also output Behave/Gherkin files.)")
360
366
  print(" Output:")
361
- print(" Launches the SeleniumBase Recorder Desktop App.")
367
+ print(" Launches the SeleniumBase Recorder Desktop App.")
362
368
  print("")
363
369
 
364
370
 
@@ -370,22 +376,22 @@ def show_mkpres_usage():
370
376
  print(sc)
371
377
  print("")
372
378
  print(" Usage:")
373
- print(" seleniumbase mkpres [FILE.py] [LANG]")
374
- print(" OR: sbase mkpres [FILE.py] [LANG]")
379
+ print(" seleniumbase mkpres [FILE.py] [LANG]")
380
+ print(" OR: sbase mkpres [FILE.py] [LANG]")
375
381
  print(" Example:")
376
- print(" sbase mkpres new_presentation.py --en")
382
+ print(" sbase mkpres new_presentation.py --en")
377
383
  print(" Language Options:")
378
- print(" --en / --English | --zh / --Chinese")
379
- print(" --nl / --Dutch | --fr / --French")
380
- print(" --it / --Italian | --ja / --Japanese")
381
- print(" --ko / --Korean | --pt / --Portuguese")
382
- print(" --ru / --Russian | --es / --Spanish")
384
+ print(" --en / --English | --zh / --Chinese")
385
+ print(" --nl / --Dutch | --fr / --French")
386
+ print(" --it / --Italian | --ja / --Japanese")
387
+ print(" --ko / --Korean | --pt / --Portuguese")
388
+ print(" --ru / --Russian | --es / --Spanish")
383
389
  print(" Output:")
384
- print(" Creates a new presentation with 3 example slides.")
385
- print(" If the file already exists, an error is raised.")
386
- print(" By default, the slides are written in English,")
387
- print(' and use "serif" theme with "slide" transition.')
388
- print(" The slides can be used as a basic boilerplate.")
390
+ print(" Creates a new presentation with 3 example slides.")
391
+ print(" If the file already exists, an error is raised.")
392
+ print(" By default, the slides are written in English,")
393
+ print(' and use "serif" theme with "slide" transition.')
394
+ print(" The slides can be used as a basic boilerplate.")
389
395
  print("")
390
396
 
391
397
 
@@ -397,22 +403,22 @@ def show_mkchart_usage():
397
403
  print(sc)
398
404
  print("")
399
405
  print(" Usage:")
400
- print(" seleniumbase mkchart [FILE.py] [LANG]")
401
- print(" OR: sbase mkchart [FILE.py] [LANG]")
406
+ print(" seleniumbase mkchart [FILE.py] [LANG]")
407
+ print(" OR: sbase mkchart [FILE.py] [LANG]")
402
408
  print(" Example:")
403
- print(" sbase mkchart new_chart.py --en")
409
+ print(" sbase mkchart new_chart.py --en")
404
410
  print(" Language Options:")
405
- print(" --en / --English | --zh / --Chinese")
406
- print(" --nl / --Dutch | --fr / --French")
407
- print(" --it / --Italian | --ja / --Japanese")
408
- print(" --ko / --Korean | --pt / --Portuguese")
409
- print(" --ru / --Russian | --es / --Spanish")
411
+ print(" --en / --English | --zh / --Chinese")
412
+ print(" --nl / --Dutch | --fr / --French")
413
+ print(" --it / --Italian | --ja / --Japanese")
414
+ print(" --ko / --Korean | --pt / --Portuguese")
415
+ print(" --ru / --Russian | --es / --Spanish")
410
416
  print(" Output:")
411
- print(" Creates a new SeleniumBase chart presentation.")
412
- print(" If the file already exists, an error is raised.")
413
- print(" By default, the slides are written in English,")
414
- print(' and use a "sky" theme with "slide" transition.')
415
- print(" The chart can be used as a basic boilerplate.")
417
+ print(" Creates a new SeleniumBase chart presentation.")
418
+ print(" If the file already exists, an error is raised.")
419
+ print(" By default, the slides are written in English,")
420
+ print(' and use a "sky" theme with "slide" transition.')
421
+ print(" The chart can be used as a basic boilerplate.")
416
422
  print("")
417
423
 
418
424
 
@@ -424,13 +430,13 @@ def show_convert_usage():
424
430
  print(sc)
425
431
  print("")
426
432
  print(" Usage:")
427
- print(" seleniumbase convert [WEBDRIVER_UNITTEST_FILE.py]")
428
- print(" OR: sbase convert [WEBDRIVER_UNITTEST_FILE.py]")
433
+ print(" seleniumbase convert [WEBDRIVER_UNITTEST_FILE.py]")
434
+ print(" OR: sbase convert [WEBDRIVER_UNITTEST_FILE.py]")
429
435
  print(" Output:")
430
- print(" Converts a Selenium IDE exported WebDriver unittest")
431
- print(" file into a SeleniumBase file. Adds _SB to the new")
432
- print(" file name while keeping the original file intact.")
433
- print(" (Works with Katalon Recorder Selenium scripts.)")
436
+ print(" Converts a Selenium IDE exported WebDriver unittest")
437
+ print(" file into a SeleniumBase file. Adds _SB to the new")
438
+ print(" file name while keeping the original file intact.")
439
+ print(" (Works with Katalon Recorder Selenium scripts.)")
434
440
  print("")
435
441
 
436
442
 
@@ -442,13 +448,13 @@ def show_print_usage():
442
448
  print(sc)
443
449
  print("")
444
450
  print(" Usage:")
445
- print(" seleniumbase print [FILE] [OPTIONS]")
446
- print(" OR: sbase print [FILE] [OPTIONS]")
451
+ print(" seleniumbase print [FILE] [OPTIONS]")
452
+ print(" OR: sbase print [FILE] [OPTIONS]")
447
453
  print(" Options:")
448
- print(" -n (Add line Numbers to the rows)")
454
+ print(" -n (Add line Numbers to the rows)")
449
455
  print(" Output:")
450
- print(" Prints the code/text of any file")
451
- print(" with syntax-highlighting.")
456
+ print(" Prints the code/text of any file")
457
+ print(" with syntax-highlighting.")
452
458
  print("")
453
459
 
454
460
 
@@ -460,30 +466,30 @@ def show_translate_usage():
460
466
  print(sc)
461
467
  print("")
462
468
  print(" Usage:")
463
- print(" seleniumbase translate [SB_FILE.py] [LANG] [ACTION]")
464
- print(" OR: sbase translate [SB_FILE.py] [LANG] [ACTION]")
469
+ print(" seleniumbase translate [SB_FILE.py] [LANG] [ACTION]")
470
+ print(" OR: sbase translate [SB_FILE.py] [LANG] [ACTION]")
465
471
  print(" Languages:")
466
- print(" --en / --English | --zh / --Chinese")
467
- print(" --nl / --Dutch | --fr / --French")
468
- print(" --it / --Italian | --ja / --Japanese")
469
- print(" --ko / --Korean | --pt / --Portuguese")
470
- print(" --ru / --Russian | --es / --Spanish")
472
+ print(" --en / --English | --zh / --Chinese")
473
+ print(" --nl / --Dutch | --fr / --French")
474
+ print(" --it / --Italian | --ja / --Japanese")
475
+ print(" --ko / --Korean | --pt / --Portuguese")
476
+ print(" --ru / --Russian | --es / --Spanish")
471
477
  print(" Actions:")
472
- print(" -p / --print (Print translation output to the screen)")
473
- print(" -o / --overwrite (Overwrite the file being translated)")
474
- print(" -c / --copy (Copy the translation to a new .py file)")
478
+ print(" -p / --print (Print translation output to the screen)")
479
+ print(" -o / --overwrite (Overwrite the file being translated)")
480
+ print(" -c / --copy (Copy the translation to a new .py file)")
475
481
  print(" Options:")
476
- print(" -n (include line Numbers when using the Print action)")
482
+ print(" -n (include line Numbers when using the Print action)")
477
483
  print(" Output:")
478
- print(" Translates a SeleniumBase Python file into the language")
479
- print(' specified. Method calls and "import" lines get swapped.')
480
- print(" Both a language and an action must be specified.")
481
- print(' The "-p" action can be paired with one other action.')
482
- print(' When running with "-c" (or "--copy"), the new file name')
483
- print(" will be the original name appended with an underscore")
484
- print(" plus the 2-letter language code of the new language.")
485
- print(' (Example: Translating "test_1.py" into Japanese with')
486
- print(' "-c" will create a new file called "test_1_ja.py".)')
484
+ print(" Translates a SeleniumBase Python file into the language")
485
+ print(' specified. Method calls and "import" lines get swapped.')
486
+ print(" Both a language and an action must be specified.")
487
+ print(' The "-p" action can be paired with one other action.')
488
+ print(' When running with "-c" (or "--copy"), the new file name')
489
+ print(" will be the original name appended with an underscore")
490
+ print(" plus the 2-letter language code of the new language.")
491
+ print(' (Example: Translating "test_1.py" into Japanese with')
492
+ print(' "-c" will create a new file called "test_1_ja.py".)')
487
493
  print("")
488
494
 
489
495
 
@@ -495,12 +501,12 @@ def show_extract_objects_usage():
495
501
  print(sc)
496
502
  print("")
497
503
  print(" Usage:")
498
- print(" seleniumbase extract-objects [SB_FILE.py]")
499
- print(" OR: sbase extract-objects [SB_FILE.py]")
504
+ print(" seleniumbase extract-objects [SB_FILE.py]")
505
+ print(" OR: sbase extract-objects [SB_FILE.py]")
500
506
  print(" Output:")
501
- print(" Creates page objects based on selectors found in a")
502
- print(" seleniumbase Python file and saves those objects to the")
503
- print(' "page_objects.py" file in the same folder as the tests.')
507
+ print(" Creates page objects based on selectors found in a")
508
+ print(" seleniumbase Python file and saves those objects to the")
509
+ print(' "page_objects.py" file in the same folder as the tests.')
504
510
  print("")
505
511
 
506
512
 
@@ -512,15 +518,15 @@ def show_inject_objects_usage():
512
518
  print(sc)
513
519
  print("")
514
520
  print(" Usage:")
515
- print(" seleniumbase inject-objects [SB_FILE.py] [OPTIONS]")
516
- print(" OR: sbase inject-objects [SB_FILE.py] [OPTIONS]")
521
+ print(" seleniumbase inject-objects [SB_FILE.py] [OPTIONS]")
522
+ print(" OR: sbase inject-objects [SB_FILE.py] [OPTIONS]")
517
523
  print(" Options:")
518
- print(" -c, --comments (Add object selectors to the comments.)")
519
- print(" (Default: No added comments.)")
524
+ print(" -c, --comments (Add object selectors to the comments.)")
525
+ print(" (Default: No added comments.)")
520
526
  print(" Output:")
521
- print(' Takes the page objects found in the "page_objects.py"')
522
- print(" file and uses those to replace matching selectors in")
523
- print(" the selected seleniumbase Python file.")
527
+ print(' Takes the page objects found in the "page_objects.py"')
528
+ print(" file and uses those to replace matching selectors in")
529
+ print(" the selected seleniumbase Python file.")
524
530
  print("")
525
531
 
526
532
 
@@ -532,18 +538,18 @@ def show_objectify_usage():
532
538
  print(sc)
533
539
  print("")
534
540
  print(" Usage:")
535
- print(" seleniumbase objectify [SB_FILE.py] [OPTIONS]")
536
- print(" OR: sbase objectify [SB_FILE.py] [OPTIONS]")
541
+ print(" seleniumbase objectify [SB_FILE.py] [OPTIONS]")
542
+ print(" OR: sbase objectify [SB_FILE.py] [OPTIONS]")
537
543
  print(" Options:")
538
- print(" -c, --comments (Add object selectors to the comments.)")
539
- print(" (Default: No added comments.)")
544
+ print(" -c, --comments (Add object selectors to the comments.)")
545
+ print(" (Default: No added comments.)")
540
546
  print(" Output:")
541
- print(" A modified version of the file where the selectors")
542
- print(" have been replaced with variable names defined in")
543
- print(' "page_objects.py", supporting the Page Object Pattern.')
547
+ print(" A modified version of the file where the selectors")
548
+ print(" have been replaced with variable names defined in")
549
+ print(' "page_objects.py", supporting the Page Object Pattern.')
544
550
  print("")
545
- print(' (seleniumbase "objectify" has the same outcome as')
546
- print(' combining "extract-objects" with "inject-objects")')
551
+ print(' (seleniumbase "objectify" has the same outcome as')
552
+ print(' combining "extract-objects" with "inject-objects")')
547
553
  print("")
548
554
 
549
555
 
@@ -555,16 +561,16 @@ def show_revert_objects_usage():
555
561
  print(sc)
556
562
  print("")
557
563
  print(" Usage:")
558
- print(" seleniumbase revert-objects [SB_FILE.py] [OPTIONS]")
559
- print(" OR: sbase revert-objects [SB_FILE.py] [OPTIONS]")
564
+ print(" seleniumbase revert-objects [SB_FILE.py] [OPTIONS]")
565
+ print(" OR: sbase revert-objects [SB_FILE.py] [OPTIONS]")
560
566
  print(" Options:")
561
- print(" -c, --comments (Keep existing comments for the lines.)")
562
- print(" (Default: No comments are kept.)")
567
+ print(" -c, --comments (Keep existing comments for the lines.)")
568
+ print(" (Default: No comments are kept.)")
563
569
  print(" Output:")
564
- print(' Reverts the changes made by "seleniumbase objectify" or')
565
- print(' "seleniumbase inject-objects" when run against a')
566
- print(" seleniumbase Python file. Objects will get replaced by")
567
- print(' selectors stored in the "page_objects.py" file.')
570
+ print(' Reverts the changes made by "seleniumbase objectify" or')
571
+ print(' "seleniumbase inject-objects" when run against a')
572
+ print(" seleniumbase Python file. Objects will get replaced by")
573
+ print(' selectors stored in the "page_objects.py" file.')
568
574
  print("")
569
575
 
570
576
 
@@ -576,12 +582,12 @@ def show_encrypt_usage():
576
582
  print(sc)
577
583
  print("")
578
584
  print(" Usage:")
579
- print(" seleniumbase encrypt || seleniumbase obfuscate")
580
- print(" --OR--")
581
- print(" sbase encrypt || sbase obfuscate")
585
+ print(" seleniumbase encrypt || seleniumbase obfuscate")
586
+ print(" --OR--")
587
+ print(" sbase encrypt || sbase obfuscate")
582
588
  print(" Output:")
583
- print(" Runs the password encryption/obfuscation tool.")
584
- print(" (Where you can enter a password to encrypt/obfuscate.)")
589
+ print(" Runs the password encryption/obfuscation tool.")
590
+ print(" (Where you can enter a password to encrypt/obfuscate.)")
585
591
  print("")
586
592
 
587
593
 
@@ -593,12 +599,12 @@ def show_decrypt_usage():
593
599
  print(sc)
594
600
  print("")
595
601
  print(" Usage:")
596
- print(" seleniumbase decrypt || seleniumbase unobfuscate")
597
- print(" --OR--")
598
- print(" sbase decrypt || sbase unobfuscate")
602
+ print(" seleniumbase decrypt || seleniumbase unobfuscate")
603
+ print(" --OR--")
604
+ print(" sbase decrypt || sbase unobfuscate")
599
605
  print(" Output:")
600
- print(" Runs the password decryption/unobfuscation tool.")
601
- print(" (Where you can enter an encrypted password to decrypt.)")
606
+ print(" Runs the password decryption/unobfuscation tool.")
607
+ print(" (Where you can enter an encrypted password to decrypt.)")
602
608
  print("")
603
609
 
604
610
 
@@ -610,11 +616,11 @@ def show_download_usage():
610
616
  print(sc)
611
617
  print("")
612
618
  print(" Usage:")
613
- print(" seleniumbase download server")
614
- print(" OR: sbase download server")
619
+ print(" seleniumbase download server")
620
+ print(" OR: sbase download server")
615
621
  print(" Output:")
616
- print(" Downloads the Selenium Standalone Server.")
617
- print(" (Server is required for using your own Selenium Grid.)")
622
+ print(" Downloads the Selenium Standalone Server.")
623
+ print(" (Server is required for using your own Selenium Grid.)")
618
624
  print("")
619
625
 
620
626
 
@@ -626,22 +632,22 @@ def show_grid_hub_usage():
626
632
  print(sc)
627
633
  print("")
628
634
  print(" Usage:")
629
- print(" seleniumbase grid-hub {start|stop|restart} [OPTIONS]")
630
- print(" OR: sbase grid-hub {start|stop|restart} [OPTIONS]")
635
+ print(" seleniumbase grid-hub {start|stop|restart} [OPTIONS]")
636
+ print(" OR: sbase grid-hub {start|stop|restart} [OPTIONS]")
631
637
  print(" Options:")
632
- print(" -v, --verbose (Increase verbosity of logging output.)")
633
- print(" (Default: Quiet logging / not verbose.)")
634
- print(" --timeout=TIMEOUT (Close idle browser after TIMEOUT.)")
635
- print(" (The default TIMEOUT: 230 seconds.)")
636
- print(" (Use --timeout=0 to skip timeouts.)")
638
+ print(" -v, --verbose (Increase verbosity of logging output.)")
639
+ print(" (Default: Quiet logging / not verbose.)")
640
+ print(" --timeout=TIMEOUT (Close idle browser after TIMEOUT.)")
641
+ print(" (The default TIMEOUT: 230 seconds.)")
642
+ print(" (Use --timeout=0 to skip timeouts.)")
637
643
  print(" Example:")
638
- print(" seleniumbase grid-hub start")
644
+ print(" seleniumbase grid-hub start")
639
645
  print(" Output:")
640
- print(" Controls the Selenium Grid Hub Server, which allows")
641
- print(" for running tests on multiple machines in parallel")
642
- print(" to speed up test runs and reduce the total time")
643
- print(" of test suite execution.")
644
- print(' You can "start" or "stop" the Grid Hub server.')
646
+ print(" Controls the Selenium Grid Hub Server, which allows")
647
+ print(" for running tests on multiple machines in parallel")
648
+ print(" to speed up test runs and reduce the total time")
649
+ print(" of test suite execution.")
650
+ print(' You can "start" or "stop" the Grid Hub server.')
645
651
  print("")
646
652
 
647
653
 
@@ -653,19 +659,19 @@ def show_grid_node_usage():
653
659
  print(sc)
654
660
  print("")
655
661
  print(" Usage:")
656
- print(" seleniumbase grid-node {start|stop|restart} [OPTIONS]")
657
- print(" OR: sbase grid-node {start|stop|restart} [OPTIONS]")
662
+ print(" seleniumbase grid-node {start|stop|restart} [OPTIONS]")
663
+ print(" OR: sbase grid-node {start|stop|restart} [OPTIONS]")
658
664
  print(" Options:")
659
- print(" --hub=[HOST/IP] (The Grid Hub Hostname / IP Address.)")
660
- print(" (Default: 127.0.0.1 if not set.)")
661
- print(" -v, --verbose (Increase verbosity of logging output.)")
662
- print(" (Default: Quiet logging / Not verbose.)")
665
+ print(" --hub=[HOST/IP] (The Grid Hub Hostname / IP Address.)")
666
+ print(" (Default: 127.0.0.1 if not set.)")
667
+ print(" -v, --verbose (Increase verbosity of logging output.)")
668
+ print(" (Default: Quiet logging / Not verbose.)")
663
669
  print(" Example:")
664
- print(" seleniumbase grid-node start --hub=127.0.0.1")
670
+ print(" seleniumbase grid-node start --hub=127.0.0.1")
665
671
  print(" Output:")
666
- print(" Controls the Selenium Grid node, which serves as a")
667
- print(" worker machine for your Selenium Grid Hub server.")
668
- print(' You can "start" or "stop" the Grid node.')
672
+ print(" Controls the Selenium Grid node, which serves as a")
673
+ print(" worker machine for your Selenium Grid Hub server.")
674
+ print(' You can "start" or "stop" the Grid node.')
669
675
  print("")
670
676
 
671
677
 
@@ -792,16 +798,16 @@ def show_options():
792
798
  line = '(Some options are Chromium-specific, e.g. "--guest --mobile")'
793
799
  print(line)
794
800
  op = "\n"
795
- op += '--browser=BROWSER (Choice of web browser. Default is "chrome".)\n'
796
- op += "--edge / --firefox / --safari (Shortcut for browser selection.)\n"
797
- op += "--headless (Run tests headlessly. Default setting on Linux OS.)\n"
798
- op += "--demo (Slow down and visually see test actions as they occur.)\n"
799
- op += "--slow (Slow down the automation. Faster than using Demo Mode.)\n"
801
+ op += '--browser=BROWSER (Choice of web browser. Default is "chrome")\n'
802
+ op += "--edge / --firefox / --safari (Shortcut for browser selection)\n"
803
+ op += "--headless (Run tests headlessly. Default setting on Linux OS)\n"
804
+ op += "--demo (Slow down and visually see test actions as they occur)\n"
805
+ op += "--slow (Slow down the automation. Faster than using Demo Mode)\n"
800
806
  op += "--rs / --reuse-session (Reuse browser session between tests.)\n"
801
807
  op += "--reuse-class-session / --rcs (RS, but for class tests only.)\n"
802
808
  op += "--crumbs (Clear all cookies between tests reusing a session.)\n"
803
- op += "--maximize (Start tests with the web browser window maximized.)\n"
804
- op += "--dashboard (Enable SeleniumBase's Dashboard at dashboard.html)\n"
809
+ op += "--maximize (Start tests with the browser window maximized)\n"
810
+ op += "--dashboard (Enable SeleniumBase Dashboard at dashboard.html)\n"
805
811
  op += "--incognito (Enable Chromium's Incognito Mode.)\n"
806
812
  op += "--guest (Enable Chromium's Guest Mode.)\n"
807
813
  op += "--dark (Enable Chromium's Dark Mode.)\n"
@@ -813,15 +819,15 @@ def show_options():
813
819
  op += "--collect-only / --co (Only show discovered tests. No run.)\n"
814
820
  op += "--co -q (Only show full names of discovered tests. No run.)\n"
815
821
  op += "-x (Stop running tests after the first failure is reached.)\n"
816
- op += "--pdb (Enter the Post Mortem Debug Mode after any test fails.)\n"
817
- op += "--trace (Enter Debug Mode immediately after starting any test.)\n"
818
- op += " | Debug Mode Commands >>> help / h: List all commands. |\n"
819
- op += " | n: Next line of method. s: Step through. c: Continue. |\n"
820
- op += " | return / r: Run until method returns. j: Jump to line. |\n"
821
- op += " | where / w: Show stack spot. u: Up stack. d: Down stack. |\n"
822
- op += " | longlist / ll: See code. dir(): List namespace objects. |\n"
822
+ op += "--pdb (Enter Post Mortem Debug Mode after any test fails.)\n"
823
+ op += "--trace (Enter Debug Mode immediately after starting tests.)\n"
824
+ op += " | Debug Mode Commands >>> help / h: List all commands. |\n"
825
+ op += " | n: Next line of method. s: Step into. c: Continue. |\n"
826
+ op += " | where / w: Show stack spot. u: Up stack. d: Down stack. |\n"
827
+ op += " | return / r: Run until method returns. j: Jump to line. |\n"
828
+ op += " | longlist / ll: See code. dir(): List namespace objects. |\n"
823
829
  op += "--help / -h (Display list of all available pytest options.)\n"
824
- op += "--ftrace / --final-trace (Enter Debug Mode after any test.)\n"
830
+ op += "--ftrace / --final-trace (Enter Debug Mode after tests end.)\n"
825
831
  op += "--recorder / --rec (Save browser actions as Python scripts.)\n"
826
832
  op += "--rec-behave / --rec-gherkin (Save actions as Gherkin code.)\n"
827
833
  op += "--rec-print (Display recorded scripts when they are created.)\n"
@@ -834,14 +840,14 @@ def show_options():
834
840
  op += '--metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)\n'
835
841
  op += "--ad-block (Block certain types of iframe ads from appearing.)\n"
836
842
  op += "--settings-file=FILE (Override default SeleniumBase settings.)\n"
837
- op += '--env=ENV (Set the test env. Access with "self.env" in tests.)\n'
838
- op += '--data=DATA (Extra test data. Access with "self.data" in tests.)\n'
839
- op += "--disable-csp (Disable the Content Security Policy of websites.)\n"
840
- op += "--remote-debug (Sync to Ch-R-Debugger chrome://inspect/#devices)\n"
843
+ op += '--env=ENV (Set the test env. Use "self.env" to access.)\n'
844
+ op += '--data=DATA (Extra test data. Use "self.data" to access.)\n'
845
+ op += "--disable-csp (Disable the Content Security Policy of sites.)\n"
846
+ op += "--remote-debug (Sync to Ch_Debugger chrome://inspect/#devices)\n"
841
847
  op += "--server=SERVER (The Selenium Grid server/IP used for tests.)\n"
842
848
  op += "--port=PORT (The Selenium Grid port used by the test server.)\n"
843
- op += "--proxy=SERVER:PORT (Connect to a proxy server:port for tests.)\n"
844
- op += "--proxy=USER:PASS@SERVER:PORT (Use authenticated proxy server.)\n"
849
+ op += "--proxy=SERVER:PORT (Connect to a proxy server:port for tests)\n"
850
+ op += "--proxy=USER:PASS@SERVER:PORT (Use authenticated proxy server)\n"
845
851
  op += cr
846
852
  op = op.replace("\n-", "\n" + c1 + "-").replace(" (", cr + " (")
847
853
  op = op.replace(" / -", cr + " / " + c1 + "-")
@@ -851,7 +857,8 @@ def show_options():
851
857
  op = op.replace("Debug Mode Commands", c5 + "Debug Mode Commands" + c3)
852
858
  op = op.replace(">>>", c4 + ">>>" + c3)
853
859
  print(op)
854
- line = "For the full list of " + c2 + "command-line options" + cr
860
+ line = "To view all " + c3 + "pytest" + cr
861
+ line += " " + c2 + "command-line options" + cr
855
862
  line += ', type: "' + c3 + "pytest" + cr + " " + c1 + "--help" + cr + '".'
856
863
  print(line)
857
864
  print("")
@@ -873,14 +880,14 @@ def show_behave_options():
873
880
  line = '(Some options are Chromium-specific, e.g. "-D guest -D mobile")'
874
881
  print(line)
875
882
  op = "\n"
876
- op += '-D browser=BROWSER (The web browser to use. Default is "chrome")\n'
883
+ op += '-D browser=BROWSER (Choice of web browser. Default is "chrome")\n'
877
884
  op += "-D headless (Run tests headlessly. Default mode on Linux OS.)\n"
878
- op += "-D demo (Slow down and visually see test actions as they occur.)\n"
879
- op += "-D slow (Slow down the automation. Faster than using Demo Mode.)\n"
885
+ op += "-D demo (Slow down and visually see test actions as they occur)\n"
886
+ op += "-D slow (Slow down the automation. Faster than using Demo Mode)\n"
880
887
  op += "-D reuse-session / -D rs (Reuse browser session between tests.)\n"
881
888
  op += "-D crumbs (Clear all cookies between tests reusing a session.)\n"
882
- op += "-D maximize (Start tests with the web browser window maximized.)\n"
883
- op += "-D dashboard (Enable SeleniumBase's Dashboard at dashboard.html)\n"
889
+ op += "-D maximize (Start tests with the web browser window maximized)\n"
890
+ op += "-D dashboard (Enable SeleniumBase Dashboard at dashboard.html)\n"
884
891
  op += "-D incognito (Enable Chromium's Incognito Mode.)\n"
885
892
  op += "-D guest (Enable Chromium's Guest Mode.)\n"
886
893
  op += "-D dark (Enable Chromium's Dark Mode.)\n"
@@ -889,11 +896,11 @@ def show_behave_options():
889
896
  op += "--dry-run / -d (Dry run. Only show discovered tests.)\n"
890
897
  op += "--stop (Stop running tests after the first failure is reached.)\n"
891
898
  op += "-D pdb (Enter the Post Mortem Debug Mode after any test fails.)\n"
892
- op += " | Debug Mode Commands >>> help / h: List all commands. |\n"
893
- op += " | n: Next line of method. s: Step through. c: Continue. |\n"
894
- op += " | return / r: Run until method returns. j: Jump to line. |\n"
895
- op += " | where / w: Show stack spot. u: Up stack. d: Down stack. |\n"
896
- op += " | longlist / ll: See code. dir(): List namespace objects. |\n"
899
+ op += " | Debug Mode Commands >>> help / h: List all commands. |\n"
900
+ op += " | n: Next line of method. s: Step through. c: Continue. |\n"
901
+ op += " | return / r: Run until method returns. j: Jump to line. |\n"
902
+ op += " | where / w: Show stack spot. u: Up stack. d: Down stack. |\n"
903
+ op += " | longlist / ll: See code. dir(): List namespace objects. |\n"
897
904
  op += "-D recorder (Record browser actions to generate test scripts.)\n"
898
905
  op += "-D rec-print (Display recorded scripts when they are created.)\n"
899
906
  op += "-D save-screenshot (Save a screenshot at the end of each test.)\n"
@@ -905,14 +912,14 @@ def show_behave_options():
905
912
  op += '-D metrics=STRING (Set mobile "CSSWidth,CSSHeight,PixelRatio".)\n'
906
913
  op += "-D ad-block (Block some types of display ads after page loads.)\n"
907
914
  op += "-D settings-file=FILE (Override default SeleniumBase settings.)\n"
908
- op += '-D env=ENV (Set the test env. Access using "self.env" in tests.)\n'
915
+ op += '-D env=ENV (Set the test env. Access using "self.env" in tests)\n'
909
916
  op += '-D data=DATA (Extra test data. Access using "self.data".)\n'
910
917
  op += "-D disable-csp (Disable the Content Security Policy of sites.)\n"
911
918
  op += "-D remote-debug (Sync Ch-R-Debugger chrome://inspect/#devices)\n"
912
919
  op += "-D server=SERVER (The Selenium Grid server/IP used for tests.)\n"
913
920
  op += "-D port=PORT (The Selenium Grid port used by the test server.)\n"
914
- op += "-D proxy=SERVER:PORT (Connect to a proxy server:port for tests.)\n"
915
- op += "-D proxy=USER:PASS@SERVER:PORT (Use authenticated proxy server.)\n"
921
+ op += "-D proxy=SERVER:PORT (Connect to a proxy server:port for tests)\n"
922
+ op += "-D proxy=USER:PASS@SERVER:PORT (Use authenticated proxy server)\n"
916
923
  op += cr
917
924
  op = op.replace("\n-", "\n" + c1 + "-").replace(" (", cr + " (")
918
925
  op = op.replace(" / -", cr + " / " + c1 + "-")
@@ -934,7 +941,7 @@ def show_detailed_help():
934
941
  c6 = colorama.Back.CYAN
935
942
  cr = colorama.Style.RESET_ALL
936
943
  show_basic_usage()
937
- print(c6 + " " + c2 + " Commands: " + c6 + " ")
944
+ print(c6 + " " + c2 + " Commands: " + c6 + " ")
938
945
  print(cr)
939
946
  show_install_usage()
940
947
  show_commander_usage()
@@ -959,7 +966,10 @@ def show_detailed_help():
959
966
  show_download_usage()
960
967
  show_grid_hub_usage()
961
968
  show_grid_node_usage()
962
- print('* (Use "' + c3 + "pytest" + cr + '" for running tests) *\n')
969
+ print(
970
+ '* (Use "' + c3 + "pytest" + cr + '" or "' + c3 + ''
971
+ '' + "python" + cr + '" for running tests) *\n'
972
+ )
963
973
 
964
974
 
965
975
  def main():
@@ -967,7 +977,7 @@ def main():
967
977
  command_args = None
968
978
  num_args = len(sys.argv)
969
979
  if num_args == 1:
970
- show_usage()
980
+ show_basic_usage()
971
981
  return
972
982
  elif num_args == 2:
973
983
  command = sys.argv[1]
@@ -1195,7 +1205,7 @@ def main():
1195
1205
  else:
1196
1206
  show_basic_usage()
1197
1207
  show_grid_node_usage()
1198
- elif command == "version" or command == "--version":
1208
+ elif command == "version" or command == "--version" or command == "-v":
1199
1209
  if len(command_args) == 0:
1200
1210
  from seleniumbase.console_scripts import logo_helper
1201
1211
 
@@ -1231,7 +1241,7 @@ def main():
1231
1241
  "proxy.py", version=constants.ProxyPy.VER
1232
1242
  )
1233
1243
  os.system("proxy %s" % " ".join(sys.argv[2:]))
1234
- elif command == "help" or command == "--help":
1244
+ elif command == "help" or command == "--help" or command == "-h":
1235
1245
  if len(command_args) >= 1:
1236
1246
  if command_args[0] == "get":
1237
1247
  print("")
@@ -1355,7 +1365,7 @@ def main():
1355
1365
  return
1356
1366
  show_detailed_help()
1357
1367
  else:
1358
- show_usage()
1368
+ show_basic_usage()
1359
1369
  c5 = colorama.Fore.RED + colorama.Back.LIGHTYELLOW_EX
1360
1370
  c7 = colorama.Fore.BLACK + colorama.Back.MAGENTA
1361
1371
  cr = colorama.Style.RESET_ALL