Bug 1478368 - [wdspec] Use a default window size of 800x600. r=ato

Previously we set this window size when restoring all default
values for a session during test teardown. Which means that
the very first test after the browser has been started will
run with the browser window default size.

This change enforces that all tests use the default window
size of 800x600.

MozReview-Commit-ID: Kiog3Ri2RJT

--HG--
extra : rebase_source : 971c1a17cdcc97d7880db8d8bdd50314369a2a91
This commit is contained in:
Henrik Skupin 2018-07-26 14:55:04 +02:00
parent f221ebee1f
commit 666279a900

View File

@ -19,6 +19,7 @@ default_script_timeout = 30
default_page_load_timeout = 300
default_implicit_wait_timeout = 0
default_window_size = (800, 600)
_current_session = None
_custom_session = False
@ -72,7 +73,7 @@ def cleanup_session(session):
This also includes bringing it out of maximized, minimized,
or fullscreened state.
"""
session.window.size = (800, 600)
session.window.size = default_window_size
@ignore_exceptions
def _restore_windows(session):
@ -213,6 +214,9 @@ def session(capabilities, configuration, request):
if not _current_session.session_id:
raise
# Enforce a fixed default window size
_current_session.window.size = default_window_size
yield _current_session
cleanup_session(_current_session)