Package net.serenitybdd.model.steps
Interface StepParameterProvider
public interface StepParameterProvider
SPI for providing constructor parameter values to step libraries created via
@Steps.
Implementations are discovered via ServiceLoader. When Serenity creates
a step library that has a constructor with parameters but no explicit parameter values
were supplied, each registered provider is queried for each parameter type. If all
parameters can be resolved, the step library is constructed with those values.
This enables modules like serenity-playwright to supply constructor arguments
(e.g. a Playwright Page) without serenity-core having any compile-time
dependency on those modules.
-
Method Summary
-
Method Details
-
resolve
Attempts to resolve a value for the given parameter type.- Parameters:
type- the declared type of the constructor parameter- Returns:
- an
Optionalcontaining the resolved value, or empty if this provider cannot supply the requested type
-