Open sashokbg opened 5 months ago
Hello,
As of today (with gherkin 3.1.0), one way to use a custom World instance is to cast it inside the method onAfterScenarioWorldCreated
. This solution is still a workaround and your suggestion would be the cleanest way to do it.
Future<void> onAfterScenarioWorldCreated(
World world,
String scenario,
Iterable<Tag> tags,
) async {
assert(world is MyWorld, "world is not an instance of MyWorld");
MyWorld myWorld = world as MyWorld;
...
}
I propose to generify the methods that use the World objects in the Hook class such as:
And use something like:
This way we can use our own instances of World