Skip to content
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.

Commit

Permalink
Merge pull request #26 from Gagnavarslan/browser-console-log
Browse files Browse the repository at this point in the history
Support for browser console/errors log retrieval
  • Loading branch information
sbernatsky authored Jul 25, 2018
2 parents 86c23ba + 6e2f6f2 commit d1285ed
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/sst/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#


__version__ = '0.2.9.5'
__version__ = '0.2.9.6'

DEVSERVER_PORT = 8120 # django devserver for internal acceptance tests

Expand Down
4 changes: 4 additions & 0 deletions src/sst/actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1790,3 +1790,7 @@ def get_element_source(id_or_elem):
"""
elem = _get_elem(id_or_elem)
return elem.get_attribute('innerHTML')


def get_browser_log():
return _test.browser.get_log('browser')
12 changes: 10 additions & 2 deletions src/sst/browsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from selenium import webdriver
from selenium.common import exceptions as selenium_exceptions
from selenium.webdriver.common import utils
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.firefox import (
firefox_binary,
webdriver as ff_webdriver,
Expand Down Expand Up @@ -83,6 +84,11 @@ class ChromeFactory(BrowserFactory):

webdriver_class = webdriver.Chrome

def browser(self):
desired = DesiredCapabilities.CHROME
desired['loggingPrefs'] = { 'browser':'ALL' }
return self.webdriver_class(self.profile, capabilities=desired)


# MISSINGTEST: Exercise this class (requires windows) -- vila 2013-04-11
class IeFactory(BrowserFactory):
Expand All @@ -94,7 +100,7 @@ class IeFactory(BrowserFactory):
class PhantomJSFactory(BrowserFactory):

webdriver_class = webdriver.PhantomJS

def browser(self):
return self.webdriver_class(service_args=['--ignore-ssl-errors=true'])

Expand Down Expand Up @@ -209,7 +215,9 @@ def setup_for_test(self, test):
self.profile = profile

def browser(self):
return self.webdriver_class(self.profile)
desired = DesiredCapabilities.FIREFOX
desired['loggingPrefs'] = { 'browser':'ALL' }
return self.webdriver_class(self.profile, capabilities=desired)


# MISSINGTEST: Exercise this class -- vila 2013-04-11
Expand Down

0 comments on commit d1285ed

Please sign in to comment.