Skip to content

Commit 81b2553

Browse files
committed
Add --cap_file command line option for desired capabilities
1 parent 6498607 commit 81b2553

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2606,6 +2606,7 @@ def setUp(self):
26062606
self.servername = pytest.config.option.servername
26072607
self.port = pytest.config.option.port
26082608
self.proxy_string = pytest.config.option.proxy_string
2609+
self.cap_file = pytest.config.option.cap_file
26092610
self.database_env = pytest.config.option.database_env
26102611
self.log_path = pytest.config.option.log_path
26112612
self.browser = pytest.config.option.browser

seleniumbase/plugins/pytest_plugin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ def pytest_addoption(parser):
3939
parser.addoption('--data', dest='data',
4040
default=None,
4141
help='Extra data to pass from the command line.')
42+
parser.addoption('--cap_file', dest='cap_file',
43+
default=None,
44+
help="""The file that stores browser desired capabilities
45+
for BrowserStack or Sauce Labs web drivers.""")
4246
parser.addoption('--with-testing_base', action="store_true",
4347
dest='with_testing_base',
4448
default=True,

seleniumbase/plugins/selenium_plugin.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ def options(self, parser, env):
4747
default="latest",
4848
help="""The browser version to use. Explicitly select
4949
a version number or use "latest".""")
50+
parser.add_option(
51+
'--cap_file', action='store',
52+
dest='cap_file',
53+
default=None,
54+
help="""The file that stores browser desired capabilities
55+
for BrowserStack or Sauce Labs web drivers.""")
5056
parser.add_option(
5157
'--server', action='store', dest='servername',
5258
default='localhost',
@@ -122,6 +128,7 @@ def configure(self, options, conf):
122128

123129
def beforeTest(self, test):
124130
test.test.browser = self.options.browser
131+
test.test.cap_file = self.options.cap_file
125132
test.test.headless = self.options.headless
126133
test.test.servername = self.options.servername
127134
test.test.port = self.options.port

0 commit comments

Comments
 (0)