Additional Reports

To generate a report/custom-reports custom report or upload report data to your server, specify a reportGenerator config property. package scenarios.graphql url = "http://localhost:8180" graphQLIgnoreIntrospectionFailures = false reportGenerator = Report.&generateReport Where Report.&generateReport is implemented as follows: package scenarios.graphql import org.testingisdocumenting.webtau.console.ConsoleOutputs import org.testingisdocumenting.webtau.console.ansi.Color import org.testingisdocumenting.webtau.reporter.WebTauReport import org.testingisdocumenting.webtau.utils.JsonUtils import static org.testingisdocumenting.webtau.WebTauDsl.cfg class Report { static void generateReport(WebTauReport report) { def additionalData = [:] report.customDataStream.each { additionalData.putAll(it.toMap()) } def reportData = [:] reportData.graphQLSkippedQueries = additionalData.graphQLSkippedQueries // All queries present in the GraphQL schema but not tested reportData.graphQLCoveredQueries = additionalData.graphQLCoveredQueries // All queries present in the GraphQL schema and tested reportData.graphQLCoverageSummary = additionalData.graphQLCoverageSummary // Summary of test coverage compared to the GraphQL schema reportData.graphQLQueryTimeStatistics = additionalData.graphQLQueryTimeStatistics // Summary of timing by query reportData.graphQLCoveredSuccessBranches = additionalData.graphQLCoveredSuccessBranches // All queries present in the GraphQL schema that were hit with a success result reportData.graphQLSkippedSuccessBranches = additionalData.graphQLSkippedSuccessBranches // All queries present in the GraphQL schema but not hit with a success result reportData.graphQLCoveredErrorBranches = additionalData.graphQLCoveredErrorBranches // All queries present in the GraphQL schema that were hit with an error result reportData.graphQLSkippedErrorBranches = additionalData.graphQLSkippedErrorBranches // All queries present in the GraphQL schema but not hit with an error result def reportPath = cfg.workingDir.resolve('webtau.graphql-report.json') ConsoleOutputs.out('generating report: ', Color.PURPLE, reportPath) reportPath.toFile().text = JsonUtils.serializePrettyPrint(reportData) } } The output looks as follows: { "graphQLSkippedQueries" : [ { "name" : "taskById", "type" : "query" }, { "name" : "allTasks", "type" : "query" }, { "name" : "uncomplete", "type" : "mutation" }, { "name" : "complete", "type" : "mutation" } ], "graphQLCoveredQueries" : [ { "name" : "weather", "type" : "query" } ], "graphQLCoverageSummary" : { "coverage" : 0.2, "branchCoverage" : 0.1, "types" : { "mutation" : { "coverage" : 0.0, "declaredQueries" : 2, "coveredQueries" : 0.0 }, "query" : { "coverage" : 0.3333333333333333, "declaredQueries" : 3, "coveredQueries" : 1.0 } }, "successBranchCoverage" : 0.2, "errorBranchCoverage" : 0.0, "totalDeclaredQueries" : 5.0, "totalCoveredQueries" : 1.0 }, "graphQLQueryTimeStatistics" : [ { "name" : "weather", "type" : "query", "statistics" : { "mean" : 7.0, "min" : 7, "max" : 7, "count" : 1, "p95" : 7.0, "p99" : 7.0 } } ], "graphQLCoveredSuccessBranches" : [ { "name" : "weather", "type" : "query" } ], "graphQLSkippedSuccessBranches" : [ { "name" : "taskById", "type" : "query" }, { "name" : "allTasks", "type" : "query" }, { "name" : "uncomplete", "type" : "mutation" }, { "name" : "complete", "type" : "mutation" } ], "graphQLCoveredErrorBranches" : [ ], "graphQLSkippedErrorBranches" : [ { "name" : "taskById", "type" : "query" }, { "name" : "allTasks", "type" : "query" }, { "name" : "weather", "type" : "query" }, { "name" : "uncomplete", "type" : "mutation" }, { "name" : "complete", "type" : "mutation" } ] } Coverage and Timing Statistics WebTau will implicitly invoke your GraphQL server's introspection queries in order to fetch a subset of the schema. It uses this schema in conjunction with the requests in tests to compute:query coverage - which queries were invoked by tests and which were not as well as an overall summary of coverage timing information - http call timing statistics by query