Advertisement
Guest User

Untitled

a guest
Oct 26th, 2011
867
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. public class AuthenticationTest extends AbstractWebTest {
  2.     @Rule
  3.     public DbUnitRule dbUnitRule = new DbUnitRule("/ds/default-user.ds.yaml");
  4.  
  5.     @Test
  6.     public void isRedirectedToLoginPageByDefault() throws Exception {
  7.         app.open();
  8.         app.assertIsOnLoginPage();
  9.     }
  10.  
  11.     @Test
  12.     public void canLogin() throws Exception {
  13.         app.open()
  14.                 .enterLogin("user")
  15.                 .enterPassword("pwd")
  16.                 .submit();
  17.         app.assertIsNotOnLoginPage();
  18.     }
  19.  
  20.     @Test
  21.     public void canLogout() throws Exception {
  22.         app.open().defaultLogin();
  23.         StatusRegionDriver status = app.status();
  24.         status.logout();
  25.         app.assertIsOnLoginPage();
  26.     }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement