Skip to content

Commit c787eae

Browse files
committed
Setting the platform at browser capabilities from an environment variable.
This allows the saucelabs to run the browser in the desired OS.
1 parent 71972b3 commit c787eae

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codebender_testing/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,16 @@ def create_webdriver(command_executor, desired_capabilities):
139139
# Fill in defaults from DesiredCapabilities.{CHROME,FIREFOX} if they are
140140
# missing from the desired_capabilities dict above.
141141
_capabilities = desired_capabilities
142+
platform = os.getenv('SELENIUM_PLATFORM', None)
143+
if platform:
144+
_capabilities['platform'] = platform
142145
browser_profile = None
143146
browser_profile_path = None
144147

145148
SELENIUM_BROWSER = browser_name
146149

147150
if browser_name == "chrome":
148151
desired_capabilities = DesiredCapabilities.CHROME.copy()
149-
desired_capabilities.update(_capabilities)
150152
options = chrome.options.Options()
151153
browser_profile_path = os.path.join('/tmp', _get_chrome_profile())
152154
options.add_argument('--user-data-dir=' + browser_profile_path)

0 commit comments

Comments
 (0)