Skip to content

Commit 951b3a9

Browse files
carlosgcamposAutomatedTester
authored andcommitted
[py] make it possible to override options when running tests with WebKitGTK+
This allows to run the tests with a driver in a different path instead of the installed one. The same way it allows to use a different browser or provide specific browser options. This is controlled by three optional environment variables WD_DRIVER_PATH, WD_BROWSER_PATH and WD_BROWSER_ARGS.
1 parent cea9724 commit 951b3a9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

py/conftest.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,17 @@ def fin():
110110
additional_args = {}
111111
options = webdriver.WebKitGTKOptions()
112112
options.overlay_scrollbars_enabled = False
113+
browser_path = os.environ.get('WD_BROWSER_PATH')
114+
if browser_path is not None:
115+
options.browser_executable_path = browser_path
116+
browser_args = os.environ.get('WD_BROWSER_ARGS')
117+
if browser_args is not None:
118+
for arg in browser_args.split():
119+
options.add_browser_argument(arg)
113120
additional_args['options'] = options
121+
driver_path = os.environ.get('WD_DRIVER_PATH')
122+
if driver_path is not None:
123+
additional_args['executable_path'] = driver_path
114124
kwargs.update(additional_args)
115125
driver_instance = getattr(webdriver, driver_class)(**kwargs)
116126
yield driver_instance

0 commit comments

Comments
 (0)