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 new methods for attachments, hooks, meta #67

Merged
merged 8 commits into from
Jan 14, 2025
Merged

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Jan 2, 2025

🤔 What's changed?

Adds three new methods in our polyglot, test case-centric interface:

  • findAttachmentsBy(TestStepFinished) returns an array of attachments. TestStepFinished makes the most sense as the starting point because it has both the testStepId to identify the step, and the testCaseStartedId to identify the test case attempt.
  • findHookBy(TestStep) returns an optional Hook, natural cousin of findPickleStepBy(TestStep)
  • findMeta() returns the Meta message if present

Also, fixes a bug in the old attachment-related method in JavaScript, which made an assumption an attachment would always be tied to a testStepId, which will not be the case once cucumber/messages#102 is implemented in runners.

⚡️ What's your motivation?

Required for work on React components for the HTML formatter in cucumber/html-formatter#283

🏷️ What kind of change is this?

  • 🏦 Refactoring/debt/DX (improvement to code design, tooling, etc. without changing behaviour)
  • ⚡ New feature (non-breaking change which adds new behaviour)

📋 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.

This text was originally generated from a template, then edited by hand. You can modify the template here.

@davidjgoss davidjgoss force-pushed the new-methods-for-react branch from 4a5a645 to 48e346d Compare January 3, 2025 00:00
@davidjgoss davidjgoss marked this pull request as ready for review January 3, 2025 00:01
@davidjgoss davidjgoss requested a review from mpkorstanje January 3, 2025 00:14
@davidjgoss davidjgoss force-pushed the new-methods-for-react branch from 48e346d to a541c36 Compare January 3, 2025 08:52
@davidjgoss davidjgoss changed the title Add new methods for attachments and hooks Add new methods for attachments, hooks, meta Jan 3, 2025
Copy link
Contributor

@mpkorstanje mpkorstanje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Few nitpicks. Feel free to merge after addressing these.

@davidjgoss davidjgoss merged commit 72bed7f into main Jan 14, 2025
8 checks passed
@davidjgoss davidjgoss deleted the new-methods-for-react branch January 14, 2025 14:50
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.

2 participants