e-nms_qa_automation/locators/alert_locators.py

28 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"""Модуль alert_locators содержит локаторы элементов alert-окон.
Класс AlertLocators предоставляет XPath и CSS локаторы для взаимодействия
с alert-окнами (error, success, info, warning) в тестах.
"""
class AlertLocators:
"""Локаторы элементов alert-окон.
Содержит XPath и CSS локаторы для:
ALERT_ROLE (str): alert-окон по роли.
ALERT_BASE (str): базового контейнера alert-окон.
ALERT_MESSAGE (str): текстового сообщения в alert-окне.
ALERT_DISMISS_BUTTON (str): кнопки закрытия alert-окна.
ALERT_BY_TEXT (str): alert-окна с определенным текстом (шаблон).
ERROR_CLASSES (list): классы для подсветки ошибок валидации.
"""
ALERT_ROLE: str = "alert"
ALERT_BASE: str = "//div[contains(@class,'v-alert')]"
ALERT_MESSAGE: str = f"{ALERT_BASE}/div"
ALERT_DISMISS_BUTTON: str = "//a[@class='v-alert__dismissible']"
ALERT_BY_TEXT: str = f"{ALERT_BASE}[contains(., '{{text}}')]"
# Классы для подсветки ошибок валидации полей
ERROR_CLASSES: list = ["error--text"]