You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
The Before hook is passed a testCase object (ITestCaseHookParameter type) that's not really designed with the user in mind.
For example, a user had to do this in order to access the cells from the examples table that the running scenario came from:
Describe the solution you'd like
I suggest we wrap this testCase object with an API designed from the user's conceptual model of a running scenario - so containing any information we have about the current test status, but also containing easy access to the Gherkin source of the test case too. We do something like this in Ruby.
Additional context
An additional benefit of this layer of indirection is that we insulate our underlying types from dependencies from user-land code, leaving us more free to change these internal types if we need to. Right now, we're exposing types from the messages project right out to users, so if we want to change those messages we have large ripple effects.
The text was updated successfully, but these errors were encountered:
@brasmusson really clarified it for me today at the Zoom community meeting, that the hooks are part of an execution model, and we should keep the info exposed in them lean because, for example, we might have test cases that were generated from sources other than Gherkin documents, or test cases running in parallel.
On the other hand, the events API used by the formatters is the higher-level place where you can observe everything going on in the Cucumber run, including AST nodes and execution results.
I think we're probably missing an abstraction layer that makes it easier to work with the events API for common use cases, so please keep talking to us and see if there are patterns in what you do with it that could be pushed upstream.
Noting some overlap with cucumber/html-formatter#283, where we also want a coherent way to express a test case for the purposes of the HTML formatter components.
Is your feature request related to a problem? Please describe.
The
Before
hook is passed atestCase
object (ITestCaseHookParameter
type) that's not really designed with the user in mind.For example, a user had to do this in order to access the cells from the examples table that the running scenario came from:
Describe the solution you'd like
I suggest we wrap this
testCase
object with an API designed from the user's conceptual model of a running scenario - so containing any information we have about the current test status, but also containing easy access to the Gherkin source of the test case too. We do something like this in Ruby.For example:
or
but also
or
Additional context
An additional benefit of this layer of indirection is that we insulate our underlying types from dependencies from user-land code, leaving us more free to change these internal types if we need to. Right now, we're exposing types from the
messages
project right out to users, so if we want to change those messages we have large ripple effects.The text was updated successfully, but these errors were encountered: