#NEWLINE# def _capabilities_dict( envs , tags ) : #NEWLINE# #INDENT# '\n    Convert the dictionary of environment variables to\n    a dictionary of desired capabilities to send to the\n    Remote WebDriver.\n\n    `tags` is a list of string tags to apply to the SauceLabs job.\n    ' #NEWLINE# capabilities = { #NEWLINE# #INDENT# 'browserName' : envs [ 'SELENIUM_BROWSER' ] , #NEWLINE# 'video-upload-on-pass' : False , #NEWLINE# 'sauce-advisor' : False , #NEWLINE# 'capture-html' : True , #NEWLINE# 'record-screenshots' : True , #NEWLINE# 'max-duration' : 600 , #NEWLINE# 'public' : 'public restricted' , #NEWLINE# 'tags' : tags , #NEWLINE# #UNINDENT# } #NEWLINE# if _use_remote_browser ( SAUCE_ENV_VARS ) : #NEWLINE# #INDENT# sauce_capabilities = { #NEWLINE# #INDENT# 'platform' : envs [ 'SELENIUM_PLATFORM' ] , #NEWLINE# 'version' : envs [ 'SELENIUM_VERSION' ] , #NEWLINE# 'username' : envs [ 'SAUCE_USER_NAME' ] , #NEWLINE# 'accessKey' : envs [ 'SAUCE_API_KEY' ] , #NEWLINE# #UNINDENT# } #NEWLINE# capabilities . update ( sauce_capabilities ) #NEWLINE# #UNINDENT# if ( 'JOB_NAME' in envs ) : #NEWLINE# #INDENT# jenkins_vars = { #NEWLINE# #INDENT# 'build' : envs [ 'BUILD_NUMBER' ] , #NEWLINE# 'name' : envs [ 'JOB_NAME' ] , #NEWLINE# #UNINDENT# } #NEWLINE# capabilities . update ( jenkins_vars ) #NEWLINE# #UNINDENT# return capabilities