E2E tests (Selenium)
End-to-end browser automation tests using Selenium.
Usage
splent feature:test --e2e
splent feature:test auth --e2e
E2E tests live in tests/e2e/ inside each feature and are not included in the default test run. Use the --e2e flag explicitly.
Description
E2E tests drive a real browser via Selenium against the running application. They verify critical user flows that cannot be covered by functional tests (e.g. JavaScript interactions, multi-page workflows).
Each test file uses a browser fixture that initializes and tears down the Selenium driver:
import pytest
from splent_framework.selenium.common import initialize_driver, close_driver
@pytest.fixture()
def browser():
driver = initialize_driver()
yield driver
close_driver(driver)
def test_login_flow(browser):
browser.get("http://localhost:5269/login")
# ... interact with the page
Requirements
- The application must be running (
splent product:run). - Selenium WebDriver must be available in the container.
SPLENT_SELENIUM_HOSTshould be configured if running outside Docker.