use of com.seleniumtests.reporter.info.ImageLinkInfo in project seleniumRobot by bhecquet.
the class TestImageLinkInfo method testOtherFormatLink.
@Test(groups = { "ut" })
public void testOtherFormatLink() {
String formatOther = new ImageLinkInfo("/imageCapture.png").encode("avi");
Assert.assertEquals(formatOther, "Image");
}
use of com.seleniumtests.reporter.info.ImageLinkInfo in project seleniumRobot by bhecquet.
the class WebUIDriver method logFinalDriverState.
/**
* Logs current state of the browser
*/
private void logFinalDriverState(ITestResult testResult) {
if (driver != null) {
try {
// issue #414: capture the whole screen
driver.switchTo().defaultContent();
// force screenshotUtil to use the driver of this WebUiDriver, not the currently selected one
for (ScreenShot screenshot : new ScreenshotUtil(driver).capture(SnapshotTarget.PAGE, ScreenShot.class, true, true)) {
scenarioLogger.logScreenshot(screenshot, null, name, SnapshotCheckType.FALSE);
// add the last screenshots to TestInfo so that there is a quicklink on reports
Info lastStateInfo = TestNGResultUtils.getTestInfo(testResult).get(TestStepManager.LAST_STATE_NAME);
if (lastStateInfo != null) {
((MultipleInfo) lastStateInfo).addInfo(new ImageLinkInfo(TestNGResultUtils.getUniqueTestName(testResult) + "/" + screenshot.getImagePath()));
}
}
} catch (Exception e) {
scenarioLogger.log("Error while logging: " + e.getMessage());
}
}
try {
// stop HAR capture
if (config.getBrowserMobProxy() != null) {
Har har = config.getBrowserMobProxy().endHar();
scenarioLogger.logNetworkCapture(har, name);
}
} catch (Exception e) {
scenarioLogger.log("Error while logging: " + e.getMessage());
} finally {
config.setBrowserMobProxy(null);
}
}
use of com.seleniumtests.reporter.info.ImageLinkInfo in project seleniumRobot by bhecquet.
the class TestImageLinkInfo method testNullFormatLink.
@Test(groups = { "ut" })
public void testNullFormatLink() {
String formatNull = new ImageLinkInfo("/imageCapture.png").encode(null);
Assert.assertEquals(formatNull, "Image");
}
use of com.seleniumtests.reporter.info.ImageLinkInfo in project seleniumRobot by bhecquet.
the class TestImageLinkInfo method testHtmlLink.
@Test(groups = { "ut" })
public void testHtmlLink() {
String formatHtml = new ImageLinkInfo("/imageCapture.html").encode("html");
Assert.assertEquals(formatHtml, "<a href=\"/imageCapture.html\"><i class=\"fas fa-file-image\" aria-hidden=\"true\"></i></a>");
}
Aggregations