Skip to content

Commit

Permalink
gui_e2e tests: Add "email_manager" fixture
Browse files Browse the repository at this point in the history
Change-Id: Iccdd668de912fd6406da5a9232de99373a2a980f
  • Loading branch information
rene-slowenski-checkmk committed Nov 13, 2024
1 parent c2c8aef commit 631db91
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/gui_e2e/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import pytest
from playwright.sync_api import BrowserContext, Page

from tests.testlib.emails import EmailManager
from tests.testlib.playwright.helpers import CmkCredentials
from tests.testlib.playwright.pom.login import LoginPage
from tests.testlib.site import ADMIN_USER, get_site_factory, Site
Expand Down Expand Up @@ -64,3 +65,14 @@ def pytest_addoption(parser: pytest.Parser) -> None:
help="Store updated rule output as static references: rules already stored as reference"
"are updated and new ones are added.",
)


@pytest.fixture(name="email_manager", scope="session")
def _email_manager() -> Iterator[EmailManager]:
"""Create EmailManager instance.
EmailManager handles setting up and tearing down Postfix SMTP-server, which is configured
to redirect emails to a local Maildir. It also provides methods to check and wait for emails.
"""
with EmailManager() as email_manager:
yield email_manager

0 comments on commit 631db91

Please sign in to comment.