PageRenderTime 10ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 2ms app.codeStats 0ms

/tests/src/test/java/org/sigmah/endtoend/LoginTest.java

http://sigma-h.googlecode.com/
Java | 41 lines | 23 code | 14 blank | 4 comment | 0 complexity | ebf9aa92ab1b193e9b6e840bfeb010eb MD5 | raw file
 1/*
 2 * All Sigmah code is released under the GNU General Public License v3
 3 * See COPYRIGHT.txt and LICENSE.txt.
 4 */
 5
 6package org.sigmah.endtoend;
 7
 8import org.hamcrest.Matchers;
 9import org.junit.Test;
10import org.sigmah.endtoend.page.GxtApplication;
11import org.sigmah.endtoend.page.LoginPage;
12
13import static org.junit.Assert.assertThat;
14
15public class LoginTest extends EndToEndTestCase {
16
17
18    @Test
19    public void correctLoginSucceeds() {
20
21        dataLoader.load("/dbunit/login.db.xml");
22
23        login();
24
25        GxtApplication app = getApp();
26        app.assertTextIsPresent(EMAIL_ADDRESS);
27    }
28
29    @Test
30    public void bookMarkIsSentToHostPage() {
31
32        dataLoader.load("/dbunit/login.db.xml");
33
34        navigate("/#charts");
35
36        LoginPage loginPage = getLoginPage();
37        loginPage.login(EMAIL_ADDRESS, CORRECT_PASSWORD);
38
39        assertThat(driver.getCurrentUrl(), Matchers.endsWith("#charts"));
40    }
41}