Expand description
Proc macros for the ferridriver test framework.
Provides #[ferritest] to register async browser test functions. The
annotated function takes a single TestContext; built-in fixtures
(page, browser, context, …) resolve lazily through it.
ⓘ
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").await?;
}
#[ferritest(retries = 2, timeout = "30s", tag = "smoke")]
async fn flaky_test(ctx: TestContext) {
let page = ctx.page().await?;
let context = ctx.browser_context().await?;
// ...
}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.- ferritest_
suite #[ferritest_suite(mode = "serial")]— set the execution mode of every#[ferritest]in the annotated module. A serial suite is dispatched as one batch to a single worker, runs in source order, and skips the rest on first failure. The default (no attribute) is parallel.- fixture
#[fixture]— register a custom, dependency-injected, scoped fixture.