Skip to content

Commit

Permalink
fix: outlined scenario results merged (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
lentil1016 authored Oct 29, 2024
1 parent 3f7b403 commit 4d19402
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/.vscode
/bench-*.txt
/vendor

allure-results
21 changes: 21 additions & 0 deletions _testdata/Outline.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Feature: that passes

Scenario Outline: 1 scenario 10 results
When I pass
And I sleep for a bit
Then I <begin>
And I <end>

Examples:
| begin | end |
| fail | pass |
| pass | pass |
| fail | pass |
| pass | pass |
| fail | pass |
| pass | pass |
| fail | pass |
| pass | pass |
| fail | pass |
| pass | pass |

5 changes: 3 additions & 2 deletions formatter.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ type scenarioContext struct {
// Pickle receives scenario.
func (f *formatter) Pickle(scenario *godog.Scenario) {
feature := f.Storage.MustGetFeature(scenario.Uri)
uid := uuid.New().String()
res := report.Result{
Name: scenario.Name,
HistoryID: feature.Feature.Name + ": " + scenario.Name,
HistoryID: feature.Feature.Name + ": " + scenario.Name + " (" + uid + ")",
FullName: scenario.Uri + ":" + scenario.Name,
Description: scenario.Uri,
Labels: []report.Label{
Expand All @@ -94,7 +95,7 @@ func (f *formatter) Pickle(scenario *godog.Scenario) {
{Name: "language", Value: "Go"},
},
Start: report.GetTimestampMs(),
UUID: uuid.New().String(),
UUID: uid,
}

f.mu.Lock()
Expand Down

0 comments on commit 4d19402

Please sign in to comment.