bdd: Add sections to log

See #1418
This commit is contained in:
Florian Bruhin 2016-04-20 07:16:56 +02:00
parent 5c97ec1659
commit 1579f27564
3 changed files with 11 additions and 0 deletions

View File

@ -180,6 +180,7 @@ def wait_in_log(quteproc, is_regex, pattern, do_skip):
r'"(?P<message>.*)"'))
def wait_for_message(quteproc, httpbin, category, message):
"""Wait for a given statusbar message/error/warning."""
quteproc.log_summary('Waiting for {} "{}"'.format(category, message))
expect_message(quteproc, httpbin, category, message)

View File

@ -320,6 +320,11 @@ class QuteProc(testprocess.Process):
def send_cmd(self, command, count=None):
"""Send a command to the running qutebrowser instance."""
summary = command
if count is not None:
summary += ' (count {})'.format(count)
self._log_summary(summary)
assert self._ipc_socket is not None
time.sleep(self._delay / 1000)

View File

@ -151,6 +151,11 @@ class Process(QObject):
print(line)
self.captured_log.append(line)
def _log_summary(self, text):
"""Log the given line as summary/title."""
text = '\n{line} {text} {line}\n'.format(line='='*50, text=text)
self._log(text)
def _parse_line(self, line):
"""Parse the given line from the log.