Package com.googlecode.memwords.web.integration.account

Source Code of com.googlecode.memwords.web.integration.account.AccountTest

package com.googlecode.memwords.web.integration.account;

import static com.googlecode.memwords.web.integration.util.IntegrationUtils.*;

import org.junit.Before;
import org.junit.Test;

import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;

/**
* Integration tests for the account page
* @author JB
*/
public class AccountTest {
    @Before
    public void setUp() throws Exception {
        setUpData();
    }

    @Test
    public void testPage() throws Exception {
        WebClient wc = startWebClient();
        login(wc);
        HtmlPage page = wc.getPage(url("/account/Account.action"));
        testBasics(page);
        testTitle(page, "Account");
    }

    @Test
    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");
    }
}
TOP

Related Classes of com.googlecode.memwords.web.integration.account.AccountTest

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.