Skip to content

feat: support TestStepResult.exception #345

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

Merged
merged 3 commits into from
Mar 15, 2024
Merged

Conversation

davidjgoss
Copy link
Contributor

@davidjgoss davidjgoss commented Mar 13, 2024

🤔 What's changed?

This PR adds support in the components for an exception object within the TestStepResult. This is designed to give more structured information about a problem than the flat string message field. We'll now use the exception (and disregard the old message field) if present.

image

⚡️ What's your motivation?

Make use of the structured exception object for Cucumber implementations that support it, whilst maintaining backwards-compatibility with those that don't yet.

🏷️ What kind of change is this?

  • ⚡ 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.

Copy link

netlify bot commented Mar 13, 2024

Deploy Preview for cucumber-react-components ready!

Name Link
🔨 Latest commit 0938b4c
🔍 Latest deploy log https://app.netlify.com/sites/cucumber-react-components/deploys/65f42e87f4c83e0008909142
😎 Deploy Preview https://deploy-preview-345--cucumber-react-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated in a backwards-compatible way to allow content as children instead of a string prop - we need this to use in our new component.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This edits are due to upstream changes in the CCK sources.

@mpkorstanje
Copy link
Contributor

The "with stacktrace" step fails in the preview with;

TypeError Cannot read properties of null (reading 'type')
    at TodosPage.addItem (/Users/somebody/Projects/my-project/support/pages/TodosPage.ts:39:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at CustomWorld.<anonymous> (/Users/somebody/Projects/my-project/support/steps/steps.ts:20:5)

@davidjgoss
Copy link
Contributor Author

@mpkorstanje thats the actual presentation, not an error when trying to render.

@davidjgoss davidjgoss merged commit 6dec552 into main Mar 15, 2024
@davidjgoss davidjgoss deleted the feat/rich-exceptions branch March 15, 2024 12:53
@luke-hill
Copy link
Contributor

Might need some support here as this now means the ruby side renders a shorter message than previously before. All stacktrace data is now missing

Will chat to you later about this @davidjgoss

mpkorstanje added a commit to cucumber/cucumber-jvm that referenced this pull request Mar 23, 2024
With cucumber/react-components#345 the html formatter started to
support rendering stack traces. Unfortunately this also broke the
regular rendering of stacktrace. And fixing this required including the
stack trace the xml report as well so that when the Convertor in messages
was fixed to always include the stacktrace, we wouldn't render the
stacktrace in the xml formatter twice.
mpkorstanje added a commit to cucumber/cucumber-jvm that referenced this pull request Mar 23, 2024
With cucumber/react-components#345 the html formatter started to
support rendering stack traces. Unfortunately this also broke the
regular rendering of stacktrace. And fixing this required including the
stack trace the xml report as well so that when the Convertor in messages
was fixed to always include the stacktrace, we wouldn't render the
stacktrace in the xml formatter twice.
mpkorstanje added a commit to cucumber/cucumber-jvm that referenced this pull request Mar 23, 2024
With cucumber/react-components#345 the html formatter started to
support rendering stack traces. Unfortunately this also broke the
regular rendering of stacktrace. And fixing this required including the
stack trace the xml report as well so that when the Convertor in messages
was fixed to always include the stacktrace, we wouldn't render the
stacktrace in the xml formatter twice.
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.

3 participants