Package com.gargoylesoftware.htmlunit.html

Examples of com.gargoylesoftware.htmlunit.html.HtmlAnchor.click()


    private HtmlPage goToChangePasswordGenerationPreferencesPage(WebClient wc) throws Exception {
        login(wc);
        HtmlPage page = wc.getPage(url("/preferences/Preferences.action"));
        HtmlAnchor link = page.getAnchorByText("Random password generation preferences");
        HtmlPage result = link.click();
        wc.waitForBackgroundJavaScript(10000L);
        return result;
    }
}
View Full Code Here


    protected void testPasswordGeneration(HtmlPage page, String formId) throws IOException {
        HtmlForm form = page.getHtmlElementById(formId);
        form.getInputByName("password").setValueAttribute("");
        HtmlAnchor generatePasswordLink = getFirstLinkByText(form, "Generate randomly");
        generatePasswordLink.click();
        assertEquals(8, form.getInputByName("password").getValueAttribute().length());
    }

    protected void testPasswordGenerationOptionsForm(HtmlPage page, String formId) throws IOException {
        WebClient wc = page.getWebClient();
View Full Code Here

    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());
View Full Code Here

    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

    protected void testPasswordGenerationSubmit(HtmlPage page, String formId) throws IOException {
        WebClient wc = page.getWebClient();
        HtmlForm form = page.getHtmlElementById(formId);
        form.getInputByName("password").setValueAttribute("");
        HtmlAnchor generatePasswordWithOptionsLink = getFirstLinkByText(form, "with options");
        generatePasswordWithOptionsLink.click();
        wc.waitForBackgroundJavaScript(10000L);
        page.getHtmlElementById("generatePasswordButton").click();
        wc.waitForBackgroundJavaScript(10000L);
        assertTrue(StringUtils.isEmpty(page.getHtmlElementById("generatePasswordDiv").asText()));
        assertEquals(8, form.getInputByName("password").getValueAttribute().length());
View Full Code Here

    private HtmlPage goToChangePreferredTimeZonePage(WebClient wc) throws Exception {
        login(wc);
        HtmlPage page = wc.getPage(url("/preferences/Preferences.action"));
        HtmlAnchor link = page.getAnchorByText("Choose your time zone");
        HtmlPage result = link.click();
        wc.waitForBackgroundJavaScript(10000L);
        return result;
    }
}
View Full Code Here

    public void testLinks() throws Exception {
        WebClient wc = startWebClient();
        login(wc);
        HtmlPage page = wc.getPage(url("/account/Account.action"));
        HtmlAnchor changeMasterPasswordLink = page.getAnchorByText("Change your master password");
        HtmlPage changeMasterPasswordPage = changeMasterPasswordLink.click();
        testTitle(changeMasterPasswordPage, "Change master password");

        HtmlAnchor destroyAccountLink = page.getAnchorByText("Destroy your account");
        HtmlPage destroyAccountPage = destroyAccountLink.click();
        testTitle(destroyAccountPage, "Destroy account");
View Full Code Here

        HtmlAnchor changeMasterPasswordLink = page.getAnchorByText("Change your master password");
        HtmlPage changeMasterPasswordPage = changeMasterPasswordLink.click();
        testTitle(changeMasterPasswordPage, "Change master password");

        HtmlAnchor destroyAccountLink = page.getAnchorByText("Destroy your account");
        HtmlPage destroyAccountPage = destroyAccountLink.click();
        testTitle(destroyAccountPage, "Destroy account");
    }
}
View Full Code Here

    public void testLinks() throws Exception {
        WebClient wc = startWebClient(false);
        login(wc);
        HtmlPage page = wc.getPage(url("/preferences/Preferences.action"));
        HtmlAnchor changePreferredLocaleLink = page.getAnchorByText("Choose your preferred language");
        changePreferredLocaleLink.click();
        wc.waitForBackgroundJavaScript(10000L);
        WebAssert.assertElementPresent(page, "changePreferredLocaleForm");
        testBasics(page);

        HtmlAnchor changePreferredTimeZoneLink = page.getAnchorByText("Choose your time zone");
View Full Code Here

        wc.waitForBackgroundJavaScript(10000L);
        WebAssert.assertElementPresent(page, "changePreferredLocaleForm");
        testBasics(page);

        HtmlAnchor changePreferredTimeZoneLink = page.getAnchorByText("Choose your time zone");
        changePreferredTimeZoneLink.click();
        wc.waitForBackgroundJavaScript(10000L);
        WebAssert.assertElementNotPresent(page, "changePreferredLocaleForm");
        WebAssert.assertElementPresent(page, "changePreferredTimeZoneForm");
        WebAssert.assertElementNotPresent(page, "changePasswordPreferencesForm");
        WebAssert.assertElementNotPresent(page, "changePasswordGenerationPreferencesForm");
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.