Introduction
The Cuanto TestNgListener's purpose is to submit the result of a test (TestOutcome) to the Cuanto server. The TestNgListener class should implement TestNG's ITestListener interface.
Behavior
The listener should look for the system variables cuanto.url, cuanto.projectkey and cuanto.testrun. If either the projectKey or the url are not found, a CuantoClientException should be thrown.
The following properties of cuanto.api.TestOutcome should be set before the TestOutcome is submitted to the Cuanto server: testCase, testResult, duration, startedAt, and finishedAt.
Valid values for testResult are "Pass", "Fail", "Error", "Ignore", "Skip" and "Unexecuted", although this final one will probably never be submitted. |
If the testResult is "Fail" or "Error", TestOutcome.testOutput should be set to STDOUT concatenated with STDERR, with a blank line separating the two, or interspersed in the order the output appeared, if possible.
If it isn't possible to grab the STDOUT and STDERR, perhaps we consider implementing an IReporter that updates Cuanto with the output info once the suite execution has completed. |
If a testRunId is specified, that ID should be submitted to Cuanto along with the TestOutcome.
The listener should be able to determine which groups the TestNG test is tagged with. A future version of Cuanto will have testGroups as a property of TestOutcome.