1212def pytest_addoption (parser ):
1313 parser = parser .getgroup ('SeleniumBase' ,
1414 'SeleniumBase specific configuration options' )
15- parser .addoption ('--browser' , action = "store" ,
15+ parser .addoption ('--browser' ,
16+ action = "store" ,
1617 dest = 'browser' ,
1718 type = str .lower ,
1819 choices = constants .ValidBrowsers .valid_browsers ,
1920 default = constants .Browser .GOOGLE_CHROME ,
2021 help = """Specifies the web browser to use. Default: Chrome.
2122 If you want to use Firefox, explicitly indicate that.
2223 Example: (--browser=firefox)""" )
23- parser .addoption ('--with-selenium' , action = "store_true" ,
24+ parser .addoption ('--with-selenium' ,
25+ action = "store_true" ,
2426 dest = 'with_selenium' ,
2527 default = True ,
2628 help = "Use if tests need to be run with a web browser." )
27- parser .addoption ('--env' , action = 'store' ,
29+ parser .addoption ('--env' ,
30+ action = 'store' ,
2831 dest = 'environment' ,
2932 type = str .lower ,
3033 choices = (
@@ -38,18 +41,22 @@ def pytest_addoption(parser):
3841 ),
3942 default = constants .Environment .TEST ,
4043 help = "The environment to run the tests in." )
41- parser .addoption ('--data' , dest = 'data' ,
44+ parser .addoption ('--data' ,
45+ dest = 'data' ,
4246 default = None ,
4347 help = 'Extra data to pass from the command line.' )
44- parser .addoption ('--cap_file' , dest = 'cap_file' ,
48+ parser .addoption ('--cap_file' , '--cap-file' ,
49+ dest = 'cap_file' ,
4550 default = None ,
4651 help = """The file that stores browser desired capabilities
4752 for BrowserStack or Sauce Labs web drivers.""" )
48- parser .addoption ('--user_data_dir' , dest = 'user_data_dir' ,
53+ parser .addoption ('--user_data_dir' , '--user-data-dir' ,
54+ dest = 'user_data_dir' ,
4955 default = None ,
5056 help = """The Chrome User Data Directory to use. (Profile)
5157 If the directory doesn't exist, it'll be created.""" )
52- parser .addoption ('--with-testing_base' , action = "store_true" ,
58+ parser .addoption ('--with-testing_base' , '--with-testing-base' ,
59+ action = "store_true" ,
5360 dest = 'with_testing_base' ,
5461 default = True ,
5562 help = """Use to save logs and screenshots when tests fail.
@@ -59,55 +66,66 @@ def pytest_addoption(parser):
5966 --with-basic_test_info ,
6067 --with-page_source
6168 """ )
62- parser .addoption ('--log_path' , dest = 'log_path' ,
69+ parser .addoption ('--log_path' , '--log-path' ,
70+ dest = 'log_path' ,
6371 default = 'latest_logs/' ,
6472 help = 'Where the log files are saved.' )
65- parser .addoption ('--archive_logs' , action = "store_true" ,
73+ parser .addoption ('--archive_logs' , '--archive-logs' ,
74+ action = "store_true" ,
6675 dest = 'archive_logs' ,
6776 default = False ,
6877 help = "Archive old log files instead of deleting them." )
69- parser .addoption ('--with-db_reporting' , action = "store_true" ,
78+ parser .addoption ('--with-db_reporting' , '--with-db-reporting' ,
79+ action = "store_true" ,
7080 dest = 'with_db_reporting' ,
7181 default = False ,
7282 help = "Use to record test data in the MySQL database." )
73- parser .addoption ('--database_env' , action = 'store' ,
83+ parser .addoption ('--database_env' , '--database-env' ,
84+ action = 'store' ,
7485 dest = 'database_env' ,
7586 choices = (
7687 'production' , 'qa' , 'staging' , 'develop' ,
7788 'test' , 'local' , 'master'
7889 ),
7990 default = 'test' ,
8091 help = optparse .SUPPRESS_HELP )
81- parser .addoption ('--with-s3_logging' , action = "store_true" ,
92+ parser .addoption ('--with-s3_logging' , '--with-s3-logging' ,
93+ action = "store_true" ,
8294 dest = 'with_s3_logging' ,
8395 default = False ,
8496 help = "Use to save test log files in Amazon S3." )
85- parser .addoption ('--with-screen_shots' , action = "store_true" ,
97+ parser .addoption ('--with-screen_shots' , '--with-screen-shots' ,
98+ action = "store_true" ,
8699 dest = 'with_screen_shots' ,
87100 default = False ,
88101 help = """Use to save screenshots on test failure.
89102 (Automatically on when using --with-testing_base)""" )
90- parser .addoption ('--with-basic_test_info' , action = "store_true" ,
103+ parser .addoption ('--with-basic_test_info' , '--with-basic-test-info' ,
104+ action = "store_true" ,
91105 dest = 'with_basic_test_info' ,
92106 default = False ,
93107 help = """Use to save basic test info on test failure.
94108 (Automatically on when using --with-testing_base)""" )
95- parser .addoption ('--with-page_source' , action = "store_true" ,
109+ parser .addoption ('--with-page_source' , '--with-page-source' ,
110+ action = "store_true" ,
96111 dest = 'with_page_source' ,
97112 default = False ,
98113 help = """Use to save page source on test failure.
99114 (Automatically on when using --with-testing_base)""" )
100- parser .addoption ('--server' , action = 'store' ,
115+ parser .addoption ('--server' ,
116+ action = 'store' ,
101117 dest = 'servername' ,
102118 default = 'localhost' ,
103119 help = """Designates the Selenium Grid server to use.
104120 Default: localhost.""" )
105- parser .addoption ('--port' , action = 'store' ,
121+ parser .addoption ('--port' ,
122+ action = 'store' ,
106123 dest = 'port' ,
107124 default = '4444' ,
108125 help = """Designates the Selenium Grid port to use.
109126 Default: 4444.""" )
110- parser .addoption ('--proxy' , action = 'store' ,
127+ parser .addoption ('--proxy' ,
128+ action = 'store' ,
111129 dest = 'proxy_string' ,
112130 default = None ,
113131 help = """Designates the proxy server:port to use.
@@ -121,64 +139,79 @@ def pytest_addoption(parser):
121139 help = """Designates the User-Agent for the browser to use.
122140 Format: A string.
123141 Default: None.""" )
124- parser .addoption ('--extension_zip' , action = 'store' ,
142+ parser .addoption ('--extension_zip' , '--extension-zip' ,
143+ action = 'store' ,
125144 dest = 'extension_zip' ,
126145 default = None ,
127146 help = """Designates the Chrome Extension ZIP file to load.
128147 Format: A comma-separated list of .zip or .crx files
129148 containing the Chrome extensions to load.
130149 Default: None.""" )
131- parser .addoption ('--extension_dir' , action = 'store' ,
150+ parser .addoption ('--extension_dir' , '--extension-dir' ,
151+ action = 'store' ,
132152 dest = 'extension_dir' ,
133153 default = None ,
134154 help = """Designates the Chrome Extension folder to load.
135155 Format: A directory containing the Chrome extension.
136156 (Can also be a comma-separated list of directories.)
137157 Default: None.""" )
138- parser .addoption ('--headless' , action = "store_true" ,
158+ parser .addoption ('--headless' ,
159+ action = "store_true" ,
139160 dest = 'headless' ,
140161 default = False ,
141162 help = """Using this makes Webdriver run headlessly,
142163 which is required on headless machines.""" )
143- parser .addoption ('--is_pytest' , action = "store_true" ,
164+ parser .addoption ('--is_pytest' , '--is-pytest' ,
165+ action = "store_true" ,
144166 dest = 'is_pytest' ,
145167 default = True ,
146168 help = """This is used by the BaseCase class to tell apart
147169 pytest runs from nosetest runs. (Automatic)""" )
148- parser .addoption ('--demo_mode' , action = "store_true" ,
170+ parser .addoption ('--demo_mode' , '--demo-mode' ,
171+ action = "store_true" ,
149172 dest = 'demo_mode' ,
150173 default = False ,
151174 help = """Using this slows down the automation so that
152175 you can see what it's actually doing.""" )
153- parser .addoption ('--demo_sleep' , action = 'store' , dest = 'demo_sleep' ,
176+ parser .addoption ('--demo_sleep' , '--demo-sleep' ,
177+ action = 'store' ,
178+ dest = 'demo_sleep' ,
154179 default = None ,
155180 help = """Setting this overrides the Demo Mode sleep
156181 time that happens after browser actions.""" )
157- parser .addoption ('--highlights' , action = 'store' , dest = 'highlights' ,
182+ parser .addoption ('--highlights' ,
183+ action = 'store' ,
184+ dest = 'highlights' ,
158185 default = None ,
159186 help = """Setting this overrides the default number of
160187 highlight animation loops to have per call.""" )
161- parser .addoption ('--message_duration' , action = "store" ,
188+ parser .addoption ('--message_duration' , '--message-duration' ,
189+ action = "store" ,
162190 dest = 'message_duration' ,
163191 default = None ,
164192 help = """Setting this overrides the default time that
165193 messenger notifications remain visible when reaching
166194 assert statements during Demo Mode.""" )
167- parser .addoption ('--check_js' , action = "store_true" ,
195+ parser .addoption ('--check_js' , '--check-js' ,
196+ action = "store_true" ,
168197 dest = 'js_checking_on' ,
169198 default = False ,
170199 help = """The option to check for JavaScript errors after
171200 every page load.""" )
172- parser .addoption ('--ad_block' , action = "store_true" ,
201+ parser .addoption ('--ad_block' , '--ad-block' ,
202+ action = "store_true" ,
173203 dest = 'ad_block_on' ,
174204 default = False ,
175205 help = """Using this makes WebDriver block display ads
176206 that are defined in ad_block_list.AD_BLOCK_LIST.""" )
177- parser .addoption ('--verify_delay' , action = 'store' , dest = 'verify_delay' ,
207+ parser .addoption ('--verify_delay' , '--verify-delay' ,
208+ action = 'store' ,
209+ dest = 'verify_delay' ,
178210 default = None ,
179211 help = """Setting this overrides the default wait time
180212 before each MasterQA verification pop-up.""" )
181- parser .addoption ('--disable_csp' , action = "store_true" ,
213+ parser .addoption ('--disable_csp' , '--disable-csp' ,
214+ action = "store_true" ,
182215 dest = 'disable_csp' ,
183216 default = False ,
184217 help = """Using this disables the Content Security Policy of
@@ -187,23 +220,27 @@ def pytest_addoption(parser):
187220 libraries for various testing actions.
188221 Setting this to True (--disable_csp) overrides the
189222 value set in seleniumbase/config/settings.py""" )
190- parser .addoption ('--enable_sync' , action = "store_true" ,
223+ parser .addoption ('--enable_sync' , '--enable-sync' ,
224+ action = "store_true" ,
191225 dest = 'enable_sync' ,
192226 default = False ,
193227 help = """Using this enables the "Chrome Sync" feature.""" )
194- parser .addoption ('--save_screenshot' , action = 'store_true' ,
228+ parser .addoption ('--save_screenshot' , '--save-screenshot' ,
229+ action = 'store_true' ,
195230 dest = 'save_screenshot' ,
196231 default = False ,
197232 help = """Take a screenshot on last page after the last step
198233 of the test. (Added to the "latest_logs" folder.)""" )
199- parser .addoption ('--visual_baseline' , action = 'store_true' ,
234+ parser .addoption ('--visual_baseline' , '--visual-baseline' ,
235+ action = 'store_true' ,
200236 dest = 'visual_baseline' ,
201237 default = False ,
202238 help = """Setting this resets the visual baseline for
203239 Automated Visual Testing with SeleniumBase.
204240 When a test calls self.check_window(), it will
205241 rebuild its files in the visual_baseline folder.""" )
206- parser .addoption ('--timeout_multiplier' , action = 'store' ,
242+ parser .addoption ('--timeout_multiplier' , '--timeout-multiplier' ,
243+ action = 'store' ,
207244 dest = 'timeout_multiplier' ,
208245 default = None ,
209246 help = """Setting this overrides the default timeout
0 commit comments