ferridriver-bdd-macros 0.4.0

Proc macros for the ferridriver BDD/Cucumber framework
Documentation

ferridriver-bdd-macros

crates.io docs.rs License

Procedural macros for ferridriver-bdd. Re-exported through ferridriver_bdd::prelude — depend on this crate directly only when you need the macros without the runner.

Macro Purpose
#[given(EXPR)] / #[when(EXPR)] / #[then(EXPR)] Register a Cucumber-expression step.
#[step(EXPR)] Keyword-agnostic step (matches Given / When / Then / And / But).
#[given(regex = PATTERN)] etc. Register a raw-regex step instead of a Cucumber expression.
#[before(scenario)] / #[after(scenario)] Per-scenario hook. Optional tags = "@expr", order = N.
#[before(all)] / #[after(all)] Global lifecycle hook.
#[before(feature)] / #[after(feature)] Per-feature hook.
#[before(step)] / #[after(step)] Per-step hook.
`#[param_type(name = "color", regex = "red green

Step handler signature:

#[given("I have {int} items in my {string}")]
async fn step(
    world: &mut BrowserWorld,
    count: i64,
    bucket: String,
    // optional, recognized by name:
    table: Option<&DataTable>,
    docstring: Option<&str>,
) -> Result<(), StepError> { Ok(()) }

Parameter extraction is type-directed:

  • String{string}
  • i64{int}
  • f64{float}
  • Custom {name} → registered regex (extract as String).

table / data_table and docstring / doc_string are optional and recognized by parameter name; they receive None when absent in the step.

See ferridriver-bdd for the registry, world, and execution model.

License

MIT OR Apache-2.0