Skip to content
Snippets Groups Projects
Commit b10ceec6 authored by Moss's avatar Moss
Browse files

[testing] created ViewTransactionLogsTest.java and tested that admin and...

[testing] created ViewTransactionLogsTest.java and tested that admin and tester can both successfully get to new View Transactions Page
parent 4ebfb227
No related branches found
No related tags found
1 merge request!21UC39
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 ViewTransactionLogsTest extends iTrustSeleniumTest {
private HtmlUnitDriver driver;
private StringBuffer verificationErrors = new StringBuffer();
@Before
public void setUp() throws Exception {
super.setUp();
gen.clearAllTables();
gen.standardData();
driver = new HtmlUnitDriver();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
}
@Test
public void testAdminLogin() throws Exception {
driver = (HtmlUnitDriver) login("9000000001", "pw");
driver.setJavascriptEnabled(true);
assertEquals("iTrust - Admin Home", driver.getTitle());
driver.findElement(By.linkText("View Transaction Logs")).click();
assertEquals("iTrust - View Transaction Logs", driver.getTitle());
}
@Test
public void testTesterLogin() throws Exception {
driver = (HtmlUnitDriver) login("9999999999", "pw");
driver.setJavascriptEnabled(true);
assertEquals("iTrust - Tester Home", driver.getTitle());
driver.findElement(By.linkText("View Transaction Logs")).click();
assertEquals("iTrust - View Transaction Logs", driver.getTitle());
}
@After
public void tearDown() throws Exception {
driver.quit();
String verificationErrorString = verificationErrors.toString();
if (!"".equals(verificationErrorString)) {
fail(verificationErrorString);
}
}
}
\ 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