-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Opt out option please: Print attachment step text on error format #1136
Comments
More:
See the
|
Sorry about that. |
We use multiple-cucumber-html-reporter. It saves a json report that it then parse and display in the UI. // Attach screenshot to the scenario.
After(async function() {
const png = await browser.takeScreenshot();
return this.attach(png, 'image/png');
});
// Attach browser logs to the scenario.
After(async function() {
const logs = await browser
.manage()
.logs()
.get('browser');
return this.attach(JSON.stringify(logs));
}); The default progress reporter is still useful since when something fails we can tell where/why without having to go to the html report page. |
Almost identical issue (duplicate #1160) which I am now closing. Note that I would prefer the ability to not just opt-in or opt-out but to have control over which attachments display and which do not (e.g. a tagging mechanism) |
At the moment we are hacking around the behaviour by specifying a custom content type (like "text/plain-large") to get the attachment ignored for CLI purposes. |
I am discovering that issue. If I understand well, it is requested a new format options to disable step attachments? Something like that: |
It could also be an option in the this.attach('Some info.') // Simple text
this.attach('{"some", "JSON"}}', 'application/json') // Typed data Why not using the 2nd argument as a map of options (and keep backward compatibility for string param) this.attach('{"some", "JSON"}}', {
mime: 'application/json',
print: false, // This would disable logging attachments
}) That way, we could mix print and hidden attachements on the same run. |
That is interesting I am more puzzled about it. Why would we attach some data to not print those ? That may also lead in big reports embedding a lot of invisible attached data because it would be less easy to notice that some attachments are not printed out. |
Yes, the purpose of attachments is to store information during the scenario run for two use cases:
The |
I suggest I continue to work on the first global formatOption as it is a good topic for a tutorial for a future new contributor first contribution. But your ideas are still interesting and we may continue discuss it, and then open a distinct PR once we have a better idea of what we may do. What do you think? |
So #1041 was merged a while back (@DevSide @charlierudolph), but we have just upgraded to version 4 to see its effect.
Our use case:
And so, every time something fails (even
cannot read property of undefined
), we get this ginormous print out and have to scroll all the way up to see what the issue was.Would be handy for us to be able to opt-out of this behaviour (or maybe even have it as opt-in?).
It makes certain assumptions with regards to attachments that are not valid with some use-cases.
The text was updated successfully, but these errors were encountered: