-
-
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
Print attachment step text on error format #1041
Changes from 2 commits
7b23413
c1a9e86
0c78779
b910d36
6e7f712
ace611d
7d5a808
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,6 +93,18 @@ function formatStep({ | |
} | ||
text += '\n' | ||
|
||
if (Array.isArray(testStep.attachments)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be simplified to |
||
testStep.attachments | ||
.filter(({ media }) => media.type === 'text/plain') | ||
.forEach(({ data }) => { | ||
text += | ||
indentString( | ||
colorFns[Status.UNDEFINED](figures.info + ' ' + data), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm uncertain about attachments always being yellow. Thoughts on it being the same color as the step or not having any color? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok for no color. |
||
4 | ||
) + '\n' | ||
}) | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thoughts on attachments being added after the step argument so it appears after the docstring / data table and not in between? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems to be append always between step line and docstring/data. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this was block was placed after the next block (that includes buildStepArgumentIterator) I believe it would appear after the step argument. Please add a test for this as well |
||
|
||
if (pickleStep) { | ||
let str | ||
const iterator = buildStepArgumentIterator({ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on this being:
Attachment (text/plain): Basic info.
Then other non text attachments could be
Attachment (other/type)
Currently the figures are only used for steps and not related messages and I'd like to keep that pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, no figure. How should I stringify other media types ? I currently discard them.
I can eventually JSON.stringify
application/json
data but we need to indent them, maybe in an other PR ?Would you like I write something in the doc about this feature ? In the attachment page ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the other media types, I was thinking the value could be suppressed. So for now the line would be
Attachment (other/type)
. We can add json in another PR. Yes please add some docs to the attachment page.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok