-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Variadic option arguments for Test and Step functions (#22)
* WIP version of function slices. * WIP for option slices. * WIP for option slices. * Working version of variadic function arguments for Test and Step functions. * Re-arranged functions and interfaces to remove `test` and `steps` packages. * Changed some non-essential types to private. * Addressed review comments: renamed allure.Body to allure.Action for more clarity and added allure.Parameters for more convenience.
- Loading branch information
1 parent
e94883e
commit b778d93
Showing
22 changed files
with
553 additions
and
419 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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,15 @@ | ||
package example | ||
|
||
import "github.com/dailymotion/allure-go" | ||
import ( | ||
"github.com/dailymotion/allure-go" | ||
) | ||
|
||
func doSomething() { | ||
allure.Step("Something", func() { | ||
allure.Step(allure.Description("Something"), allure.Action(func() { | ||
doSomethingNested() | ||
}) | ||
})) | ||
} | ||
|
||
func doSomethingNested() { | ||
allure.Step("Because we can!", func() {}) | ||
} | ||
|
||
func addSomeParameters(parameters map[string]interface{}) { | ||
allure.StepWithParameter("Step with parameters", parameters, func() {}) | ||
allure.Step(allure.Description("Because we can!"), allure.Action(func() {})) | ||
} |
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,19 @@ | ||
package example | ||
|
||
import ( | ||
"github.com/dailymotion/allure-go" | ||
"testing" | ||
) | ||
|
||
func TestNewTest(t *testing.T) { | ||
allure.Test( | ||
t, | ||
allure.Description("New Test Description"), | ||
allure.Action(func() { | ||
allure.Step( | ||
allure.Description("Step description"), | ||
allure.Action(func() { | ||
|
||
})) | ||
})) | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package example | ||
|
||
import ( | ||
"github.com/dailymotion/allure-go" | ||
"testing" | ||
) | ||
|
||
func TestSkip(t *testing.T) { | ||
allure.Test(t, | ||
allure.Description("Skip test"), | ||
allure.Action(func() { | ||
allure.SkipStep(allure.Description("Skip"), allure.Action(func() {}), allure.Reason("reason")) | ||
})) | ||
} |
Oops, something went wrong.