Skip to content

Commit a5fea5c

Browse files
committed
Update the "check_window()" method for visual layout tests
1 parent 55cf503 commit a5fea5c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6504,7 +6504,7 @@ def check_window(self, name="default", level=0, baseline=False):
65046504
self.check_window(name="github_page", level=2)
65056505
self.check_window(name="wikipedia_page", level=3)
65066506
"""
6507-
self.__check_scope()
6507+
self.wait_for_ready_state_complete()
65086508
if level == "0":
65096509
level = 0
65106510
if level == "1":
@@ -6517,11 +6517,10 @@ def check_window(self, name="default", level=0, baseline=False):
65176517
raise Exception('Parameter "level" must be set to 0, 1, 2, or 3!')
65186518

65196519
if self.demo_mode:
6520-
raise Exception(
6521-
"WARNING: Using Demo Mode will break layout tests "
6522-
"that use the check_window() method due to custom "
6523-
"HTML edits being made on the page!\n"
6524-
"Please rerun without using Demo Mode!")
6520+
message = (
6521+
"WARNING: Using check_window() from Demo Mode may lead "
6522+
"to unexpected results caused by Demo Mode HTML changes.")
6523+
logging.info(message)
65256524

65266525
module = self.__class__.__module__
65276526
if '.' in module and len(module.split('.')[-1]) > 1:

0 commit comments

Comments
 (0)