Skip to content

Commit 368edb6

Browse files
committed
Warn users that Demo Mode breaks layout tests for visual testing
1 parent 762d48f commit 368edb6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

seleniumbase/fixtures/base_case.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2592,6 +2592,13 @@ def check_window(self, name="default", level=0, baseline=False):
25922592
if level != 0 and level != 1 and level != 2 and level != 3:
25932593
raise Exception('Parameter "level" must be set to 0, 1, 2, or 3!')
25942594

2595+
if self.demo_mode:
2596+
raise Exception(
2597+
"WARNING: Using Demo Mode will break layout tests "
2598+
"that use the check_window() method due to custom "
2599+
"HTML edits being made on the page!\n"
2600+
"Please rerun without using Demo Mode!")
2601+
25952602
module = self.__class__.__module__
25962603
if '.' in module and len(module.split('.')[-1]) > 1:
25972604
module = module.split('.')[-1]

0 commit comments

Comments
 (0)