use of org.apache.velocity.Template in project selenium-tests by Wikia.
the class VelocityWrapper method fillLogRow.
static void fillLogRow(List<LogData> logData, String command, String description) {
StringBuilder builder = new StringBuilder();
Template t = velocityEngine.getTemplate(LOG_ROW_TEMPLATE_PATH);
VelocityContext context = new VelocityContext();
context.put("className", "\"" + logData.stream().map(e -> e.cssClass()).collect(Collectors.joining(" ")) + "\"");
context.put("command", command);
context.put("description", description);
StringWriter writer = new StringWriter();
t.merge(context, writer);
builder.append(writer.toString());
CommonUtils.appendTextToFile(Log.LOG_PATH, builder.toString());
}
use of org.apache.velocity.Template in project selenium-tests by Wikia.
the class VelocityWrapper method fillLastLogRow.
static String fillLastLogRow() {
StringBuilder builder = new StringBuilder();
Template t = velocityEngine.getTemplate(LAST_LOG_ROW_TEMPLATE_PATH);
VelocityContext context = new VelocityContext();
StringWriter writer = new StringWriter();
t.merge(context, writer);
builder.append(writer.toString());
return builder.toString();
}
use of org.apache.velocity.Template in project selenium-tests by Wikia.
the class VelocityWrapper method fillLink.
public static String fillLink(String link, String label) {
StringBuilder builder = new StringBuilder();
Template t = velocityEngine.getTemplate(LINK_TEMPLATE_PATH);
VelocityContext context = new VelocityContext();
context.put("link", link);
context.put("label", label);
StringWriter writer = new StringWriter();
t.merge(context, writer);
builder.append(writer.toString());
return builder.toString();
}
use of org.apache.velocity.Template in project selenium-tests by Wikia.
the class VelocityWrapper method fillHeader.
static String fillHeader(String date, String polishDate, String browser, String os, String testingEnvironmentUrl, String testingEnvironment, String testedVersion, String mercuryVersion) {
StringBuilder builder = new StringBuilder();
Template t = velocityEngine.getTemplate(HEADER_TEMPLATE_PATH);
VelocityContext context = new VelocityContext();
context.put("date", date);
context.put("polishDate", polishDate);
context.put("browser", browser);
context.put("os", os);
context.put("testingEnvironmentUrl", testingEnvironmentUrl);
context.put("testingEnvironment", testingEnvironment);
context.put("testedVersion", testedVersion);
context.put("mobileWikiVersion", mercuryVersion);
StringWriter writer = new StringWriter();
t.merge(context, writer);
builder.append(writer.toString());
return builder.toString();
}
use of org.apache.velocity.Template in project selenium-tests by Wikia.
the class VelocityWrapper method fillLogRowWithScreenshot.
static void fillLogRowWithScreenshot(List<LogData> logData, String command, String description, long imageCounter) {
StringBuilder builder = new StringBuilder();
Template t = velocityEngine.getTemplate(LOG_ROW_WITH_SCREENSHOT_TEMPLATE_PATH);
VelocityContext context = new VelocityContext();
context.put("className", "\"" + logData.stream().map(e -> e.cssClass()).collect(Collectors.joining(" ")) + "\"");
context.put("command", command);
context.put("description", description);
context.put("imageCounter", String.valueOf(imageCounter));
StringWriter writer = new StringWriter();
t.merge(context, writer);
builder.append(writer.toString());
CommonUtils.appendTextToFile(Log.LOG_PATH, builder.toString());
}
Aggregations