At line 1 changed 1 line. |
sandbox |
[{Java2HtmlPlugin |
|
public class UserWebTest extends WebTestCase { |
|
public UserWebTest(String name) { |
super(name); |
getTestContext().setBaseUrl("http://localhost:8080/myusers"); |
} |
|
public void testWelcomePage() { |
beginAt("/"); |
assertTitleEquals("MyUsers ~ Welcome"); |
} |
|
public void testAddUser() { |
beginAt("/editUser.html"); |
assertTitleEquals("MyUsers ~ User Details"); |
setFormElement("firstName", "Spring"); |
setFormElement("lastName", "User"); |
submit("save"); |
assertTextPresent("saved successfully"); |
} |
|
public void testListUsers() { |
beginAt("/users.html"); |
|
// check that table is present |
assertTablePresent("userList"); |
|
//check that a set of strings are present somewhere in table |
assertTextInTable("userList", |
new String[] {"Spring", "User"}); |
} |
|
public void testEditUser() { |
beginAt("/editUser.html?id=1"); |
assertFormElementEquals("firstName", "Spring"); |
submit("save"); |
assertTitleEquals("MyUsers ~ User List"); |
} |
|
public void testDeleteUser() { |
beginAt("/editUser.html?id=1"); |
assertTitleEquals("MyUsers ~ User Details"); |
submit("delete"); |
assertTitleEquals("MyUsers ~ User List"); |
} |
} |
]} |