Closed tk3369 closed 3 years ago
Just want to note that the order is important. In the example above, the first When
statement must be executed before the second one. I can think of two use cases:
When
statement may have a side effect in the context objectWhen
statement may have a side effect in an external system (e.g. inserting data into a database)For the same reason, the first Then
statement in the above example must be executed BEFORE the When
statement that immediately follows it.
Hence this implementation would have to preserve the execution order of all statements - Given, When, and Then's.
I don't think the execution order will be a problem, but we ought to make a test for it to make sure, and to make sure it doesn't fail in the future.
I'm going to close this. Interleaving step types is supported by the old parser with an option, and by the new parser by default, so it's all done.
I'm unsure if it's common practice but other Gherkin implementations such as Python's behave supports interleaving steps.
Here's an example from Grakn project:
Currently, the parser fails with the following error:
This enhancement is required to support Grakn client. See master issue #44.