flutter_gherkin icon indicating copy to clipboard operation
flutter_gherkin copied to clipboard

The waitUntilTypeExistsStep will not work

Open SoftWyer opened this issue 1 year ago • 0 comments

In the waitUntilTypeExistsStep (here) the expectation is that a String parameter is converted into a Type. However, without reflection, this will not be possible and the code fails with an exception:

Exception: type 'String' is not a subtype of type 'Type'

The problem is caused by these lines where we tell the findBy method that the ofType argument is a FindType.type.

   context.world.appDriver.findBy(ofType, FindType.type),

This resolves to calling this method and the code will throw an exception.

Finder byType(Type type, {bool skipOffstage = true})

As possible solution, albeit a little clunky, could be to have a predefined Set of types that can be iterated over to match on the String via it's name. But then you have a fixed list of Types unless you could also pass new types in via the World object.

SoftWyer avatar Jun 13 '23 13:06 SoftWyer