use of com.gargoylesoftware.htmlunit.WebWindow in project JSCover by tntim96.
the class HtmlUnitMergeTest method saveReportByJavaScript.
private void saveReportByJavaScript() throws IOException {
WebClient webClient = new WebClient();
HtmlPage page = webClient.getPage("http://localhost:9001/jscoverage.html");
((HtmlInput) page.getHtmlElementById("location")).setValueAttribute("http://localhost:9001/index.html");
page.getHtmlElementById("openInWindowButton").click();
webClient.waitForBackgroundJavaScript(100);
// verifyTotal(webClient, page, 15);
WebWindow webWindow = webClient.getWebWindowByName("jscoverage_window");
((HtmlPage) webWindow.getEnclosedPage()).executeJavaScript("jscoverage_report();");
webClient.waitForBackgroundJavaScript(2000);
}
use of com.gargoylesoftware.htmlunit.WebWindow in project JSCover by tntim96.
the class HtmlUnitIsolateBrowserTest method shouldNotCombineCoverage.
@Test
public void shouldNotCombineCoverage() throws IOException, InterruptedException {
HtmlPage page = webClient.getPage("http://localhost:9001/" + getTestUrl());
page.getElementById("radio4").click();
page.getHtmlElementById("launchDuplicate").click();
webClient.waitForBackgroundJavaScript(100);
WebWindow webWindow = webClient.getWebWindowByName("JSCoverInvertedModeDuplicateWindow");
HtmlPage duplicatePage = (HtmlPage) webWindow.getEnclosedPage();
duplicatePage.getElementById("radio1").click();
duplicatePage.executeJavaScript("jscoverage_report();");
webClient.waitForBackgroundJavaScript(2000);
page = webClient.getPage("file:///" + new File(getReportDir() + "/jscoverage.html").getAbsolutePath());
verifyTotal(page, 57, 12, 33);
}
Aggregations