/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. package org.sigmah.endtoend;
  6. import org.hamcrest.Matchers;
  7. import org.junit.Test;
  8. import org.sigmah.endtoend.page.GxtApplication;
  9. import org.sigmah.endtoend.page.LoginPage;
  10. import static org.junit.Assert.assertThat;
  11. public class LoginTest extends EndToEndTestCase {
  12. @Test
  13. public void correctLoginSucceeds() {
  14. dataLoader.load("/dbunit/login.db.xml");
  15. login();
  16. GxtApplication app = getApp();
  17. app.assertTextIsPresent(EMAIL_ADDRESS);
  18. }
  19. @Test
  20. public void bookMarkIsSentToHostPage() {
  21. dataLoader.load("/dbunit/login.db.xml");
  22. navigate("/#charts");
  23. LoginPage loginPage = getLoginPage();
  24. loginPage.login(EMAIL_ADDRESS, CORRECT_PASSWORD);
  25. assertThat(driver.getCurrentUrl(), Matchers.endsWith("#charts"));
  26. }
  27. }