Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hook type #224

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Add hook type #224

wants to merge 1 commit into from

Conversation

mpkorstanje
Copy link
Contributor

⚡️ What's your motivation?

Hooks in Cucumber can either execute before/after a scenario or before/after a step. Depending on which implementation is used these are put into the json report as either all part of the element.steps field[1] or the element.before and element.steps fields[2][3].

So to create a json reports from messages the type of hook must be included in the message.

  1. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-js/7.3.2/json/failing-before-hook.json
  2. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-jvm/7.2.3/json/failing-before-hook.json
  3. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-jvm/7.2.3/json/failing-after-step-hook.json

🏷️ What kind of change is this?

  • ⚡ New feature (non-breaking change which adds new behaviour)

♻️ Anything particular you want feedback on?

Feel free.

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

Hooks in Cucumber can either execute before/after a scenario or
before/after a step. Depending on which implementation is used these are
put into the json report as either all part of the `element.steps`
field[1] or the `element.before` and `element.steps` fields[2][3].

So to create a json reports from messages the type of hook must be
included in the message.

 1. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-js/7.3.2/json/failing-before-hook.json
 2. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-jvm/7.2.3/json/failing-before-hook.json
 3. https://github.com/cucumber/cucumber-json-converter/blob/main/testdata/cucumber-jvm/7.2.3/json/failing-after-step-hook.json
@luke-hill
Copy link
Contributor

As/when you get this in a spot to be merged let me know as I'll start getting my stuff ready too as then it'll be a decent time for a chunky major release (My stuff is breaking but small).

@mpkorstanje
Copy link
Contributor Author

It will be a while. I'm doing this for the JSON formatter, but that thing is overly complicated. And I'm getting side tracked with other projects in the same vein that are easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants