Skip to main content

Crate rstest_bdd

Crate rstest_bdd 

Source
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 ScenarioStatus recorded a skipped outcome.
assert_step_err
Assert that a Result is Err and unwrap the error.
assert_step_ok
Assert that a Result is Ok and unwrap it.
assert_step_skipped
Assert that a StepExecution represents 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§

FluentLanguageLoader
LanguageLoader implementation for the fluent localization system. Also provides methods to access localizations which have been loaded.
PatternStr
Wrapper for step pattern strings used in matching logic.
PlaceholderSyntaxError
Detailed information about placeholder parsing failures.
Step
Represents a single step definition registered with the framework.
StepContext
Context passed to step functions containing references to requested fixtures.
StepKeywordParseError
Error returned when parsing a StepKeyword from a string fails.
StepPattern
Pattern text used to match a step at runtime.
StepText
Wrapper for step text content from scenarios.
UnsupportedStepType
Error raised when converting a parsed Gherkin gherkin::StepType into a StepKeyword fails.

Enums§

FixtureRef
Borrowed fixture reference that keeps any underlying RefCell borrow alive for the duration of a step.
FixtureRefMut
Borrowed mutable fixture reference tied to the lifetime of the step borrow.
PlaceholderError
Error conditions that may arise when extracting placeholders.
StepError
Error type produced by step wrappers.
StepExecution
Outcome produced by step wrappers.
StepExecutionMode
Declares how a step prefers to execute when both sync and async runtimes are available.
StepKeyword
Keyword used to categorise a step definition.
StepPatternError
Errors that may occur when compiling a [StepPattern].

Functions§

diagnostics_enabled
Whether the crate was built with the diagnostics feature 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§

AsyncStepFn
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.
StepFuture
A boxed future returned by async step wrappers.
StepResult
Convenient alias for fallible step return values.
StepTable
Alias for the optional step table argument in async wrapper signatures.
StepTextRef
Alias for the step text argument in async wrapper signatures.
iter
An iterator over plugins registered of a given type.