Log document.body in JS tests
This commit is contained in:
parent
85d3d4baba
commit
a5f1022330
@ -46,10 +46,10 @@ class JSTester:
|
|||||||
self.qtbot = qtbot
|
self.qtbot = qtbot
|
||||||
loader = jinja2.FileSystemLoader(os.path.dirname(__file__))
|
loader = jinja2.FileSystemLoader(os.path.dirname(__file__))
|
||||||
self._jinja_env = jinja2.Environment(loader=loader, autoescape=True)
|
self._jinja_env = jinja2.Environment(loader=loader, autoescape=True)
|
||||||
# Make sure logging via JS fails tests
|
# Make sure error logging via JS fails tests
|
||||||
config_stub.val.content.javascript.log = {
|
config_stub.val.content.javascript.log = {
|
||||||
|
'info': 'info',
|
||||||
'error': 'error',
|
'error': 'error',
|
||||||
'info': 'error',
|
|
||||||
'unknown': 'error',
|
'unknown': 'error',
|
||||||
'warning': 'error'
|
'warning': 'error'
|
||||||
}
|
}
|
||||||
|
@ -60,10 +60,12 @@ class StylesheetTester:
|
|||||||
def check_set(self, value, css_style="background-color",
|
def check_set(self, value, css_style="background-color",
|
||||||
document_element="document.body"):
|
document_element="document.body"):
|
||||||
"""Check whether the css in ELEMENT is set to VALUE."""
|
"""Check whether the css in ELEMENT is set to VALUE."""
|
||||||
self.js.run("window.getComputedStyle({}, null)"
|
self.js.run("console.log({document});"
|
||||||
".getPropertyValue('{}');"
|
"window.getComputedStyle({document}, null)"
|
||||||
.format(document_element,
|
".getPropertyValue('{prop}');".format(
|
||||||
javascript.string_escape(css_style)), value)
|
document=document_element,
|
||||||
|
prop=javascript.string_escape(css_style)),
|
||||||
|
value)
|
||||||
|
|
||||||
def check_eq(self, one, two, true=True):
|
def check_eq(self, one, two, true=True):
|
||||||
"""Check if one and two are equal."""
|
"""Check if one and two are equal."""
|
||||||
|
Loading…
Reference in New Issue
Block a user