private void appendTestRunRowToTable(HtmlCanvas table, TestRun testRun, SlangTestCase testCase, String result) throws IOException { table.tr().td().content(testCase.getName()) .td(getClass(TEST_SUITES_CSS_CLASS)).content(getTestSuites(testCase)) .td(getClass(STATUS_CSS_CLASS)).content(result) .td().content(testCase.getTestFlowPath()) .td().content(testCase.getDescription()) .td().content(getOutputs(testCase)) .td().content(testRun.getMessage()) ._tr(); }
private static void amendReport() throws IOException { html.script().content(StringResource.get("/raphael/raphael-min.js"), NO_ESCAPE); html.script().content(StringResource.get("/prototype/prototype.js"), NO_ESCAPE); html.script().content(StringResource.get("/grafico/grafico-min.js"), NO_ESCAPE); html.write(graphs.toString(), NO_ESCAPE); html._body()._html(); }
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); }
private static void generateList(ArrayList<String> list) throws IOException { if(list.size() == 0) { html.p().content("No tests of this type found."); } else { html.ul(); for (int i = 0; i < list.size(); i++) { html.li().a(href("#" + list.get(i))).write(list.get(i))._a()._li(); } html._ul(); } }
private static <T> void writeTestTables(Class<T> testClass) throws IOException { html.b().a(href("#" + testClass.getCanonicalName())) .content(testClass.getCanonicalName())._b(); html.br(); writeTestClassTable(testClass); html.br(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { HtmlCanvas tbody = html .table(class_("table table-condensed")) .tbody(); for (File file : files) { tbody .tr() .td(class_(tdClass)).content(root.relativize(file.toPath()).toString()) ._tr(); } tbody ._tbody() ._table(); } }
private static void toTestClass(String name) throws IOException { html.p(class_("totest")).a(href("#" + name)) .content("Back to Main Test Class")._p(); }
private void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); } private void writeOverallBarChart() throws IOException {
private void generateList(String[] list, String title) throws IOException { html.h2().write(title)._h2(); if (list.length == 0) { html.div(style("padding-left:2em")).i() .content("No groups of this type found in the test suite") ._div(); } else { html.ul(); for (String group : list) { html.li().content(group); } html._ul(); } }
private static void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); }
private void generateMethodDetails(List<ISuite> suites) throws IOException { html.h1().content("Test Method Details"); for (ISuite suite : suites) { Map<String, ISuiteResult> r = suite.getResults(); for (ISuiteResult r2 : r.values()) { ITestContext testContext = r2.getTestContext(); generateDetail(testContext.getFailedTests()); generateDetail(testContext.getSkippedTests()); generateDetail(testContext.getPassedTests()); } } }
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); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().stylesheet("/dist/bootstrap.min.css") .macros().stylesheet("/dist/gumtree.css") ._head(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().stylesheet("/dist/bootstrap.min.css") .macros().stylesheet("/dist/gumtree.css") ._head(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .div(class_("col-lg-12")) .div(class_("btn-toolbar pull-right")) .div(class_("btn-group")) .a(class_("btn btn-default btn-xs").id("legend").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<span class="del"> </span> deleted<br><span class="add"> </span> added<br><span class="mv"> </span> moved<br><span class="upd"> </span> updated<br>", false).add("data-original-title", "Legend").title("Legend").role("button")).content("Legend") .a(class_("btn btn-default btn-xs").id("shortcuts").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<b>q</b> quit<br><b>l</b> list<br><b>n</b> next<br><b>t</b> top<br><b>b</b> bottom", false).add("data-original-title", "Shortcuts").title("Shortcuts").role("button")).content("Shortcuts") ._div() .div(class_("btn-group")) .a(class_("btn btn-default btn-xs btn-danger").href("/quit")).content("Quit") ._div() ._div() ._div(); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { html.render(DocType.HTML5) .html() .head() .render(new Head()) .title().content(templateDescriptor.getDefaultTitle()) ._head() .body() .render(new BodyStart()) .render(this.component) .render(new BodyEnd()) ._body() ._html(); }