def setup_local_browser(context):
 profile = webdriver.FirefoxProfile()
 if ('download_csv' in context.tags):
  context.download_dir = tempfile.mkdtemp()
  profile.set_preference('browser.download.folderList', 2)
  profile.set_preference('browser.download.manager.showWhenStarting', False)
  profile.set_preference('browser.download.dir', context.download_dir)
  profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/csv')
 context.browser = webdriver.Firefox(firefox_profile=profile)

def setup_local_browser ( context ) : profile = webdriver . FirefoxProfile ( ) if ( 'download_csv' in context . tags ) : context . download_dir = tempfile . mkdtemp ( ) profile . set_preference ( 'browser.download.folderList' , 2 ) profile . set_preference ( 'browser.download.manager.showWhenStarting' , False ) profile . set_preference ( 'browser.download.dir' , context . download_dir ) profile . set_preference ( 'browser.helperApps.neverAsk.saveToDisk' , 'text/csv' ) context . browser = webdriver . Firefox ( firefox_profile = profile )
use local webdriver .