Documentation ¶
Index ¶
- Variables
- func AfterAll(body func()) bool
- func AfterEach(body func(), timeout ...float64) bool
- func AfterFailed(body func()) bool
- func BeforeAll(body func()) bool
- func BeforeEach(body interface{}, timeout ...float64) bool
- func By(message string, optionalValues ...interface{})
- func FailWithToggle(message string, callerSkip ...int)
- func GetTestName() string
- func GinkgoPrint(message string, optionalValues ...interface{})
- func JustAfterEach(body func()) bool
- func RunAfterEach(cs *scope)
- func SkipContextIf(condition func() bool, text string, body func()) bool
- type Done
- type JUnitFailureMessage
- type JUnitReporter
- func (reporter *JUnitReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
- func (reporter *JUnitReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)
- func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary)
- func (reporter *JUnitReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
- func (reporter *JUnitReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
- func (reporter *JUnitReporter) SpecWillRun(specSummary *types.SpecSummary)
- type JUnitSkipped
- type JUnitTestCase
- type JUnitTestSuite
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( Context = wrapContextFunc(ginkgo.Context, false) FContext = wrapContextFunc(ginkgo.FContext, true) PContext = wrapNilContextFunc(ginkgo.PContext) XContext = wrapNilContextFunc(ginkgo.XContext) Describe = wrapContextFunc(ginkgo.Describe, false) FDescribe = wrapContextFunc(ginkgo.FDescribe, true) PDescribe = wrapNilContextFunc(ginkgo.PDescribe) XDescribe = wrapNilContextFunc(ginkgo.XDescribe) It = wrapItFunc(ginkgo.It, false) FIt = wrapItFunc(ginkgo.FIt, true) PIt = ginkgo.PIt XIt = ginkgo.XIt Measure = wrapMeasureFunc(ginkgo.Measure, false) JustBeforeEach = ginkgo.JustBeforeEach BeforeSuite = ginkgo.BeforeSuite AfterSuite = ginkgo.AfterSuite Skip = ginkgo.Skip Fail = FailWithToggle CurrentGinkgoTestDescription = ginkgo.CurrentGinkgoTestDescription GinkgoRecover = ginkgo.GinkgoRecover GinkgoT = ginkgo.GinkgoT RunSpecs = ginkgo.RunSpecs RunSpecsWithCustomReporters = ginkgo.RunSpecsWithCustomReporters RunSpecsWithDefaultAndCustomReporters = ginkgo.RunSpecsWithDefaultAndCustomReporters GinkgoWriter = NewWriter(ginkgo.GinkgoWriter) )
Functions ¶
func AfterAll ¶
func AfterAll(body func()) bool
AfterAll runs the function once after any test in context
func AfterFailed ¶
func AfterFailed(body func()) bool
JustAfterFailed runs the function after test and JustAfterEach if the test has failed and before all AfterEach
func BeforeAll ¶
func BeforeAll(body func()) bool
BeforeAll runs the function once before any test in context
func BeforeEach ¶
BeforeEach runs the function before each test in context
func By ¶
func By(message string, optionalValues ...interface{})
By allows you to better document large Its.
Generally you should try to keep your Its short and to the point. This is not always possible, however, especially in the context of integration tests that capture a particular workflow.
By allows you to document such flows. By must be called within a runnable node (It, BeforeEach, Measure, etc...) By will simply log the passed in text to the GinkgoWriter.
func FailWithToggle ¶
FailWithToggle wraps `ginkgo.Fail` function to have a option to disable the panic when something fails when is running on AfterEach.
func GetTestName ¶
func GetTestName() string
GetTestName returns the test Name in a single string without spaces or /
func GinkgoPrint ¶
func GinkgoPrint(message string, optionalValues ...interface{})
GinkgoPrint send the given message to the test writers to store it.
func JustAfterEach ¶
func JustAfterEach(body func()) bool
JustAfterEach runs the function just after each test, before all AfterEeach, AfterFailed and AfterAll
func RunAfterEach ¶
func RunAfterEach(cs *scope)
RunAfterEach is a wrapper that executes all AfterEach functions that are stored in cs.afterEach array.
func SkipContextIf ¶ added in v1.6.1
SkipContextIf is a wrapper for the Context block which is being executed if the given condition is NOT met.
Types ¶
type JUnitFailureMessage ¶
JUnitFailureMessage failure message struct
type JUnitReporter ¶
type JUnitReporter struct {
// contains filtered or unexported fields
}
JUnitReporter struct that uses ginkgo to report
func NewJUnitReporter ¶
func NewJUnitReporter(filename string) *JUnitReporter
NewJUnitReporter creates a new JUnit XML reporter. The XML will be stored in the passed in filename.
func (*JUnitReporter) AfterSuiteDidRun ¶
func (reporter *JUnitReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary)
AfterSuiteDidRun ginkgo.Aftersuite report function
func (*JUnitReporter) BeforeSuiteDidRun ¶
func (reporter *JUnitReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary)
BeforeSuiteDidRun Beforesuite report function
func (*JUnitReporter) SpecDidComplete ¶
func (reporter *JUnitReporter) SpecDidComplete(specSummary *types.SpecSummary)
SpecDidComplete reports the test results in a JUTestCase struct
func (*JUnitReporter) SpecSuiteDidEnd ¶
func (reporter *JUnitReporter) SpecSuiteDidEnd(summary *types.SuiteSummary)
SpecSuiteDidEnd summary information to Suite summary in the xml report
func (*JUnitReporter) SpecSuiteWillBegin ¶
func (reporter *JUnitReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary)
SpecSuiteWillBegin create the main JUnitTestSuite based on Ginkgo parameters
func (*JUnitReporter) SpecWillRun ¶
func (reporter *JUnitReporter) SpecWillRun(specSummary *types.SpecSummary)
SpecWillRun needed by ginkgo. Not used.
type JUnitSkipped ¶
JUnitSkipped skipped struct to report XML
type JUnitTestCase ¶
type JUnitTestCase struct { Name string `xml:"name,attr"` ClassName string `xml:"classname,attr"` FailureMessage *JUnitFailureMessage `xml:"failure,omitempty"` Skipped *JUnitSkipped `xml:"skipped,omitempty"` Time float64 `xml:"time,attr"` SystemErr string `xml:"system-err,omitempty"` SystemOut string `xml:"system-out,omitempty"` }
JUnitTestCase test case struct to report in Junit Format.
type JUnitTestSuite ¶
type JUnitTestSuite struct { XMLName xml.Name `xml:"testsuite"` TestCases []JUnitTestCase `xml:"testcase"` Name string `xml:"name,attr"` Tests int `xml:"tests,attr"` Failures int `xml:"failures,attr"` Errors int `xml:"errors,attr"` Time float64 `xml:"time,attr"` }
JUnitTestSuite main struct to report all test in Junit Format