Skip to content

Commit

Permalink
test: Stop resizing the browser by default with TEST_SHOW_BROWSER
Browse files Browse the repository at this point in the history
Iterating page code and test development or doing screenshots  with
TEST_SHOW_BROWSER is rather unnerving, as most of the page isn't
visible/scrollable due to the fixed sizing. Stop this, and go back to
the old behavior where the browser uses its actual window size.

The only corner case is to watch the browser while doing assert_pixels()
development. Support that with `TEST_SHOW_BROWSER=pixels`.
  • Loading branch information
martinpitt committed Jun 27, 2022
1 parent 44b15ea commit a7ab76c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ You can set these environment variables to configure the test suite:
"chromium" is the default.

TEST_SHOW_BROWSER Set to run browser interactively. When not specified,
browser is run in headless mode.
browser is run in headless mode. When set to "pixels",
the browser will be resized to the exact dimensions that
are used for pixel tests.

TEST_TIMEOUT_FACTOR Scale normal timeouts by given integer. Useful for
slow/busy testbeds or architectures.
Expand Down
2 changes: 1 addition & 1 deletion test/common/testlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def open(self, href, cookie=None, tls=False):
schema = tls and "https" or "http"
href = "%s://%s:%s%s" % (schema, self.address, self.port, href)

if not self.current_layout:
if not self.current_layout and os.environ.get("TEST_SHOW_BROWSER") in [None, "pixels"]:
self.current_layout = self.layouts[0]
size = self.current_layout["shell_size"]
self._set_window_size(size[0], size[1])
Expand Down

0 comments on commit a7ab76c

Please sign in to comment.