Selenium WebDriver test updates
This commit is contained in:
parent
f1db2aa8aa
commit
b5b2845c6d
13 changed files with 1197 additions and 202 deletions
|
@ -6,17 +6,29 @@ import org.junit.runner.RunWith;
|
|||
import org.junit.runners.Suite.SuiteClasses;
|
||||
import org.vivoweb.vivo.selenium.DriverFactory;
|
||||
import org.vivoweb.vivo.selenium.VIVOSuite;
|
||||
import org.vivoweb.vivo.selenium.tests.CreateCourses;
|
||||
import org.vivoweb.vivo.selenium.tests.CreateOrganization;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteActivities;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteCourses;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteEquipment;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteEvents;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteOrganization;
|
||||
import org.vivoweb.vivo.selenium.tests.DeleteResearch;
|
||||
import org.vivoweb.vivo.selenium.tests.RebuildSearchIndex;
|
||||
|
||||
@RunWith(VIVOSuite.class)
|
||||
@SuiteClasses(
|
||||
{
|
||||
RebuildSearchIndex.class,
|
||||
CreateOrganization.class,
|
||||
DeleteOrganization.class
|
||||
}
|
||||
{
|
||||
RebuildSearchIndex.class,
|
||||
CreateOrganization.class,
|
||||
CreateCourses.class,
|
||||
DeleteActivities.class,
|
||||
DeleteCourses.class,
|
||||
DeleteEvents.class,
|
||||
DeleteResearch.class,
|
||||
DeleteEquipment.class,
|
||||
DeleteOrganization.class
|
||||
}
|
||||
)
|
||||
public class AddNonPersonThings {
|
||||
@BeforeClass
|
||||
|
|
|
@ -4,15 +4,10 @@ import org.apache.commons.lang3.StringUtils;
|
|||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.Alert;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.firefox.FirefoxDriver;
|
||||
import org.openqa.selenium.interactions.Actions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.Select;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
|
@ -45,23 +40,6 @@ public class AbstractSeleniumTest {
|
|||
driver.manage().deleteAllCookies();
|
||||
}
|
||||
|
||||
protected void logIn(String email, String password) {
|
||||
clickAndWait(By.linkText("Log in")); // clickAndWait,link=Log in
|
||||
assertTitle("Log in to VIVO"); // aseertTitle,Log in to VIVO
|
||||
|
||||
type(By.id("loginName"), email); // type,id=loginName,testAdmin@cornell.edu
|
||||
type(By.id("loginPassword"), password); // type,id=loginPassword,Password
|
||||
|
||||
clickAndWait(By.name("loginForm")); // clickAndWait,name=loginForm
|
||||
assertTitle("VIVO"); // assertTitle,VIVO
|
||||
}
|
||||
|
||||
protected void logOut() {
|
||||
Actions actions = new Actions(driver);
|
||||
actions.moveToElement( driver.findElement(By.id("user-menu")) ).perform();
|
||||
driver.findElement(By.linkText("Log out")).click();
|
||||
}
|
||||
|
||||
protected void open(String urlPart) {
|
||||
SeleniumUtils.navigate(driver, urlPart);
|
||||
}
|
||||
|
@ -74,52 +52,9 @@ public class AbstractSeleniumTest {
|
|||
|
||||
protected void type(By by, String text) {
|
||||
WebElement element = driver.findElement(by);
|
||||
element.click();
|
||||
element.sendKeys(text);
|
||||
}
|
||||
|
||||
protected void typeAutoCompleteSelect(By by, String text, Keys... keys) {
|
||||
WebElement element = driver.findElement(by);
|
||||
|
||||
int count = 0;
|
||||
WebElement autoComplete = null;
|
||||
while (autoComplete == null) {
|
||||
element.sendKeys(text);
|
||||
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
autoComplete = driver.findElement(By.className("ui-autocomplete"));
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchElementException nse) {
|
||||
element.clear();
|
||||
// for (int i = 0; i < text.length(); i++) {
|
||||
// element.sendKeys(Keys.BACK_SPACE);
|
||||
// }
|
||||
|
||||
if (count > 10) {
|
||||
throw nse;
|
||||
}
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
// WebDriverWait wait = new WebDriverWait(driver, 5);
|
||||
// WebElement autoComplete = wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("ui-autocomplete")));
|
||||
|
||||
if (keys != null && keys.length > 0) {
|
||||
for (Keys key : keys) {
|
||||
element.sendKeys(key);
|
||||
}
|
||||
}
|
||||
|
||||
WebElement selected = driver.findElement(By.id("ui-active-menuitem"));
|
||||
if (selected != null) {
|
||||
selected.click();
|
||||
}
|
||||
}
|
||||
|
||||
protected void typeTinyMCE(String text) {
|
||||
// <td> tinyMCE.activeEditor.setContent('The Primate College of America is a privately-funded college for the study of primates.')</td>
|
||||
|
||||
|
@ -134,8 +69,13 @@ public class AbstractSeleniumTest {
|
|||
Assert.assertNotNull(driver.findElement(by));
|
||||
}
|
||||
|
||||
protected void verifyTextPresent(String text) {
|
||||
Assert.assertTrue(driver.findElement(By.xpath("//body")).getText().contains(text));
|
||||
protected void verifyTextPresent(String... text) {
|
||||
if (text != null) {
|
||||
String bodyText = driver.findElement(By.xpath("//body")).getText();
|
||||
for (String str : text) {
|
||||
Assert.assertTrue(bodyText.contains(str));
|
||||
}
|
||||
}
|
||||
// Assert.assertNotNull(driver.findElement(xpathForTextPresent(text)));
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.Alert;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.NoSuchElementException;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.interactions.Actions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.Select;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.vivoweb.vivo.selenium.DriverFactory;
|
||||
import org.vivoweb.vivo.selenium.SeleniumUtils;
|
||||
|
||||
public class AbstractVIVOSeleniumTest extends AbstractSeleniumTest {
|
||||
protected void vivoAutoCompleteSelect(By by, String text, Keys... keys) {
|
||||
WebElement element = driver.findElement(by);
|
||||
|
||||
int count = 0;
|
||||
WebElement autoComplete = null;
|
||||
while (autoComplete == null) {
|
||||
element.sendKeys(text);
|
||||
|
||||
try {
|
||||
Thread.sleep(500);
|
||||
autoComplete = driver.findElement(By.className("ui-autocomplete"));
|
||||
} catch (InterruptedException e) {
|
||||
throw new RuntimeException(e);
|
||||
} catch (NoSuchElementException nse) {
|
||||
element.clear();
|
||||
// for (int i = 0; i < text.length(); i++) {
|
||||
// element.sendKeys(Keys.BACK_SPACE);
|
||||
// }
|
||||
|
||||
if (count > 10) {
|
||||
throw nse;
|
||||
}
|
||||
}
|
||||
|
||||
count++;
|
||||
}
|
||||
|
||||
// WebDriverWait wait = new WebDriverWait(driver, 5);
|
||||
// WebElement autoComplete = wait.until(ExpectedConditions.visibilityOfElementLocated(By.className("ui-autocomplete")));
|
||||
|
||||
if (keys != null && keys.length > 0) {
|
||||
for (Keys key : keys) {
|
||||
element.sendKeys(key);
|
||||
}
|
||||
}
|
||||
|
||||
WebElement selected = driver.findElement(By.id("ui-active-menuitem"));
|
||||
if (selected != null) {
|
||||
selected.click();
|
||||
}
|
||||
}
|
||||
|
||||
protected void vivoDeleteIndividual() {
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
}
|
||||
|
||||
protected void vivoLogIn(String email, String password) {
|
||||
clickAndWait(By.linkText("Log in")); // clickAndWait,link=Log in
|
||||
assertTitle("Log in to VIVO"); // aseertTitle,Log in to VIVO
|
||||
|
||||
type(By.id("loginName"), email); // type,id=loginName,testAdmin@cornell.edu
|
||||
type(By.id("loginPassword"), password); // type,id=loginPassword,Password
|
||||
|
||||
clickAndWait(By.name("loginForm")); // clickAndWait,name=loginForm
|
||||
assertTitle("VIVO"); // assertTitle,VIVO
|
||||
}
|
||||
|
||||
protected void vivoLogOut() {
|
||||
Actions actions = new Actions(driver);
|
||||
actions.moveToElement( driver.findElement(By.id("user-menu")) ).perform();
|
||||
driver.findElement(By.linkText("Log out")).click();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class CreateCourses extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void createCourses() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Site Admin"));
|
||||
assertTitle("VIVO Site Administration");
|
||||
|
||||
verifyTextPresent("Data Input");
|
||||
|
||||
selectByLabel(By.id("VClassURI"), "Course (vivo)");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("Create a new Course");
|
||||
|
||||
clickAndWait(By.linkText("Cancel"));
|
||||
assertTitle("VIVO Site Administration");
|
||||
|
||||
selectByLabel(By.id("VClassURI"), "Course (vivo)");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("Create a new Course");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("Please enter a value in the Name field.");
|
||||
|
||||
type(By.id("label"), "Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='description']/a/img"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("Add new entry for: description");
|
||||
|
||||
typeTinyMCE("Learn the basics about the general health of primates.");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-offeredBy > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("If you don't find the appropriate entry on the selection list above:");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='prerequisiteFor']/a/img"));
|
||||
assertTitle("Edit");
|
||||
verifyTextPresent("If you don't find the appropriate entry on the selection list above:");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='geographicFocus']/a/img"));
|
||||
assertTitle("Edit");
|
||||
|
||||
vivoAutoCompleteSelect(By.id("object"), "Afri");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='dateTimeInterval']/a"));
|
||||
assertTitle("Edit");
|
||||
|
||||
verifyTextPresent("Create date time value for Introduction to Primate Health");
|
||||
|
||||
type(By.id("startField-year"), "2007");
|
||||
type(By.id("startField-month"), "9");
|
||||
type(By.id("startField-day"), "1");
|
||||
|
||||
type(By.id("endField-year"), "2007");
|
||||
type(By.id("endField-month"), "12");
|
||||
type(By.id("endField-day"), "15");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]"));
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-BFO_0000051 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("objectVar"), "Primate Health Check (Event)");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='hasSubjectArea']/a/img"));
|
||||
assertTitle("Edit");
|
||||
|
||||
clickAndWait(By.id("showAddFormButton"));
|
||||
|
||||
clickAndWait(By.linkText("Select or create a VIVO-defined concept."));
|
||||
assertTitle("Edit");
|
||||
|
||||
type(By.id("relatedIndLabel"), "Animal Health");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Edit");
|
||||
|
||||
clickAndWait(By.linkText("Return to Profile Page"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-BFO_0000050 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("objectVar"), "Primate Health and Fitness (Invited Talk)");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("(//img[@alt='add'])[7]"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("typeOfNew"), "Seminar Series (vivo)");
|
||||
|
||||
clickAndWait(By.id("offerCreate"));
|
||||
assertTitle("Edit");
|
||||
|
||||
type(By.id("label"), "Primate Health Talks");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
// Test publication tab entry
|
||||
clickAndWait(By.cssSelector("li.nonSelectedGroupTab.clickable"));
|
||||
|
||||
clickAndWait(By.xpath("//h3[@id='presents']/a/img"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("typeOfNew"), "Webpage (bibo)");
|
||||
verifyTextPresent("If you don't find the appropriate entry on the selection list above:");
|
||||
|
||||
clickAndWait(By.id("offerCreate"));
|
||||
assertTitle("Edit");
|
||||
|
||||
verifyTextPresent("Create "related documents" entry for Introduction to Primate Health");
|
||||
|
||||
type(By.id("label"), "http://primatehealthintro.cornell.edu");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-RO_0002234 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("objectVar"), "Primate Happenings (Blog Posting)");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[6]"));
|
||||
clickAndWait(By.xpath("//h3[@id='contactInformation']/a/img"));
|
||||
assertTitle("Edit");
|
||||
|
||||
verifyTextPresent("Add new entry for: contact information");
|
||||
|
||||
typeTinyMCE("ME Tarzan at metarzan@primates.edu or 555-555-5553");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("(//h3[@id='RO_0001025']/a)[2]"));
|
||||
assertTitle("Edit");
|
||||
|
||||
vivoAutoCompleteSelect(By.id("label"), "lib");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-RO_0001025 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
clickAndWait(By.id("offerCreate"));
|
||||
assertTitle("Edit");
|
||||
|
||||
type(By.id("label"), "Primate Memorial Building");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]"));
|
||||
clickAndWait(By.xpath("//h3[@id='courseCredits']/a/img"));
|
||||
assertTitle("Edit");
|
||||
|
||||
typeTinyMCE("9");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.cssSelector("a.add-hasPrerequisite > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
selectByLabel(By.id("objectVar"), "Introduction to Primates");
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]"));
|
||||
verifyTextPresent(
|
||||
"Introduction to Primate Health",
|
||||
"Course",
|
||||
"Learn the basics about the general health of primates.",
|
||||
"Primate College of America",
|
||||
"September 1, 2007 - December 15, 2007",
|
||||
"ME Tarzan at metarzan@primates.edu or 555-555-5553",
|
||||
"9");
|
||||
verifyElementPresent(By.linkText("Primate Health and Fitness"));
|
||||
verifyElementPresent(By.linkText("Primate Health Check"));
|
||||
verifyElementPresent(By.linkText("Primate Health Talks"));
|
||||
verifyElementPresent(By.linkText("Animal Health"));
|
||||
verifyElementPresent(By.linkText("Introduction to Primate Health"));
|
||||
verifyElementPresent(By.linkText("Africa"));
|
||||
verifyElementPresent(By.linkText("Primate Happenings"));
|
||||
verifyElementPresent(By.linkText("http://primatehealthintro.cornell.edu"));
|
||||
verifyElementPresent(By.linkText("Primate Memorial Building"));
|
||||
verifyElementPresent(By.linkText("Liberia"));
|
||||
verifyElementPresent(By.linkText("Introduction to Primates"));
|
||||
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -3,9 +3,8 @@ package org.vivoweb.vivo.selenium.tests;
|
|||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.Keys;
|
||||
import org.openqa.selenium.WebElement;
|
||||
|
||||
public class CreateOrganization extends AbstractSeleniumTest {
|
||||
public class CreateOrganization extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void createOrganization() {
|
||||
deleteAllVisibleCookies();
|
||||
|
@ -13,7 +12,7 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
logIn("testAdmin@cornell.edu", "Password");
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Site Admin"));
|
||||
assertTitle("VIVO Site Administration");
|
||||
|
@ -206,7 +205,7 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.cssSelector("a.add-hasCollaborator > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
typeAutoCompleteSelect(By.id("object"), "Primate His", Keys.ARROW_DOWN);
|
||||
vivoAutoCompleteSelect(By.id("object"), "Primate His", Keys.ARROW_DOWN);
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Primate College of America");
|
||||
|
@ -264,7 +263,7 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.cssSelector("a.add-RO_0001025 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
typeAutoCompleteSelect(By.id("object"), "northern Afr", Keys.ARROW_DOWN);
|
||||
vivoAutoCompleteSelect(By.id("object"), "northern Afr", Keys.ARROW_DOWN);
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Primate College of America");
|
||||
|
@ -389,7 +388,7 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.cssSelector("#researchGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
typeAutoCompleteSelect(By.id("grant"), "primate hab", Keys.ARROW_DOWN);
|
||||
vivoAutoCompleteSelect(By.id("grant"), "primate hab", Keys.ARROW_DOWN);
|
||||
|
||||
clickAndWait(By.cssSelector("input.submit"));
|
||||
assertTitle("Primate College of America");
|
||||
|
@ -447,7 +446,7 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.cssSelector("a.add-governingAuthorityFor > img.add-individual"));
|
||||
assertTitle("Edit");
|
||||
|
||||
typeAutoCompleteSelect(By.id("object"), "primate colleges of the wor", Keys.ARROW_DOWN);
|
||||
vivoAutoCompleteSelect(By.id("object"), "primate colleges of the wor", Keys.ARROW_DOWN);
|
||||
|
||||
clickAndWait(By.id("submit"));
|
||||
assertTitle("Primate College of America");
|
||||
|
@ -455,34 +454,37 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
// Verify everything entered is displaying properly
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[2]"));
|
||||
verifyTextPresent("PCoA");
|
||||
verifyTextPresent("1959 -");
|
||||
verifyTextPresent(
|
||||
"PCoA",
|
||||
"1959 -"
|
||||
);
|
||||
verifyElementPresent(By.linkText("B.S. Bachelor of Science"));
|
||||
verifyElementPresent(By.linkText("Primate Student of the Year"));
|
||||
verifyElementPresent(By.linkText("Best Primate College"));
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[4]"));
|
||||
verifyTextPresent("faculty administrative position");
|
||||
verifyTextPresent(
|
||||
"faculty administrative position",
|
||||
"Person, Polly, Dr. 1999 -",
|
||||
"Primates-r-us Founder 2010 -",
|
||||
"Primate Colleges of the World Member 2009 -",
|
||||
"Primate Heart Health Founder 2010 -",
|
||||
"New Primate Students 2003 - 2006",
|
||||
"Primates in the Wild 1997 -"
|
||||
);
|
||||
verifyElementPresent(By.linkText("Person, Polly"));
|
||||
verifyTextPresent("Person, Polly, Dr. 1999 -");
|
||||
verifyElementPresent(By.linkText("Primate History Library"));
|
||||
verifyElementPresent(By.linkText("Primate Research Laboratory"));
|
||||
verifyElementPresent(By.linkText("Primates-r-us"));
|
||||
verifyTextPresent("Primates-r-us Founder 2010 -");
|
||||
verifyElementPresent(By.linkText("Primate Colleges of the World"));
|
||||
verifyTextPresent("Primate Colleges of the World Member 2009 -");
|
||||
verifyElementPresent(By.linkText("Primate Heart Health"));
|
||||
verifyTextPresent("Primate Heart Health Founder 2010 -");
|
||||
verifyElementPresent(By.linkText("New Primate Students"));
|
||||
verifyTextPresent("New Primate Students 2003 - 2006");
|
||||
verifyElementPresent(By.linkText("Primates in the Wild"));
|
||||
verifyTextPresent("Primates in the Wild 1997 -");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[6]"));
|
||||
verifyTextPresent("invited talk", "Primate Health and Fitness, Organizer 2008");
|
||||
verifyElementPresent(By.linkText("Primate Info"));
|
||||
verifyTextPresent("invited talk");
|
||||
verifyElementPresent(By.linkText("Primate Health and Fitness"));
|
||||
verifyTextPresent("Primate Health and Fitness, Organizer 2008");
|
||||
verifyElementPresent(By.linkText("Primate Happenings"));
|
||||
verifyElementPresent(By.linkText("USA222333444555"));
|
||||
|
||||
|
@ -493,73 +495,76 @@ public class CreateOrganization extends AbstractSeleniumTest {
|
|||
verifyTextPresent("Gorillas");
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[10]"));
|
||||
verifyTextPresent("Primate Health Check Sponsor 2008 - 2010");
|
||||
verifyElementPresent(By.linkText("Gorilla Moving Company"));
|
||||
verifyElementPresent(By.linkText("Primate Health Check"));
|
||||
verifyTextPresent("Primate Health Check Sponsor 2008 - 2010");
|
||||
verifyElementPresent(By.linkText("Portable Primate Habitat"));
|
||||
verifyElementPresent(By.linkText("Introduction to Primates"));
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[12]"));
|
||||
verifyTextPresent("555-555-5555");
|
||||
verifyTextPresent("555-555-5554");
|
||||
verifyTextPresent("info@primates.edu");
|
||||
verifyTextPresent("1234 Northern African Nation");
|
||||
verifyTextPresent("Morocco City");
|
||||
verifyTextPresent("1234567890");
|
||||
verifyTextPresent("Morocco");
|
||||
verifyTextPresent(
|
||||
"555-555-5555",
|
||||
"555-555-5554",
|
||||
"info@primates.edu",
|
||||
"1234 Northern African Nation",
|
||||
"Morocco City",
|
||||
"1234567890",
|
||||
"Morocco");
|
||||
verifyElementPresent(By.linkText("northern Africa"));
|
||||
verifyElementPresent(By.linkText("Primate College of New York"));
|
||||
verifyElementPresent(By.linkText("Primate University of America"));
|
||||
verifyElementPresent(By.linkText("Primate Colleges of the World"));
|
||||
|
||||
clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[14]"));
|
||||
verifyTextPresent("PCoA");
|
||||
verifyTextPresent("1959 -");
|
||||
verifyTextPresent(
|
||||
"PCoA",
|
||||
"1959 -",
|
||||
"faculty administrative position",
|
||||
"Person, Polly, Dr. 1999 -",
|
||||
"Primates-r-us Founder 2010 -",
|
||||
"Primate Colleges of the World Member 2009 -",
|
||||
"Primate Heart Health Founder 2010 -",
|
||||
"New Primate Students 2003 - 2006",
|
||||
"Primates in the Wild 1997 -",
|
||||
"invited talk",
|
||||
"Primate Health and Fitness, Organizer 2008",
|
||||
"Gorillas",
|
||||
"Primate Health Check Sponsor 2008 - 2010",
|
||||
"555-555-5555",
|
||||
"555-555-5554",
|
||||
"info@primates.edu",
|
||||
"1234 Northern African Nation",
|
||||
"Morocco City",
|
||||
"1234567890",
|
||||
"Morocco"
|
||||
);
|
||||
verifyElementPresent(By.linkText("B.S. Bachelor of Science"));
|
||||
verifyElementPresent(By.linkText("Primate Student of the Year"));
|
||||
verifyElementPresent(By.linkText("Best Primate College"));
|
||||
verifyTextPresent("faculty administrative position");
|
||||
verifyElementPresent(By.linkText("Person, Polly"));
|
||||
verifyTextPresent("Person, Polly, Dr. 1999 -");
|
||||
verifyElementPresent(By.linkText("Primate History Library"));
|
||||
verifyElementPresent(By.linkText("Primate Research Laboratory"));
|
||||
verifyElementPresent(By.linkText("Primates-r-us"));
|
||||
verifyTextPresent("Primates-r-us Founder 2010 -");
|
||||
verifyElementPresent(By.linkText("Primate Colleges of the World"));
|
||||
verifyTextPresent("Primate Colleges of the World Member 2009 -");
|
||||
verifyElementPresent(By.linkText("Primate Heart Health"));
|
||||
verifyTextPresent("Primate Heart Health Founder 2010 -");
|
||||
verifyElementPresent(By.linkText("New Primate Students"));
|
||||
verifyTextPresent("New Primate Students 2003 - 2006");
|
||||
verifyElementPresent(By.linkText("Primates in the Wild"));
|
||||
verifyTextPresent("Primates in the Wild 1997 -");
|
||||
verifyElementPresent(By.linkText("Primate Info"));
|
||||
verifyTextPresent("invited talk");
|
||||
verifyElementPresent(By.linkText("Primate Health and Fitness"));
|
||||
verifyTextPresent("Primate Health and Fitness, Organizer 2008");
|
||||
verifyElementPresent(By.linkText("Primate Happenings"));
|
||||
verifyElementPresent(By.linkText("USA222333444555"));
|
||||
verifyElementPresent(By.linkText("Primate Habitat Research Grant"));
|
||||
verifyElementPresent(By.linkText("Primate Survival Planning Grant"));
|
||||
verifyElementPresent(By.linkText("Human and Ape Brain Comparison"));
|
||||
verifyTextPresent("Gorillas");
|
||||
verifyElementPresent(By.linkText("Gorilla Moving Company"));
|
||||
verifyElementPresent(By.linkText("Primate Health Check"));
|
||||
verifyTextPresent("Primate Health Check Sponsor 2008 - 2010");
|
||||
verifyElementPresent(By.linkText("Portable Primate Habitat"));
|
||||
verifyElementPresent(By.linkText("Introduction to Primates"));
|
||||
verifyTextPresent("555-555-5555");
|
||||
verifyTextPresent("555-555-5554");
|
||||
verifyTextPresent("info@primates.edu");
|
||||
verifyTextPresent("1234 Northern African Nation");
|
||||
verifyTextPresent("Morocco City");
|
||||
verifyTextPresent("1234567890");
|
||||
verifyTextPresent("Morocco");
|
||||
verifyElementPresent(By.linkText("northern Africa"));
|
||||
verifyElementPresent(By.linkText("Primate College of New York"));
|
||||
verifyElementPresent(By.linkText("Primate University of America"));
|
||||
verifyElementPresent(By.linkText("Primate Colleges of the World"));
|
||||
|
||||
logOut();
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteActivities extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteActivities() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Project"));
|
||||
assertTitle("Project");
|
||||
|
||||
clickAndWait(By.linkText("Human and Ape Brain Comparison"));
|
||||
assertTitle("Human and Ape Brain Comparison");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Service"));
|
||||
assertTitle("Service");
|
||||
|
||||
clickAndWait(By.linkText("Gorilla Moving Company"));
|
||||
assertTitle("Gorilla Moving Company");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Service"));
|
||||
assertTitle("Service");
|
||||
|
||||
clickAndWait(By.linkText("Primate Heart Health"));
|
||||
assertTitle("Primate Heart Health");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteCourses extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteCourses() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
/*
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Course"));
|
||||
assertTitle("Course");
|
||||
|
||||
clickAndWait(By.linkText("Introduction to Primate Health"));
|
||||
assertTitle("Introduction to Primate Health");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Course"));
|
||||
assertTitle("Course");
|
||||
|
||||
clickAndWait(By.linkText("Introduction to Primates"));
|
||||
assertTitle("Introduction to Primates");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteEquipment extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteEquipment() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Equipment"));
|
||||
assertTitle("Equipment");
|
||||
|
||||
clickAndWait(By.linkText("Portable Primate Habitat"));
|
||||
assertTitle("Portable Primate Habitat");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
/*
|
||||
clickAndWait(By.linkText("Equipment"));
|
||||
assertTitle("Equipment");
|
||||
|
||||
clickAndWait(By.linkText("Primate Feeder"));
|
||||
assertTitle("Primate Feeder");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,86 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteEvents extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteEvents() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Event"));
|
||||
assertTitle("Event");
|
||||
|
||||
clickAndWait(By.linkText("New Primate Students"));
|
||||
assertTitle("New Primate Students");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Event"));
|
||||
assertTitle("Event");
|
||||
|
||||
clickAndWait(By.linkText("Primate Health and Fitness"));
|
||||
assertTitle("Primate Health and Fitness");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Event"));
|
||||
assertTitle("Event");
|
||||
|
||||
clickAndWait(By.linkText("Primate Health Check"));
|
||||
assertTitle("Primate Health Check");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Event"));
|
||||
assertTitle("Event");
|
||||
/*
|
||||
clickAndWait(By.linkText("Primate Health Conference"));
|
||||
assertTitle("Primate Health Conference");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Event"));
|
||||
assertTitle("Event");
|
||||
|
||||
clickAndWait(By.linkText("Primates in the Wild"));
|
||||
assertTitle("Primates in the Wild");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
/*
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Seminar Series"));
|
||||
assertTitle("Seminar Series");
|
||||
|
||||
clickAndWait(By.linkText("Primate Health Talks"));
|
||||
assertTitle("Primate Health Talks");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
// Where is Introduction to Primates??
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,370 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteLocations extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteLocations() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
||||
/*
|
||||
<!--Delete Locations-->
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Jane Memorial Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Jane Memorial Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Edit this individual</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Control Panel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value="Edit This Individual"]</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Editing Form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>_delete</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertConfirmation</td>
|
||||
<td>Are you SURE you want to delete this individual? If in doubt, CANCEL.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForPageToLoad</td>
|
||||
<td>5000</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>VIVO Site Administration</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Primate Memorial Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Primate Memorial Building</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Edit this individual</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Control Panel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value='Edit This Individual']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Editing Form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=_delete</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertConfirmation</td>
|
||||
<td>Are you SURE you want to delete this individual? If in doubt, CANCEL.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForPageToLoad</td>
|
||||
<td>5000</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>VIVO Site Administration</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Index of Contents</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Lab Admin Office</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Lab Admin Office</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Edit this individual</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Control Panel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value='Edit This Individual']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Editing Form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=_delete</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertConfirmation</td>
|
||||
<td>Are you SURE you want to delete this individual? If in doubt, CANCEL.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForPageToLoad</td>
|
||||
<td>5000</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>VIVO Site Administration</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Index of Contents</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Primate Research Lab Room 123</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Primate Research Lab Room 123</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Edit this individual</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Control Panel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value='Edit This Individual']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Editing Form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=_delete</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertConfirmation</td>
|
||||
<td>Are you SURE you want to delete this individual? If in doubt, CANCEL.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForPageToLoad</td>
|
||||
<td>5000</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>VIVO Site Administration</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Index of Contents</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Facility</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=State Fair Park</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>State Fair Park</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Edit this individual</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Control Panel</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>//input[@value='Edit This Individual']</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Individual Editing Form</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>click</td>
|
||||
<td>name=_delete</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertConfirmation</td>
|
||||
<td>Are you SURE you want to delete this individual? If in doubt, CANCEL.</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>waitForPageToLoad</td>
|
||||
<td>5000</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>VIVO Site Administration</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>clickAndWait</td>
|
||||
<td>link=Index</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>assertTitle</td>
|
||||
<td>Index of Contents</td>
|
||||
<td></td>
|
||||
</tr>
|
||||
|
||||
*/
|
|
@ -3,7 +3,7 @@ package org.vivoweb.vivo.selenium.tests;
|
|||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteOrganization extends AbstractSeleniumTest {
|
||||
public class DeleteOrganization extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteOrganization() {
|
||||
deleteAllVisibleCookies();
|
||||
|
@ -11,7 +11,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
logIn("testAdmin@cornell.edu", "Password");
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -22,16 +22,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate College of America"));
|
||||
assertTitle("Primate College of America");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -42,16 +33,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate College of New York"));
|
||||
assertTitle("Primate College of New York");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -62,16 +44,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate Colleges of the World"));
|
||||
assertTitle("Primate Colleges of the World");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -82,16 +55,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate History Library"));
|
||||
assertTitle("Primate History Library");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -102,16 +66,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate Research Laboratory"));
|
||||
assertTitle("Primate Research Laboratory");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -122,16 +77,7 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primate University of America"));
|
||||
assertTitle("Primate University of America");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
@ -142,17 +88,19 @@ public class DeleteOrganization extends AbstractSeleniumTest {
|
|||
clickAndWait(By.linkText("Primates-r-us"));
|
||||
assertTitle("Primates-r-us");
|
||||
|
||||
clickAndWait(By.linkText("Edit this individual"));
|
||||
assertTitle("Individual Control Panel");
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.xpath("//input[@value='Edit This Individual']"));
|
||||
assertTitle("Individual Editing Form");
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.name("_delete"));
|
||||
assertConfirmation("Are you SURE you want to delete this individual? If in doubt, CANCEL.");
|
||||
clickAndWait(By.linkText("Person"));
|
||||
assertTitle("Person");
|
||||
|
||||
assertTitle("VIVO Site Administration");
|
||||
clickAndWait(By.linkText("Person, Polly"));
|
||||
assertTitle("Person, Polly");
|
||||
|
||||
logOut();
|
||||
vivoDeleteIndividual();
|
||||
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,183 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
|
||||
public class DeleteResearch extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void deleteResearch() {
|
||||
deleteAllVisibleCookies();
|
||||
|
||||
open("/");
|
||||
assertTitle("VIVO");
|
||||
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Article"));
|
||||
assertTitle("Article");
|
||||
|
||||
clickAndWait(By.linkText("Primate Happenings"));
|
||||
assertTitle("Primate Happenings");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Award or Honor"));
|
||||
assertTitle("Award or Honor");
|
||||
|
||||
clickAndWait(By.linkText("Best Primate College"));
|
||||
assertTitle("Best Primate College");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Award or Honor"));
|
||||
assertTitle("Award or Honor");
|
||||
|
||||
clickAndWait(By.linkText("Primate Student of the Year"));
|
||||
assertTitle("Primate Student of the Year");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
/*
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Book"));
|
||||
assertTitle("Book");
|
||||
|
||||
clickAndWait(By.linkText("PHC Proceedings"));
|
||||
assertTitle("PHC Proceedings");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Concept"));
|
||||
assertTitle("Concept");
|
||||
|
||||
clickAndWait(By.linkText("Animal Health"));
|
||||
assertTitle("Animal Health");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Concept"));
|
||||
assertTitle("Concept");
|
||||
|
||||
clickAndWait(By.linkText("Ape Health"));
|
||||
assertTitle("Ape Health");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Concept"));
|
||||
assertTitle("Concept");
|
||||
|
||||
clickAndWait(By.linkText("Elderly Care"));
|
||||
assertTitle("Elderly Care");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Concept"));
|
||||
assertTitle("Concept");
|
||||
|
||||
clickAndWait(By.linkText("Primate Diet"));
|
||||
assertTitle("Primate Diet");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Concept"));
|
||||
assertTitle("Concept");
|
||||
|
||||
clickAndWait(By.linkText("Primate Health"));
|
||||
assertTitle("Primate Health");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Database"));
|
||||
assertTitle("Database");
|
||||
|
||||
clickAndWait(By.linkText("Primate Info"));
|
||||
assertTitle("Primate Info");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
/*
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Grant"));
|
||||
assertTitle("Grant");
|
||||
|
||||
clickAndWait(By.linkText("Primate Elderly Care"));
|
||||
assertTitle("Primate Elderly Care");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Grant"));
|
||||
assertTitle("Grant");
|
||||
|
||||
clickAndWait(By.linkText("Primate Habitat Research Grant"));
|
||||
assertTitle("Primate Habitat Research Grant");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Grant"));
|
||||
assertTitle("Grant");
|
||||
|
||||
clickAndWait(By.linkText("Primate Survival Planning Grant"));
|
||||
assertTitle("Primate Survival Planning Grant");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Patent"));
|
||||
assertTitle("Patent");
|
||||
|
||||
clickAndWait(By.linkText("USA222333444555"));
|
||||
assertTitle("USA222333444555");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
/*
|
||||
clickAndWait(By.linkText("Index"));
|
||||
assertTitle("Index of Contents");
|
||||
|
||||
clickAndWait(By.linkText("Webpage"));
|
||||
assertTitle("Webpage");
|
||||
|
||||
clickAndWait(By.linkText("http://primatehealthintro.cornell.edu"));
|
||||
assertTitle("http://primatehealthintro.cornell.edu");
|
||||
|
||||
vivoDeleteIndividual();
|
||||
*/
|
||||
vivoLogOut();
|
||||
}
|
||||
}
|
|
@ -1,19 +1,9 @@
|
|||
package org.vivoweb.vivo.selenium.tests;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.openqa.selenium.By;
|
||||
import org.openqa.selenium.WebDriver;
|
||||
import org.openqa.selenium.interactions.Actions;
|
||||
import org.openqa.selenium.support.ui.ExpectedConditions;
|
||||
import org.openqa.selenium.support.ui.WebDriverWait;
|
||||
import org.vivoweb.vivo.selenium.DriverFactory;
|
||||
import org.vivoweb.vivo.selenium.SeleniumUtils;
|
||||
|
||||
public class RebuildSearchIndex extends AbstractSeleniumTest {
|
||||
public class RebuildSearchIndex extends AbstractVIVOSeleniumTest {
|
||||
@Test
|
||||
public void rebuildSearchIndexTest() {
|
||||
deleteAllVisibleCookies();
|
||||
|
@ -21,7 +11,7 @@ public class RebuildSearchIndex extends AbstractSeleniumTest {
|
|||
open("/");
|
||||
assertTitle("VIVO"); // assertTitle,VIVO
|
||||
|
||||
logIn("testAdmin@cornell.edu", "Password");
|
||||
vivoLogIn("testAdmin@cornell.edu", "Password");
|
||||
|
||||
clickAndWait(By.linkText("Site Admin")); // clickAndWait,link=Site Admin
|
||||
assertTitle("VIVO Site Administration"); // assertTitle,VIVO Site Administration
|
||||
|
@ -34,6 +24,6 @@ public class RebuildSearchIndex extends AbstractSeleniumTest {
|
|||
|
||||
waitForTextPresent("Reset the search index and re-populate it."); // waitForTextPresent,Reset the search index and re-populate it.
|
||||
|
||||
logOut(); // clickAndWait,Log out
|
||||
vivoLogOut(); // clickAndWait,Log out
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue