in gepard-selenium/src/main/java/com/epam/gepard/selenium/browsers/WebDriverUtil.java [362:391]
public void logEvent(final String text, final boolean makeDump) {
String addStr = "";
if (!text.startsWith("<font")) {
tc.getTestClassExecutionData().addSysOut(text);
}
if (tc.getTestClassExecutionData().getHtmlRunReporter().getTestMethodHtmlLog() != null) {
if (makeDump) {
try {
String dumpFileName = dumpSource(true);
File dumpFile = new File(dumpFileName);
String screenshotFileName = dumpFileName + ".png";
if (selenium != null) {
selenium.windowMaximize();
WebDriver augmentedDriver = new Augmenter().augment(webDriver);
File screenShot = ((TakesScreenshot) augmentedDriver).getScreenshotAs(OutputType.FILE);
FileUtil fileUtil = new FileUtil();
File screenShotFile = new File(screenshotFileName);
fileUtil.copy(screenShot, screenShotFile);
}
String dumpFileName2 = dumpSource(false);
File dumpFile2 = new File(dumpFileName2);
addStr = " <small>[<a href=\"" + dumpFile.getName() + "\" target=\"_new\">source</a>]" + " [<a href=\"" + dumpFile2.getName()
+ "\" target=\"_new\">view</a>]" + " [<a href=\"" + dumpFile.getName() + ".png\" target=\"_new\">screenshot</a>]</small>";
} catch (Exception e) {
addStr = " <small>[Dump failed]</small>";
}
}
tc.getTestClassExecutionData().getHtmlRunReporter().getTestMethodHtmlLog().insertText("<tr><td> </td><td bgcolor=\"#F0F0F0\">" + text + addStr + "</td></tr>\n");
}
}