cucumber-js icon indicating copy to clipboard operation
cucumber-js copied to clipboard

Option for no backtrace

Open kylecoberly opened this issue 3 years ago • 3 comments
trafficstars

🤔 What's the problem you're trying to solve?

I'm trying to use the @playwright/test expect assertion library with Cucumber, and I have no need for the stack trace. Expect already gives me Playwright-specific trace of what lead to the failure, the Cucumber stack trace just shows me where I wrote the assertion.

✨ What's your proposed solution?

Add on "off" value to the existing --backtrace option.

⛏ Have you considered any alternatives or workarounds?

I read some stuff about regexing to filter out the traces or use additional plugins to take them out, but I'm trying to teach other people how to do this on all of their projects and that's an awful lot of hoops for a clear need.

📚 Any additional context?

image

Playwright + Playwright Expect + Cucumber seems like a pretty :100: stack, I feel like this would be useful to more people than just me.


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

kylecoberly avatar Aug 15 '22 07:08 kylecoberly

Interesting one @kylecoberly, thanks for raising.

I think customisation of how errors and stack traces are displayed is a good candidate for something a plugin could do, which is a concept we're kind of fleshing out at the moment.

Coincidentally the next thing I'm going to be looking at is our handling of errors and stack traces, so I'll keep this in mind and see what's feasible.

cc @mattwynne

davidjgoss avatar Aug 15 '22 12:08 davidjgoss

Here's another example:

image

This one is Cucumber + supertest. The stack trace is supertest's code, not my app's. The same thing happens with expect:

image

kylecoberly avatar Aug 18 '22 06:08 kylecoberly

Interesting, yeah.

If you had an extension point that allowed you to wrap the invocation of a step, the plugin could intercept and modify the backtrace there.

mattwynne avatar Aug 19 '22 20:08 mattwynne