Files
e2e_Pets/tests/01_vetdept/BP01_navigation/test_bp01_navigation.py
VolandSZ cdca9d6003 feat: implement universal runner for standard and GOST TLS
- Add smart two-phase TLS detection with caching in tests/utils/tls.py

- Add auto-discovery for Chromium-GOST and Yandex.Browser

- Add --tls-mode and --ignore-https-errors CLI options

- Update browser_page context with ignore_https_errors and unified viewport

- Add unit tests in tests/utils/test_tls.py

- Update README.md and .env.example
2026-09-03 00:02:36 +03:00

58 lines
2.6 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
# pyrefly: ignore [missing-import]
import pytest
# pyrefly: ignore [missing-import]
from playwright.sync_api import Page, expect
BASE_URL = os.getenv("BASE_URL", "https://vet.goznak.ru")
@pytest.mark.vetdept
@pytest.mark.usefixtures("browser_page")
class TestBP01Navigation:
"""
BP01: Навигация по разделам портала
Проверяет что пользователь с ролью 'Управление Ветеринарии' может:
- Открыть главную страницу (Dashboard)
- Видеть заголовок своей организации
- Перейти в раздел Организации
- Перейти в раздел Заявки на отлов
"""
@pytest.mark.dependency(name="BP01::s01")
def test_s01_open_dashboard(self, browser_page: Page, bp_state: dict):
"""Шаг 1: Открыть главную страницу (Dashboard)"""
browser_page.goto(BASE_URL + "/dashboard")
expect(browser_page).to_have_url(BASE_URL + "/dashboard")
bp_state["start_url"] = browser_page.url
@pytest.mark.dependency(name="BP01::s02", depends=["BP01::s01"])
def test_s02_check_org_header(self, browser_page: Page, bp_state: dict):
"""Шаг 2: Проверить заголовок организации в интерфейсе"""
expect(browser_page.locator("#app")).to_contain_text(
"Управление Ветеринарии Гознак"
)
@pytest.mark.dependency(name="BP01::s03", depends=["BP01::s02"])
def test_s03_go_to_organizations(self, browser_page: Page, bp_state: dict):
"""Шаг 3: Перейти в раздел Организации"""
browser_page.get_by_role("link", name="Организации").click()
expect(browser_page).to_have_url(
BASE_URL + "/organizations", timeout=10000
)
expect(
browser_page.get_by_text("Подведомственные организации")
).to_be_visible(timeout=10000)
@pytest.mark.dependency(name="BP01::s04", depends=["BP01::s03"])
def test_s04_go_to_claims(self, browser_page: Page, bp_state: dict):
"""Шаг 4: Перейти в раздел Заявки на отлов"""
browser_page.get_by_role("link", name="Заявки на отлов").click()
expect(browser_page).to_have_url(
BASE_URL + "/claims-list", timeout=10000
)
expect(browser_page.get_by_text("Мои заявки")).to_be_visible(
timeout=10000
)