-
Notifications
You must be signed in to change notification settings - Fork 250
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for Attachments (aka Embedddings) (#623)
* added support for attachments in the cucumber json and events output formats - done by sneaking the attachment into the context.Context object.
- Loading branch information
Showing
11 changed files
with
218 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,6 @@ Gopkg.toml | |
.idea | ||
.vscode | ||
|
||
_artifacts | ||
_artifacts | ||
|
||
vendor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
internal/formatters/formatter-tests/cucumber/scenario_with_attachment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[ | ||
{ | ||
"uri": "formatter-tests/features/scenario_with_attachment.feature", | ||
"id": "scenario-with-attachment", | ||
"keyword": "Feature", | ||
"name": "scenario with attachment", | ||
"description": " describes\n an attachment\n feature", | ||
"line": 1, | ||
"elements": [ | ||
{ | ||
"id": "scenario-with-attachment;step-with-attachment", | ||
"keyword": "Scenario", | ||
"name": "step with attachment", | ||
"description": "", | ||
"line": 6, | ||
"type": "scenario", | ||
"steps": [ | ||
{ | ||
"keyword": "Given ", | ||
"name": "a step with attachment", | ||
"line": 7, | ||
"match": { | ||
"location": "fmt_output_test.go:119" | ||
}, | ||
"result": { | ||
"status": "passed", | ||
"duration": 0 | ||
}, | ||
"embeddings": [ | ||
{ | ||
"name": "TheFilename1", | ||
"mime_type": "text/plain", | ||
"data": "VGhlRGF0YTE" | ||
}, | ||
{ | ||
"name": "TheFilename2", | ||
"mime_type": "text/plain", | ||
"data": "VGhlRGF0YTI" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] |
10 changes: 10 additions & 0 deletions
10
internal/formatters/formatter-tests/events/scenario_with_attachment
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{"event":"TestRunStarted","version":"0.1.0","timestamp":-6795364578871,"suite":"events"} | ||
{"event":"TestSource","location":"formatter-tests/features/scenario_with_attachment.feature:1","source":"Feature: scenario with attachment\n describes\n an attachment\n feature\n\n Scenario: step with attachment\n Given a step with attachment\n"} | ||
{"event":"TestCaseStarted","location":"formatter-tests/features/scenario_with_attachment.feature:6","timestamp":-6795364578871} | ||
{"event":"StepDefinitionFound","location":"formatter-tests/features/scenario_with_attachment.feature:7","definition_id":"fmt_output_test.go:XXX -\u003e github.com/cucumber/godog/internal/formatters_test.stepWithAttachment","arguments":[]} | ||
{"event":"TestStepStarted","location":"formatter-tests/features/scenario_with_attachment.feature:7","timestamp":-6795364578871} | ||
{"event":"Attachment","location":"formatter-tests/features/scenario_with_attachment.feature:7","timestamp":-6795364578871,"contentEncoding":"BASE64","fileName":"TheFilename1","mimeType":"text/plain","body":"TheData1"} | ||
{"event":"Attachment","location":"formatter-tests/features/scenario_with_attachment.feature:7","timestamp":-6795364578871,"contentEncoding":"BASE64","fileName":"TheFilename2","mimeType":"text/plain","body":"TheData2"} | ||
{"event":"TestStepFinished","location":"formatter-tests/features/scenario_with_attachment.feature:7","timestamp":-6795364578871,"status":"passed"} | ||
{"event":"TestCaseFinished","location":"formatter-tests/features/scenario_with_attachment.feature:6","timestamp":-6795364578871,"status":"passed"} | ||
{"event":"TestRunFinished","status":"passed","timestamp":-6795364578871,"snippets":"","memory":""} |
7 changes: 7 additions & 0 deletions
7
internal/formatters/formatter-tests/features/scenario_with_attachment.feature
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Feature: scenario with attachment | ||
describes | ||
an attachment | ||
feature | ||
|
||
Scenario: step with attachment | ||
Given a step with attachment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.