Commit f0bb0595 authored by holivier's avatar holivier

LogSelenium: add a specifics javascript call for vuejs

showSeleniumInfoPanel
parent 127cb61c
......@@ -14,7 +14,7 @@ import org.openqa.selenium.JavascriptExecutor;
/**
* les méthodes permettant de loguer des messages lors de test Selenium-webdriver.
*
*
*/
public class LogSelenium {
public static final String module = LogSelenium.class.getName();
......@@ -72,7 +72,7 @@ public class LogSelenium {
break;
}
}
Map<String, String> info = new HashMap<String, String>();
Map<String, String> info = new HashMap<String, String>();
if (className.length() > 19) className = className.substring(19); // remove com.otoit.selenium.
info.put("c", className);
info.put("f", fileName);
......@@ -107,8 +107,13 @@ public class LogSelenium {
System.out.println(formatMessage(info, message, level));
}
if (infoPanelEnabled()) {
//message = info.get("m") + " : " + message; OHE 2018-11-21 not necessary because in logMessage it's possible to have method name calling and more ...
js.executeScript("showSeleniumInfoPanel('" + StringEscapeUtils.escapeJavaScript(message) +"', '" + seconds * 1000 + "')", new Object[]{ null });
if (wdtc.isVuejs() ) {
js.executeScript("window.showSeleniumInfoPanel({panelMessage: '"
+ StringEscapeUtils.escapeJavaScript(message)
+ "',panelTimeout: "+seconds * 1000 +"})", new Object[]{ null }); // two other parameter exist panelTitle and panelColor
} else {
js.executeScript("showSeleniumInfoPanel('" + StringEscapeUtils.escapeJavaScript(message) +"', '" + seconds * 1000 + "')", new Object[]{ null });
}
Thread.sleep(seconds * 1000 + 1000);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment