Expand description
Core library for rstest-bdd.
This crate exposes helper utilities used by behaviour tests. It also defines
the global step registry used to orchestrate behaviour-driven tests.
Re-exports§
pub use localization::LocalizationError;pub use localization::Localizations;pub use localization::current_languages;pub use localization::install_localization_loader;pub use localization::select_localizations;pub use state::ScenarioState;pub use state::Slot;pub use step_args::StepArgs;pub use step_args::StepArgsError;pub use execution::ExecutionError;pub use execution::MissingFixturesDetails;pub use panic_support::panic_message;
Modules§
- async_
step - Public helpers for explicit async step wrappers.
- config
- Runtime configuration for rstest-bdd.
- datatable
- Runtime helpers for working with typed Gherkin data tables.
- execution
- Runtime execution policy and helpers for scenario step execution.
- localization
- Localization utilities used by the public macros and runtime diagnostics.
- panic_
support - Helpers for rendering panic payloads.
- reporting
- Scenario reporting collector.
- state
- Scenario state helpers simplifying shared mutable data across steps.
- step_
args - Helpers for struct-based step arguments parsed from pattern placeholders.
Macros§
- assert_
scenario_ skipped - Assert that a
ScenarioStatusrecorded a skipped outcome. - assert_
step_ err - Assert that a
ResultisErrand unwrap the error. - assert_
step_ ok - Assert that a
ResultisOkand unwrap it. - assert_
step_ skipped - Assert that a
StepExecutionrepresents a skipped outcome. - panic_
localized - Panic with a localized message resolved from a Fluent ID and key–value args.
- skip
- Skip the current scenario with an optional message.
- step
- Register a step definition with the global registry.
- submit
- Enter an element into the plugin registry corresponding to its type.
Structs§
- Fluent
Language Loader - LanguageLoader implementation for the
fluentlocalization system. Also provides methods to access localizations which have been loaded. - Pattern
Str - Wrapper for step pattern strings used in matching logic.
- Placeholder
Syntax Error - Detailed information about placeholder parsing failures.
- Step
- Represents a single step definition registered with the framework.
- Step
Context - Context passed to step functions containing references to requested fixtures.
- Step
Keyword Parse Error - Error returned when parsing a
StepKeywordfrom a string fails. - Step
Pattern - Pattern text used to match a step at runtime.
- Step
Text - Wrapper for step text content from scenarios.
- Unsupported
Step Type - Error raised when converting a parsed Gherkin
gherkin::StepTypeinto aStepKeywordfails.
Enums§
- Fixture
Ref - Borrowed fixture reference that keeps any underlying
RefCellborrow alive for the duration of a step. - Fixture
RefMut - Borrowed mutable fixture reference tied to the lifetime of the step borrow.
- Placeholder
Error - Error conditions that may arise when extracting placeholders.
- Step
Error - Error type produced by step wrappers.
- Step
Execution - Outcome produced by step wrappers.
- Step
Execution Mode - Declares how a step prefers to execute when both sync and async runtimes are available.
- Step
Keyword - Keyword used to categorise a step definition.
- Step
Pattern Error - Errors that may occur when compiling a [
StepPattern].
Functions§
- diagnostics_
enabled - Whether the crate was built with the
diagnosticsfeature enabled. - dump_
registry - Serialize the registry to a JSON array.
- duplicate_
steps - Group step definitions that share a keyword and pattern.
- extract_
placeholders - Extract placeholder values from a step string using a pattern.
- find_
step - Find a registered step whose pattern matches the provided text.
- find_
step_ async - Find a registered async step whose pattern matches the provided text.
- find_
step_ async_ with_ mode - Find a registered async step whose pattern matches the provided text, including its execution mode.
- find_
step_ with_ metadata - Find a registered step and return its full metadata.
- find_
step_ with_ mode - Find a registered step and return its full metadata, including execution mode.
- greet
- Returns a greeting for the library.
- lookup_
step - Look up a registered step by keyword and pattern.
- lookup_
step_ async - Look up a registered async step by keyword and pattern.
- lookup_
step_ async_ with_ mode - Look up a registered async step by keyword and pattern, including its execution mode.
- record_
bypassed_ steps - Record step definitions that were bypassed after a scenario requested a skip.
- record_
bypassed_ steps_ with_ tags - Record bypassed steps using previously owned tags.
- unused_
steps - Return registered steps that were never executed.
Type Aliases§
- Async
Step Fn - Function pointer type for async step wrappers.
- StepCtx
- Alias for the borrowed step context argument in async wrapper signatures.
- StepDoc
- Alias for the optional step docstring argument in async wrapper signatures.
- StepFn
- Type alias for the stored step function pointer.
- Step
Future - A boxed future returned by async step wrappers.
- Step
Result - Convenient alias for fallible step return values.
- Step
Table - Alias for the optional step table argument in async wrapper signatures.
- Step
Text Ref - Alias for the step text argument in async wrapper signatures.
- iter
- An iterator over plugins registered of a given type.