private HtmlAttributes getClass(String cssClassName) { return new HtmlAttributes().class_(cssClassName); }
private static void writeColorBlock(HashMap<String, String> list, String string) throws IOException { // TODO: Create a class for this style in our stylesheet. html.div(style("background-color:" + list.get(string) + ";").class_("color-block"))._div(); }
private void generatePiechart(HtmlCanvas reportPageBody, IRunTestResults iRunTestResults) throws IOException { HtmlCanvas divSummary = reportPageBody.div(); divSummary.div(new HtmlAttributes().id(PIECHART_ID))._div(); HtmlCanvas divTestSummary = divSummary.div(new HtmlAttributes().class_(TEST_SUMMARY_CLASS)); int passedCount = iRunTestResults.getPassedTests().size(); int skippedCount = iRunTestResults.getSkippedTests().size(); int failedCount = iRunTestResults.getFailedTests().size(); divTestSummary.h2().content(format(PASSED_TESTS, passedCount)); divTestSummary.h2().content(format(FAILED_TESTS, failedCount)); divTestSummary.h2().content(format(SKIPPED_TESTS, skippedCount)); divTestSummary._div(); divSummary._div(); // Hidden divs used to be able to link data to piechart.js reportPageBody.div(new HtmlAttributes().id(PASSED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(passedCount); reportPageBody.div(new HtmlAttributes().id(FAILED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(failedCount); reportPageBody.div(new HtmlAttributes().id(SKIPPED.toLowerCase(ENGLISH)) .class_(HIDDEN_CLASS)).content(skippedCount); }
void generateHeader(HtmlCanvas reportPageBody, String cloudSlangImage) throws IOException { HtmlCanvas headerDiv = reportPageBody.div(new HtmlAttributes().id(HEADER_BAR_ID)); HtmlCanvas anchor = headerDiv.a(new HtmlAttributes().href(HTTP_CLOUD_SLANG_IO).target(BLANK)); HtmlCanvas img = new HtmlCanvas().img(new HtmlAttributes().src(cloudSlangImage).alt(CLOUD_SLANG_LOGO_ALT)); anchor.content(img.toHtml(), false); headerDiv._div(); reportPageBody.h1(new HtmlAttributes().class_(REPORT_TITLE_CLASS)).content(TEST_CASE_REPORT); }
private HtmlCanvas addIssue(HtmlCanvas html, Issue issue) throws IOException { MutableDataSet options = new MutableDataSet(); Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); String description = issue.getDescription(); description = renderer.render(parser.parse(description)); return html.li().h5().write(issue.getTitle() + " ").a(href(gitlabRepository + "/issues/"+issue.getIid()).class_("external")).write("#"+issue.getIid())._a()._h5().write(description, false)._li(); }
private HtmlCanvas addMergeRequest(HtmlCanvas html, MergeRequest mergeRequest) throws IOException { MutableDataSet options = new MutableDataSet(); Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); String description = mergeRequest.getDescription(); description = renderer.render(parser.parse(description)); return html.li().h5().write(mergeRequest.getTitle() + " ").a(href(gitlabRepository + "/merge_requests/"+mergeRequest.getIid()).class_("external")).write("#"+mergeRequest.getIid())._a()._h5().write(description, false)._li(); }
public void generateTestCaseReportTable(HtmlCanvas htmlCanvas, IRunTestResults iRunTestResults) throws IOException { HtmlCanvas table = htmlCanvas.table(new HtmlAttributes().class_(TABLE_CLASS)); table.tr().th().content(TEST_NAME) .th(getClass(TEST_SUITES_CSS_CLASS)).content(TEST_SUITE) .th(getClass(STATUS_CSS_CLASS)).content(TEST_STATUS) .th().content(TEST_FLOW_PATH) .th().content(TEST_DESCRIPTION) .th().content(OUTPUTS) .th().content(EXCEPTION_OR_MESSAGE) ._tr(); appendTestRuns(table, iRunTestResults.getPassedTests(), PASSED); appendTestRuns(table, iRunTestResults.getFailedTests(), FAILED); appendTestRuns(table, iRunTestResults.getSkippedTests(), SKIPPED); }
html.table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")).
@Override public void renderOn(HtmlCanvas html) throws IOException { html. div(class_("section")). h3(id("Lifecycle_"+this.getPackagingName())).a(href("packaging-"+this.getPackagingName()+".html")).write(this.getPackagingName())._a()._h3(). table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")). th().write("Phase")._th(). th().write("Goal")._th(). _tr() ._thead(). tbody(); for (t3.LifecyclesUtils.Phase phase : this.getPhases()) { ((Phase) phase).renderOn(html); } html ._tbody() ._table() ._div(); }