Examples of waitForBackgroundJavaScript()


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

        WebClient wc = startWebClient(false);
        wc.setJavaScriptEnabled(withJavascript);
        HtmlPage page = goToChangePreferredLocalePage(wc);
        HtmlForm form = page.getHtmlElementById("changePreferredLocaleForm");
        page = form.getInputByValue("Cancel").click();
        wc.waitForBackgroundJavaScript(10000L);
        WebAssert.assertElementNotPresent(page, "changePreferredLocaleForm");
        testTitle(page, "Preferences");
    }

    public void testFormSubmission(boolean withJavascript) throws Exception {
View Full Code Here

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

        HtmlPage page = goToChangePreferredLocalePage(wc);
        HtmlForm form = page.getHtmlElementById("changePreferredLocaleForm");
        assertEquals("None (automatic detection)", form.getSelectByName("locale").asText());
        form.getSelectByName("locale").setSelectedAttribute("fr", true);
        page = form.getInputByValue("Choose").click();
        wc.waitForBackgroundJavaScript(10000L);
        testTitle(page, "Pr\u00e9f\u00e9rences");
        testMessageExists(page, "La langue pr\u00e9f\u00e9r\u00e9e a \u00e9t\u00e9 modifi\u00e9e.");
        WebAssert.assertElementNotPresent(page, "changePreferredLocaleForm");

        page = page.getAnchorByText("Choisir votre langue pr\u00e9f\u00e9r\u00e9e").click();
View Full Code Here

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

        testTitle(page, "Pr\u00e9f\u00e9rences");
        testMessageExists(page, "La langue pr\u00e9f\u00e9r\u00e9e a \u00e9t\u00e9 modifi\u00e9e.");
        WebAssert.assertElementNotPresent(page, "changePreferredLocaleForm");

        page = page.getAnchorByText("Choisir votre langue pr\u00e9f\u00e9r\u00e9e").click();
        wc.waitForBackgroundJavaScript(10000L);
        form = page.getHtmlElementById("changePreferredLocaleForm");
        assertEquals("fran\u00e7ais", form.getSelectByName("locale").asText());
        form.getSelectByName("locale").setSelectedAttribute("", true);
        page = form.getInputByValue("Choisir").click();
        wc.waitForBackgroundJavaScript(10000L);
View Full Code Here

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

        wc.waitForBackgroundJavaScript(10000L);
        form = page.getHtmlElementById("changePreferredLocaleForm");
        assertEquals("fran\u00e7ais", form.getSelectByName("locale").asText());
        form.getSelectByName("locale").setSelectedAttribute("", true);
        page = form.getInputByValue("Choisir").click();
        wc.waitForBackgroundJavaScript(10000L);
        testTitle(page, "Preferences");
        testMessageExists(page, "The preferred language has been changed.");
    }

    private HtmlPage goToChangePreferredLocalePage(WebClient wc) throws Exception {
View Full Code Here

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

        String xmlBefore = page.getHtmlElementById("strength").asXml();
        form.getInputByName("lowerCaseLettersIncluded").setChecked(false);
        form.getInputByName("upperCaseLettersIncluded").setChecked(false);
        form.getInputByName("digitsIncluded").setChecked(false);
        form.getInputByName("specialCharactersIncluded").setChecked(false);
        wc.waitForBackgroundJavaScript(10000L);
        assertEquals("disabled", page.getHtmlElementById("submitButton").getAttribute("disabled"));
        String xmlAfter = page.getHtmlElementById("strength").asXml();
        assertFalse(xmlBefore.equals(xmlAfter));
    }
View Full Code Here

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

        form.getSelectByName("length").setSelectedAttribute("10", true);
        form.getInputByName("lowerCaseLettersIncluded").click();
        form.getInputByName("digitsIncluded").click();

        page = form.getInputByValue("Change").click();
        wc.waitForBackgroundJavaScript(10000L);
        testTitle(page, "Preferences");
        testMessageExists(page, "The random password generation preferences have been changed.");
        WebAssert.assertElementNotPresent(page, "changePasswordGenerationPreferencesForm");

        page = page.getAnchorByText("Random password generation preferences").click();
View Full Code Here

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

        testTitle(page, "Preferences");
        testMessageExists(page, "The random password generation preferences have been changed.");
        WebAssert.assertElementNotPresent(page, "changePasswordGenerationPreferencesForm");

        page = page.getAnchorByText("Random password generation preferences").click();
        wc.waitForBackgroundJavaScript(10000L);
        form = page.getHtmlElementById("changePasswordGenerationPreferencesForm");
        assertEquals("10", form.getSelectByName("length").getSelectedOptions().get(0).getValueAttribute());
        assertFalse(form.getInputByName("lowerCaseLettersIncluded").isChecked());
        assertTrue(form.getInputByName("upperCaseLettersIncluded").isChecked());
        assertFalse(form.getInputByName("digitsIncluded").isChecked());
View Full Code Here

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

        WebClient wc = startWebClient(false);
        wc.setJavaScriptEnabled(withJavascript);
        HtmlPage page = goToChangePasswordGenerationPreferencesPage(wc);
        HtmlForm form = page.getHtmlElementById("changePasswordGenerationPreferencesForm");
        page = form.getInputByValue("Cancel").click();
        wc.waitForBackgroundJavaScript(10000L);
        testTitle(page, "Preferences");
        WebAssert.assertElementNotPresent(page, "changePasswordGenerationPreferencesForm");
    }

    private HtmlPage goToChangePasswordGenerationPreferencesPage(WebClient wc) throws Exception {
View Full Code Here

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

    protected void testPasswordGenerationOptionsForm(HtmlPage page, String formId) throws IOException {
        WebClient wc = page.getWebClient();
        HtmlForm form = page.getHtmlElementById(formId);
        HtmlAnchor generatePasswordWithOptionsLink = getFirstLinkByText(form, "with options");
        generatePasswordWithOptionsLink.click();
        wc.waitForBackgroundJavaScript(10000L);
        testBasics(page);

        assertEquals("8", page.getHtmlElementById("passwordLength").asText());
        assertTrue(((HtmlCheckBoxInput) page.getHtmlElementById("lowerCaseLettersIncluded")).isChecked());
        assertTrue(((HtmlCheckBoxInput) page.getHtmlElementById("upperCaseLettersIncluded")).isChecked());
View Full Code Here

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

    protected void testPasswordGenerationCancel(HtmlPage page, String formId) throws IOException {
        WebClient wc = page.getWebClient();
        HtmlForm form = page.getHtmlElementById(formId);
        HtmlAnchor generatePasswordWithOptionsLink = getFirstLinkByText(form, "with options");
        generatePasswordWithOptionsLink.click();
        wc.waitForBackgroundJavaScript(10000L);
        assertFalse(StringUtils.isEmpty(page.getHtmlElementById("generatePasswordDiv").asText()));
        page.getHtmlElementById("cancelPasswordGenerationButton").click();
        wc.waitForBackgroundJavaScript(10000L);
        assertTrue(StringUtils.isEmpty(page.getHtmlElementById("generatePasswordDiv").asText()));
    }
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.