Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reporter ¶
type Reporter struct { TestResults []report.TestResult Dst io.Writer // contains filtered or unexported fields }
Reporter implements report.Reporter and highlights the most important test results.
func (*Reporter) Add ¶
func (r *Reporter) Add(t report.TestResult)
Add adds the test result that can be rendered by Render.
func (*Reporter) ArtifactRequirements ¶
func (r *Reporter) ArtifactRequirements() []report.ArtifactType
ArtifactRequirements returns a list of artifact types this reporter requires to create a proper report.
func (*Reporter) Render ¶
func (r *Reporter) Render()
Render renders out a test summary.
Example ¶
startTime := time.Now() restResults := []report.TestResult{ { Name: "Chrome", Duration: 171452 * time.Millisecond, StartTime: startTime, EndTime: startTime.Add(171452 * time.Millisecond), Status: job.StateFailed, Browser: "Chrome", Platform: "Windows 10", URL: "https://app.saucelabs.com/tests/1234567890abcdef", Attempts: []report.Attempt{ { Status: job.StateFailed, TestSuites: junit.TestSuites{ TestSuites: []junit.TestSuite{ { Name: "", TestCases: []junit.TestCase{ { Name: "TestCase1", ClassName: "com.saucelabs.examples.SauceTest", Error: &junit.Error{ Message: "Whoops!", Type: "AssertionError", }, }, }, }, }, }, }, }, }, } r := Reporter{ Dst: os.Stdout, } for _, tr := range restResults { r.Add(tr) } r.Render()
Output: Spotlight: ✖ Chrome ● URL: https://app.saucelabs.com/tests/1234567890abcdef ● Failed Tests: (showing max. 5) ✖ com.saucelabs.examples.SauceTest › TestCase1
Click to show internal directories.
Click to hide internal directories.