Skip to content
Snippets Groups Projects
Commit 51aec17c authored by adityab3's avatar adityab3
Browse files

Added test for logging in as a preregistered patient

parent 18bf2964
No related branches found
No related tags found
1 merge request!6Uc91v2
......@@ -53,7 +53,7 @@ if (formIsFilled) {
</tr>
<tr>
<td class="subHeaderVertical">MID:</td>
<td><%= StringEscapeUtils.escapeHtml("" + (newMID)) %></td>
<td id="newMID"><%= StringEscapeUtils.escapeHtml("" + (newMID)) %></td>
<td></td>
</tr>
<tr>
......
......@@ -146,4 +146,26 @@ public class PreRegisterPatientTest extends iTrustSeleniumTest {
assertFalse(driver.findElement(By.xpath("//body")).getText().contains("This form has not been validated correctly"));
}
public void testLogIn() {
goToPreRegister();
// Pre-register a patient
driver.findElement(By.xpath("//input[@name='firstName']")).sendKeys("fname");
driver.findElement(By.xpath("//input[@name='lastName']")).sendKeys("lname");
driver.findElement(By.xpath("//input[@name='email']")).sendKeys("name@email.com");
driver.findElement(By.xpath("//input[@name='password']")).sendKeys("Password123");
driver.findElement(By.xpath("//input[@name='verifyPassword']")).sendKeys("Password123");
driver.findElement(By.id("submit_preregister")).click();
// Get the MID
String mid = driver.findElement(By.id("newMID")).getText();
// Try and log in
driver.findElement(By.id("j_username")).sendKeys(mid);
driver.findElement(By.id("j_password")).sendKeys("Password123");
driver.findElement(By.xpath("//input[@type='submit' and @value='Login']")).click();
assertEquals("iTrust - Pre-Registered Patient Home", driver.getTitle());
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment