Skip to content

Commit a5f6e25

Browse files
authored
Merge pull request #341 from seleniumbase/multiple-chrome-extensions
Allow a comma-separated list of Chrome extensions to use
2 parents aafb66b + e54a067 commit a5f6e25

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

help_docs/customizing_test_runs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ In addition to [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/m
77
* Choose whether to enter Debug Mode on failures
88
* Choose additional variables to pass into tests
99
* Choose the User-Agent for the browser to use
10-
* Change the automation speed (with Demo Mode)
10+
* Choose the automation speed (with Demo Mode)
1111
* Choose whether to run tests multi-threaded
1212
* Choose whether to retry failing tests
13+
* Choose a Chrome User Data Directory to use
14+
* Choose a Chrome Extension to load
1315
* Choose a BrowserStack server to run on
1416
* Choose a Sauce Labs server to run on
1517
* Choose a TestingBot server to run on

help_docs/features_list.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
* Can run tests through a proxy server. (Use ``--proxy=IP_ADDRESS:PORT``)
1515
* Can use an authenticated proxy server. (``--proxy=USERNAME:PASSWORD@IP_ADDRESS:PORT``)
1616
* Can change the web browser's user agent string. (Use ``--agent=USER_AGENT_STRING``)
17+
* Can set a Chrome User Data Directory / Profile to load. (Use ``--user_data_dir=DIR``)
18+
* Can load Chrome Extension ZIP files (comma-separated). (Use ``--extension_zip=ZIP``)
19+
* Can load Chrome Extension folders (comma-separated). (Use ``--extension_dir=DIR``)
1720
* Can handle Google Authenticator logins by using the [Python one-time password library](https://pyotp.readthedocs.io/en/latest/).
1821
* Includes a hybrid-automation solution called **[MasterQA](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/masterqa/ReadMe.md)** to speed up manual testing.
1922
* Integrates with [MySQL](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/core/testcase_manager.py), [Selenium Grid](https://github.com/seleniumbase/SeleniumBase/tree/master/seleniumbase/utilities/selenium_grid), [Azure](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/azure/jenkins/ReadMe.md), [Google Cloud](https://github.com/seleniumbase/SeleniumBase/tree/master/integrations/google_cloud/ReadMe.md), [Amazon S3](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/s3_logging_plugin.py), and [Docker](https://github.com/seleniumbase/SeleniumBase/blob/master/integrations/docker/ReadMe.md).

seleniumbase/core/browser_launcher.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ def _set_chrome_options(
117117
abs_path = os.path.abspath(user_data_dir)
118118
chrome_options.add_argument("user-data-dir=%s" % abs_path)
119119
if extension_zip:
120-
abs_path = os.path.abspath(extension_zip)
121-
chrome_options.add_extension(abs_path)
120+
extension_zip_list = extension_zip.split(',')
121+
for extension_zip_item in extension_zip_list:
122+
abs_path = os.path.abspath(extension_zip_item)
123+
chrome_options.add_extension(abs_path)
122124
if extension_dir:
125+
# load-extension input can be a comma-separated list
123126
abs_path = os.path.abspath(extension_dir)
124127
chrome_options.add_argument("--load-extension=%s" % abs_path)
125128
chrome_options.add_argument("--test-type")

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
setup(
1919
name='seleniumbase',
20-
version='1.25.0',
20+
version='1.25.1',
2121
description='Reliable Browser Automation & Testing Framework',
2222
long_description=long_description,
2323
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)