Merge branch 'zdy'

This commit is contained in:
David Chang
2024-03-07 16:54:50 +08:00
11 changed files with 121 additions and 20 deletions

View File

@@ -17,6 +17,9 @@ import difflib
from .utils import _match_record, _match_value_to_rule
import logging
logger = logging.getLogger("desktopenv.metric.general")
def check_include_exclude(result: str, rules: Dict[str, List[str]]) -> float:
if result is None:
@@ -184,7 +187,7 @@ def check_accessibility_tree(result: str, rules: List[Dict[str, Any]]) -> float:
raise ValueError("At least one of xpath and selectors is required")
if len(elements) == 0:
print("no elements")
logger.info("No elements: %s", r["xpath"] if "xpath" in r else r["selectors"])
return 0.
if "text" in r: