summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <me@the-compiler.org>2021-03-12 17:59:01 +0100
committerFlorian Bruhin <me@the-compiler.org>2021-03-12 18:01:17 +0100
commit861ee80371f88b04ce0af75581d84c30af4a4be0 (patch)
treebe95ea801d9f28edb57219ddd963fa9978e21f76
parent366bbe3f1116637195e9f273f67fce204add0a79 (diff)
downloadqutebrowser-861ee80371f88b04ce0af75581d84c30af4a4be0.tar.gz
qutebrowser-861ee80371f88b04ce0af75581d84c30af4a4be0.zip
tests: Number screenshots for every test
-rw-r--r--tests/end2end/fixtures/quteprocess.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py
index cd60a3439..0106572a6 100644
--- a/tests/end2end/fixtures/quteprocess.py
+++ b/tests/end2end/fixtures/quteprocess.py
@@ -29,6 +29,7 @@ import logging
import tempfile
import contextlib
import itertools
+import collections
import json
import yaml
@@ -453,6 +454,7 @@ class QuteProc(testprocess.Process):
self.basedir = None
self._instance_id = next(instance_counter)
self._run_counter = itertools.count()
+ self._screenshot_counters = collections.defaultdict(itertools.count)
def _process_line(self, log_line):
"""Check if the line matches any initial lines we're interested in."""
@@ -902,8 +904,10 @@ class QuteProc(testprocess.Process):
"""
for _ in range(5):
tmp_path = self.request.getfixturevalue('tmp_path')
- path = tmp_path / 'screenshot.png'
- self.send_cmd(f':screenshot --force {path}')
+ counter = self._screenshot_counters[self.request.node.nodeid]
+
+ path = tmp_path / f'screenshot-{next(counter)}.png'
+ self.send_cmd(f':screenshot {path}')
screenshot_msg = f'Screenshot saved to {path}'
self.wait_for(message=screenshot_msg)