Skip to content

Commit

Permalink
Restore tests for logs in HTML report
Browse files Browse the repository at this point in the history
  • Loading branch information
davehunt committed Mar 16, 2018
1 parent a673ca2 commit 49ad6a9
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions testing/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
URL_LINK = '<a class="url" href="{0}/" target="_blank">URL</a>'
SCREENSHOT_LINK_REGEX = '<a class="image" href=".*" target="_blank">Screenshot</a>' # noqa
SCREENSHOT_REGEX = '<div class="image"><a href=".*"><img src=".*"/></a></div>'
# LOGS_REGEX = '<a class="text" href=".*" target="_blank">.* Log</a>'
LOGS_REGEX = '<a class="text" href=".*" target="_blank">.* Log</a>'
HTML_REGEX = '<a class="text" href=".*" target="_blank">HTML</a>'


Expand Down Expand Up @@ -46,13 +46,13 @@ def test_capture_debug(webtext):
assert URL_LINK.format(httpserver.url) in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
# assert re.search(LOGS_REGEX, html) is not None
assert re.search(LOGS_REGEX, html) is not None
assert re.search(HTML_REGEX, html) is not None
else:
assert URL_LINK.format(httpserver.url) not in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
assert re.search(SCREENSHOT_REGEX, html) is None
# assert re.search(LOGS_REGEX, html) is None
assert re.search(LOGS_REGEX, html) is None
assert re.search(HTML_REGEX, html) is None


Expand All @@ -74,13 +74,13 @@ def test_capture_debug(webtext):
assert URL_LINK.format(httpserver.url) in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None
# assert re.search(LOGS_REGEX, html) is not None
assert re.search(LOGS_REGEX, html) is not None
assert re.search(HTML_REGEX, html) is not None
else:
assert URL_LINK.format(httpserver.url) not in html
assert re.search(SCREENSHOT_LINK_REGEX, html) is None
assert re.search(SCREENSHOT_REGEX, html) is None
# assert re.search(LOGS_REGEX, html) is None
assert re.search(LOGS_REGEX, html) is None
assert re.search(HTML_REGEX, html) is None


Expand All @@ -103,10 +103,10 @@ def test_exclude_debug_env(testdir, httpserver, monkeypatch, exclude):
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None

# if exclude == 'logs':
# assert re.search(LOGS_REGEX, html) is None
# else:
# assert re.search(LOGS_REGEX, html) is not None
if exclude == 'logs':
assert re.search(LOGS_REGEX, html) is None
else:
assert re.search(LOGS_REGEX, html) is not None

if exclude == 'html':
assert re.search(HTML_REGEX, html) is None
Expand Down Expand Up @@ -136,10 +136,10 @@ def test_exclude_debug_config(testdir, httpserver, monkeypatch, exclude):
assert re.search(SCREENSHOT_LINK_REGEX, html) is not None
assert re.search(SCREENSHOT_REGEX, html) is not None

# if exclude == 'logs':
# assert re.search(LOGS_REGEX, html) is None
# else:
# assert re.search(LOGS_REGEX, html) is not None
if exclude == 'logs':
assert re.search(LOGS_REGEX, html) is None
else:
assert re.search(LOGS_REGEX, html) is not None

if exclude == 'html':
assert re.search(HTML_REGEX, html) is None
Expand Down

0 comments on commit 49ad6a9

Please sign in to comment.