Files
Tirsvad e764269eda Implement the Selenium lecture steps with tests and screenshots (MIL-002)
Driver factory, click_link_by_text, search_for, fill_out_form, run_lecture
and CLI, layered as domain, application, infrastructure and presentation.
30 offline unit tests, a form fixture, a Docker image for headless runs and
four screenshots captured in Docker. Reviews RC-009 (code) and RC-010
(milestone wording of the screenshot criterion).

Task: MIL-002#1
2026-10-28 16:22:41 +08:00

27 lines
717 B
Python

import os
from pathlib import Path
import pytest
from fill_out_form import constants
from fill_out_form.application.run_lecture import run_lecture
from fill_out_form.infrastructure.driver import create_driver
@pytest.mark.e2e
def test_lecture_runs_against_real_sites() -> None:
results = Path(os.environ.get("RESULTS_DIR", "results"))
browser = create_driver(headless=True)
try:
run_lecture(browser, screenshot_dir=results)
finally:
browser.quit()
for name in (
constants.SCREENSHOT_STEP_1,
constants.SCREENSHOT_STEP_2,
constants.SCREENSHOT_STEP_3_FILLED,
constants.SCREENSHOT_STEP_3_SIGNED_UP,
):
assert (results / name).is_file()