Skip to content
Snippets Groups Projects
Commit 790f917b authored by mjw11's avatar mjw11
Browse files

Add ViewAllPreregisteredPatientsTest selenium test

parent c91668fc
No related branches found
No related tags found
1 merge request!22Merge UC92 into Master
package edu.ncsu.csc.itrust.selenium;
import java.util.concurrent.TimeUnit;
import org.junit.*;
import org.openqa.selenium.*;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
public class ViewAllPreregisteredPatientsTest extends iTrustSeleniumTest {
private WebDriver driver;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
super.setUp();
gen.standardData();
driver = new HtmlUnitDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
}
@Test
public void testViewAllPatients() throws Exception {
// This logs us into iTrust and returns the HtmlUnitDriver for use in
// this case
HtmlUnitDriver driver = (HtmlUnitDriver)login("9000000000", "pw");
// Make sure we were able to log in
assertEquals("iTrust - HCP Home", driver.getTitle());
driver.findElement(By.cssSelector("h2.panel-title")).click();
driver.findElement(By.linkText("All Patients")).click();
String text = driver.findElement(By.cssSelector("table.fTable")).getText();
assertTrue("Text not found!", text.contains("10/10/2008"));
assertTrue("Text not found!", text.contains("09/14/2009"));
assertTrue("Text not found!", text.contains("344 Bob Street"));
assertTrue("Text not found!", text.contains("Raleigh NC 27607"));
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
}
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