Skip to content

Commit aaec47d

Browse files
author
Gaurav Singh
committed
Chapter 6: Understanding match levels: Content
Pre-requisite: Update background in below css class to hex code for red (#ff0000) in `/automated-visual-testing/website/css/listview-grid.css` file before running the match_level_test ```css .my-page .ui-listview .ui-li-aside { background: #ff0000; } ``` Change log: Added a simple test for automation bookstore site to use MatchLevel.CONTENT Set match level as CONTENT in conftest.py file
1 parent 5121b90 commit aaec47d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from automation.tests.conftest import validate_window
2+
3+
4+
def test_match_level_content(driver, eyes):
5+
validate_window(driver, eyes)

automation/tests/conftest.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
from applitools.common import MatchLevel
23
from applitools.selenium import Eyes
34
from selenium import webdriver
45

@@ -28,8 +29,9 @@ def initialize_eyes():
2829
return eyes
2930

3031

31-
def validate_window(driver, eyes, tag):
32+
def validate_window(driver, eyes, tag=None):
3233
open_eyes(driver, eyes)
34+
eyes.match_level = MatchLevel.CONTENT
3335
eyes.check_window(tag=tag)
3436
close_eyes(eyes)
3537

0 commit comments

Comments
 (0)