Examples of waitForBackgroundJavaScript()


Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

        WebClient webClient = new WebClient();
        webClient.getOptions().setTimeout(1000);
        HtmlPage page = webClient.getPage("http://localhost:9001/jscoverage.html?index.html");

        page.getHtmlElementById("storeTab").click();
        webClient.waitForBackgroundJavaScript(500);
        page.getHtmlElementById("storeButton").click();
        webClient.waitForBackgroundJavaScript(2000);
        String result = page.getElementById("storeDiv").getTextContent();

        assertThat(result, containsString("Coverage data stored at target"));
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

        HtmlPage page = webClient.getPage("http://localhost:9001/jscoverage.html?index.html");

        page.getHtmlElementById("storeTab").click();
        webClient.waitForBackgroundJavaScript(500);
        page.getHtmlElementById("storeButton").click();
        webClient.waitForBackgroundJavaScript(2000);
        String result = page.getElementById("storeDiv").getTextContent();

        assertThat(result, containsString("Coverage data stored at target"));
    }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

        assertThat(json, containsString("/level1/level2/level2.js"));

        String url = "file:///" + new File(reportDir + "/jscoverage.html").getAbsolutePath();
        WebClient webClient = new WebClient();
        HtmlPage page = webClient.getPage(url);
        webClient.waitForBackgroundJavaScript(1000);
        assertEquals("53%", page.getElementById("summaryTotal").getTextContent());
        assertEquals("33%", page.getElementById("branchSummaryTotal").getTextContent());
        assertEquals("50%", page.getElementById("functionSummaryTotal").getTextContent());
        verifyCoverage(page, "/root.js", "80%", "50%", "100%");
        verifyCoverage(page, "/root-empty.js", "N/A", "N/A", "N/A");
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

    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");
        ScriptResult result = ((HtmlPage)webWindow.getEnclosedPage()).executeJavaScript("jscoverage_report();");
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

    private void saveReportByButton() throws IOException {
        WebClient webClient = new WebClient();
        HtmlPage page = webClient.getPage("http://localhost:9001/jscoverage.html?index.html");

        page.getHtmlElementById("summaryTab").click();
        webClient.waitForBackgroundJavaScript(2000);
        assertEquals("77%", page.getElementById("summaryTotal").getTextContent());

        verifyCoverage(page, "/root.js", "80%", "50%", "100%");
        verifyCoverage(page, "/level1/level1.js", "75%", "50%", "N/A");
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

                url = new URL(app + "/@tests/" + test);
            } else {
                url = new URL(app + "" + selenium + "?baseUrl=" + app + "&test=/@tests/" + test + ".suite&auto=true&resultsUrl=/@tests/" + test);
            }
            firephoque.openWindow(url, "headless");
            firephoque.waitForBackgroundJavaScript(5 * 60 * 1000);
            int retry = 0;
            while(retry < 5) {
                if (new File(root, test.replace("/", ".") + ".passed.html").exists()) {
                    System.out.print("PASSED     ");
                    break;
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

        webClient.setCssErrorHandler(new SilentCssErrorHandler());

        HtmlPage page = webClient.getPage(url);
        webClient.getJavaScriptEngine().pumpEventLoop(timeoutMillis);

        int waitForBackgroundJavaScript = webClient.waitForBackgroundJavaScript(jsTimeoutMillis);
        int loopCount = 0;

        while (waitForBackgroundJavaScript > 0 && loopCount < maxLoopChecks) {
            ++loopCount;
            waitForBackgroundJavaScript = webClient.waitForBackgroundJavaScript(jsTimeoutMillis);
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

        int waitForBackgroundJavaScript = webClient.waitForBackgroundJavaScript(jsTimeoutMillis);
        int loopCount = 0;

        while (waitForBackgroundJavaScript > 0 && loopCount < maxLoopChecks) {
            ++loopCount;
            waitForBackgroundJavaScript = webClient.waitForBackgroundJavaScript(jsTimeoutMillis);

            if (waitForBackgroundJavaScript == 0) {
                log.fine("HtmlUnit exits background javascript at loop counter " + loopCount);
                break;
            }
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

                url = new URL(app + "/@tests/" + test);
            } else {
                url = new URL(app + "" + selenium + "?baseUrl=" + app + "&test=/@tests/" + test + ".suite&auto=true&resultsUrl=/@tests/" + test);
            }
            firephoque.openWindow(url, "headless");
            firephoque.waitForBackgroundJavaScript(5 * 60 * 1000);
            int retry = 0;
            while(retry < 5) {
                if (new File(root, test.replace("/", ".") + ".passed.html").exists()) {
                    System.out.print("PASSED     ");
                    break;
View Full Code Here

Examples of com.gargoylesoftware.htmlunit.WebClient.waitForBackgroundJavaScript()

                url = new URL(app + "/@tests/" + test);
            } else {
                url = new URL(app + "" + selenium + "?baseUrl=" + app + "&test=/@tests/" + test + ".suite&auto=true&resultsUrl=/@tests/" + test);
            }
            firephoque.openWindow(url, "headless");
            firephoque.waitForBackgroundJavaScript(5 * 60 * 1000);
            int retry = 0;
            while(retry < 5) {
                if (new File(root, test.replace("/", ".") + ".passed.html").exists()) {
                    System.out.print("PASSED     ");
                    break;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.