"""Pytest configuration for Ada Assistant tests.""" import pytest from playwright.sync_api import Browser, BrowserContext, Page @pytest.fixture(scope="session") def browser_context_args(browser_context_args): """Configure browser context for tests.""" return { **browser_context_args, "viewport": {"width": 1280, "height": 720}, "ignore_https_errors": True, } @pytest.fixture def page(context: BrowserContext) -> Page: """Create a new page for each test.""" page = context.new_page() # Set a reasonable timeout for all operations page.set_default_timeout(30000) yield page page.close() # Mark integration tests def pytest_collection_modifyitems(config, items): """Add integration marker to integration tests.""" for item in items: if "integration" in str(item.fspath): item.add_marker(pytest.mark.integration) if "e2e" in item.name or "integration" in str(item.fspath): item.add_marker(pytest.mark.e2e)