Skip to content
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

Release/issue 60 #61

Merged
merged 2 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/allure/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
type Result struct {
Name string `json:"name,omitempty"` // Test name
FullName string `json:"fullName,omitempty"` // Full path to the test
Stage string `json:"stage,omitempty"` // Stage of test execution
Status Status `json:"status,omitempty"` // Status of the test execution
StatusDetails StatusDetail `json:"statusDetails,omitempty"` // Details about the test (for example, errors during test execution will be recorded here)
Start int64 `json:"start,omitempty"` // Start of test execution
Expand Down Expand Up @@ -118,6 +119,13 @@ func (result *Result) SetNewLabelMap(kv map[LabelType]string) {
result.AddLabel(labels...)
}

// WithStage sets Stage field to result
// Returns a pointer to the current `allure.Result` (for Fluent Interface).
func (result *Result) WithStage(stage string) *Result {
result.Stage = stage
return result
}

// WithParentSuite Adds `allure.Label` with type `Parent` to the report.
// Returns a pointer to the current `allure.Result` (for Fluent Interface).
func (result *Result) WithParentSuite(parentName string) *Result {
Expand Down
14 changes: 14 additions & 0 deletions pkg/framework/core/allure_manager/manager/description.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ func (a *allureManager) Descriptionf(format string, args ...interface{}) {
result.Description = fmt.Sprintf(format, args...)
})
}

// Stage provides staqe to test result(using fmt.Sprint)
func (a *allureManager) Stage(args ...interface{}) {
a.safely(func(result *allure.Result) {
result.Stage = fmt.Sprint(args...)
})
}

// Stagef provides staqe to test result(using fmt.Sprintf)
func (a *allureManager) Stagef(format string, args ...interface{}) {
a.safely(func(result *allure.Result) {
result.Stage = fmt.Sprintf(format, args...)
})
}
2 changes: 2 additions & 0 deletions pkg/framework/provider/allure.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ type DescriptionFields interface {
Titlef(format string, args ...interface{})
Description(args ...interface{})
Descriptionf(format string, args ...interface{})
Stage(args ...interface{})
Stagef(format string, args ...interface{})
}

type AllureSteps interface {
Expand Down