Skip to content

Commit

Permalink
Merge pull request ozontech#65 from Nikita-Filonov/layer
Browse files Browse the repository at this point in the history
  • Loading branch information
koodeex committed May 25, 2023
2 parents be14616 + 4773148 commit 4f9a397
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ testdata/
allure-results/
bin/

# MacOS
.DS_Store

# Binaries for programs and plugins
*.exe
*.exe~
Expand Down
1 change: 1 addition & 0 deletions examples/suite_demo/step_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (s *StepDemoSuite) TestQuickWorkWithSteps(t provider.T) {

func (s *StepDemoSuite) TestInnerStep(t provider.T) {
t.Epic("Demo")
t.Layer("Layer")
t.Feature("Steps")
t.Title("Add child steps to existed step.")
t.Description(`
Expand Down
6 changes: 6 additions & 0 deletions pkg/allure/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ type LabelType string
// LabelType constants
const (
Epic LabelType = "epic"
Layer LabelType = "layer"
Feature LabelType = "feature"
Story LabelType = "story"
ID LabelType = "as_id"
Expand Down Expand Up @@ -112,6 +113,11 @@ func EpicLabel(epic string) *Label {
return NewLabel(Epic, epic)
}

// LayerLabel returns Layer Label
func LayerLabel(layer string) *Label {
return NewLabel(Layer, layer)
}

// StoryLabel returns Story Label
func StoryLabel(story string) *Label {
return NewLabel(Story, story)
Expand Down
4 changes: 4 additions & 0 deletions pkg/allure/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

func TestLabelType_ToString(t *testing.T) {
epic := "epic"
layer := "layer"
feature := "feature"
story := "story"
as_id := "as_id"
Expand All @@ -26,6 +27,7 @@ func TestLabelType_ToString(t *testing.T) {
allure_id := "ALLURE_ID"

require.Equal(t, epic, Epic.ToString())
require.Equal(t, layer, Layer.ToString())
require.Equal(t, feature, Feature.ToString())
require.Equal(t, story, Story.ToString())
require.Equal(t, as_id, ID.ToString())
Expand Down Expand Up @@ -60,6 +62,7 @@ func TestSeverityType_ToString(t *testing.T) {

func TestLabelCreation(t *testing.T) {
epic := EpicLabel("epicTest")
layer := LayerLabel("layerTest")
feature := FeatureLabel("featureTest")
story := StoryLabel("storyTest")
as_id := IDLabel("idTest")
Expand All @@ -78,6 +81,7 @@ func TestLabelCreation(t *testing.T) {
idAllure := IDAllureLabel("idAllureTest")

require.Equal(t, epic.Name, Epic.ToString())
require.Equal(t, layer.Name, Layer.ToString())
require.Equal(t, feature.Name, Feature.ToString())
require.Equal(t, story.Name, Story.ToString())
require.Equal(t, as_id.Name, ID.ToString())
Expand Down
5 changes: 5 additions & 0 deletions pkg/framework/core/allure_manager/manager/labels.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ func (a *allureManager) Epic(value string) {
a.Label(allure.EpicLabel(value))
}

// Layer adds Layer label to test result
func (a *allureManager) Layer(value string) {
a.Label(allure.LayerLabel(value))
}

// Feature adds Feature label to test result
func (a *allureManager) Feature(value string) {
a.Label(allure.FeatureLabel(value))
Expand Down
1 change: 1 addition & 0 deletions pkg/framework/provider/allure.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type DescriptionLabels interface {
ID(value string)
AllureID(value string)
Epic(value string)
Layer(value string)
Feature(value string)
Story(value string)
Severity(severityType allure.SeverityType)
Expand Down

0 comments on commit 4f9a397

Please sign in to comment.