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

Support for browser console/errors log retrieval #26

Merged
merged 2 commits into from
Jul 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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