Skip to content

Commit

Permalink
Added Labels (#51)
Browse files Browse the repository at this point in the history
Co-authored-by: Nikita Filonov <[email protected]>
  • Loading branch information
Nikita-Filonov and Nikita Filonov authored Aug 19, 2024
1 parent fbff2e4 commit 5732d4a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions example/example_parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ func TestAllureWithLabels(t *testing.T) {
allure.Tag("tag1"),
allure.Tags("tag2", "tag3"),
allure.Label("customLabel1", "customLabel1Value"),
allure.Labels("customLabel2", "customLabel2Value1", "customLabel2Value2"),
allure.Action(func() {}))
}

Expand Down
8 changes: 8 additions & 0 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,11 @@ func Label(labelName string, labelValue string) Option {
r.addLabel(labelName, labelValue)
}
}

func Labels(labelName string, labelValues ...string) Option {
return func(r hasOptions) {
for _, labelValue := range labelValues {
r.addLabel(labelName, labelValue)
}
}
}

0 comments on commit 5732d4a

Please sign in to comment.