Skip to main content

Crate ferridriver_test

Crate ferridriver_test 

Source
Expand description

ferridriver-test – High-performance E2E test runner for browser automation.

Provides a Playwright Test-compatible API for writing and running browser tests with automatic fixture injection, parallel execution, and rich reporting.

§Quick Start (Rust)

use ferridriver_test::prelude::*;

#[ferritest]
async fn basic_navigation(ctx: TestContext) {
    let page = ctx.page().await?;
    page.goto("https://example.com", None).await?;
    expect(&*page).to_have_title("Example Domain").await?;
}

#[ferritest(retries = 2, tag = "smoke")]
async fn login_test(ctx: TestContext) {
    let page = ctx.page().await?;
    page.goto("https://app.example.com/login", None).await?;
    page.locator("#email").fill("user@example.com").await?;
    page.locator("#password").fill("password").await?;
    page.locator("button[type=submit]").click().await?;
    expect(&*page).to_have_url("https://app.example.com/dashboard").await?;
}

Re-exports§

pub use config::parse_common_cli_args;
pub use context::TestContext;
pub use discovery::HookKindTag;
pub use discovery::HookRegistration as InventoryHookRegistration;
pub use discovery::TestRegistration;
pub use fixture::FixturePool;
pub use model::HookDef;
pub use model::HookKind;
pub use model::HookOwner;
pub use model::HookPhase;
pub use model::HookRegistration;
pub use model::HookScope;
pub use model::SuiteDef;
pub use model::SuiteMode;
pub use model::TestAnnotation;
pub use model::TestCase;
pub use model::TestFailure;
pub use model::TestFixtures;
pub use model::TestFn;
pub use model::TestId;
pub use model::TestInfo;
pub use model::TestModifiers;
pub use model::TestOutcome;
pub use model::TestPlan;
pub use model::TestPlanBuilder;
pub use model::TestStatus;
pub use model::TestStep;
pub use reporter::EventBus;
pub use reporter::EventBusBuilder;
pub use reporter::Reporter;
pub use reporter::ReporterDriver;
pub use reporter::ReporterEvent;
pub use reporter::ReporterSet;
pub use reporter::Subscription;
pub use runner::TestRunner;
pub use inventory;

Modules§

config
Test runner configuration: re-exports the data types from ferridriver-config and adds runtime-only helpers (CLI argument parsing, override merging, environment-variable resolution).
context
Test context: the single object passed to every #[ferritest] function.
ct
Component testing core (ct-core).
discovery
Test discovery: inventory-based collection for Rust, glob-based file scanning.
dispatcher
Test dispatcher: MPMC work queue supporting parallel and serial suites.
expect
Auto-retrying assertions. The full matcher set — builder, value matchers, asymmetric matchers, locator / page / APIResponse web-first matchers, polling, and toPass — lives in ferridriver_expect. The thin wrappers in this module:
fixture
Fixture system: dependency-injected, scoped, auto-teardown.
git_info
Capture git metadata for captureGitInfo (§7.26).
interactive
Interactive key handler for watch mode.
logging
Centralized tracing/logging initialization.
model
Core test model types: TestId, TestCase, TestSuite, TestPlan, TestOutcome, TestInfo, TestStep, SuiteMode.
prelude
Prelude for convenient imports in test files.
reporter
Reporter system: event-driven, multiplexed, trait-based.
retry
Retry policy and flaky test detection.
runner
Test runner orchestrator: overlaps browser launch with test dispatch, handles retries with flaky detection.
server
TestServer: Playwright-style HTTP server for E2E test fixtures.
shard
Deterministic sharding for distributing tests across CI machines.
snapshot
Text snapshot testing: save expected output to .snap files, diff on mismatch.
tracing
Trace recording in Playwright-compatible format.
tui
Watch mode TUI: fullscreen ratatui dashboard with real-time test progress.
tui_reporter
TUI reporter: translates ReporterEvents into TuiMessages for the dashboard.
watch
File watcher for watch mode: detects file changes, classifies them, and sends events through an async channel with debounce.
worker
Worker: owns a browser instance, executes hooks, creates fresh context+page per test.

Macros§

main
Run all #[ferritest] tests in this binary.

Structs§

CliOverrides
CLI overrides that take highest priority.
TestConfig
Test runner configuration.
ToPassOptions

Functions§

expect
Wrap a subject for auto-retrying assertions.
expect_configured
Create a pre-configured expect with custom defaults (Playwright’s expect.configure()).
expect_poll
Create a polling expect (Playwright’s expect.poll(fn)).
run_harness
Entry point called by main!(). Parses CLI args, loads config, discovers tests, and runs them.
to_pass
Retry an async block until it passes or timeout (Playwright’s expect(fn).toPass()).
to_pass_with_options

Attribute Macros§

after_all
Runs once after all tests in the containing module (suite).
after_each
Runs after each test in the containing module (suite), even on failure.
before_all
Runs once before all tests in the containing module (suite).
before_each
Runs before each test in the containing module (suite).
ferritest
#[ferritest] attribute macro.
ferritest_each
#[ferritest_each(data = [("a", 1), ("b", 2)])] — parameterized test macro.