From b5b2845c6d3a791e5be82bad3cb51df4d75a249e Mon Sep 17 00:00:00 2001 From: Graham Triggs Date: Thu, 7 Jan 2016 21:55:53 +0000 Subject: [PATCH] Selenium WebDriver test updates --- .../selenium/suites/AddNonPersonThings.java | 22 +- .../selenium/tests/AbstractSeleniumTest.java | 74 +--- .../tests/AbstractVIVOSeleniumTest.java | 95 +++++ .../vivo/selenium/tests/CreateCourses.java | 237 +++++++++++ .../selenium/tests/CreateOrganization.java | 99 ++--- .../vivo/selenium/tests/DeleteActivities.java | 51 +++ .../vivo/selenium/tests/DeleteCourses.java | 40 ++ .../vivo/selenium/tests/DeleteEquipment.java | 38 ++ .../vivo/selenium/tests/DeleteEvents.java | 86 ++++ .../vivo/selenium/tests/DeleteLocations.java | 370 ++++++++++++++++++ .../selenium/tests/DeleteOrganization.java | 88 +---- .../vivo/selenium/tests/DeleteResearch.java | 183 +++++++++ .../selenium/tests/RebuildSearchIndex.java | 16 +- 13 files changed, 1197 insertions(+), 202 deletions(-) create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateCourses.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteActivities.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteCourses.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEquipment.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEvents.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java create mode 100644 selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteResearch.java diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/suites/AddNonPersonThings.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/suites/AddNonPersonThings.java index 6541bce9..1b707849 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/suites/AddNonPersonThings.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/suites/AddNonPersonThings.java @@ -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 diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractSeleniumTest.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractSeleniumTest.java index ea2d4578..222665b4 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractSeleniumTest.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractSeleniumTest.java @@ -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) { // tinyMCE.activeEditor.setContent('The Primate College of America is a privately-funded college for the study of primates.') @@ -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))); } diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java new file mode 100644 index 00000000..28331063 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java @@ -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(); + } + + +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateCourses.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateCourses.java new file mode 100644 index 00000000..d62e8b13 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateCourses.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateOrganization.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateOrganization.java index 5b544f9c..61bbc96c 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateOrganization.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/CreateOrganization.java @@ -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(); } } diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteActivities.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteActivities.java new file mode 100644 index 00000000..922e5621 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteActivities.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteCourses.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteCourses.java new file mode 100644 index 00000000..2a6800cd --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteCourses.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEquipment.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEquipment.java new file mode 100644 index 00000000..c53e3694 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEquipment.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEvents.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEvents.java new file mode 100644 index 00000000..a0cba0de --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteEvents.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java new file mode 100644 index 00000000..d0acc385 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java @@ -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(); + } +} +/* + + + clickAndWait + link=Building + + + + assertTitle + Building + + + + clickAndWait + link=Jane Memorial Building + + + + assertTitle + Jane Memorial Building + + + + clickAndWait + link=Edit this individual + + + + assertTitle + Individual Control Panel + + + + clickAndWait + //input[@value="Edit This Individual"] + + + + assertTitle + Individual Editing Form + + + + clickAndWait + _delete + + + + assertConfirmation + Are you SURE you want to delete this individual? If in doubt, CANCEL. + + + + waitForPageToLoad + 5000 + + + + assertTitle + VIVO Site Administration + + + + clickAndWait + link=Index + + + + clickAndWait + link=Building + + + + assertTitle + Building + + + + clickAndWait + link=Primate Memorial Building + + + + assertTitle + Primate Memorial Building + + + + clickAndWait + link=Edit this individual + + + + assertTitle + Individual Control Panel + + + + clickAndWait + //input[@value='Edit This Individual'] + + + + assertTitle + Individual Editing Form + + + + click + name=_delete + + + + assertConfirmation + Are you SURE you want to delete this individual? If in doubt, CANCEL. + + + + waitForPageToLoad + 5000 + + + + assertTitle + VIVO Site Administration + + + + clickAndWait + link=Index + + + + assertTitle + Index of Contents + + + + clickAndWait + link=Facility + + + + assertTitle + Facility + + + + clickAndWait + link=Lab Admin Office + + + + assertTitle + Lab Admin Office + + + + clickAndWait + link=Edit this individual + + + + assertTitle + Individual Control Panel + + + + clickAndWait + //input[@value='Edit This Individual'] + + + + assertTitle + Individual Editing Form + + + + click + name=_delete + + + + assertConfirmation + Are you SURE you want to delete this individual? If in doubt, CANCEL. + + + + waitForPageToLoad + 5000 + + + + assertTitle + VIVO Site Administration + + + + clickAndWait + link=Index + + + + assertTitle + Index of Contents + + + + clickAndWait + link=Facility + + + + assertTitle + Facility + + + + clickAndWait + link=Primate Research Lab Room 123 + + + + assertTitle + Primate Research Lab Room 123 + + + + clickAndWait + link=Edit this individual + + + + assertTitle + Individual Control Panel + + + + clickAndWait + //input[@value='Edit This Individual'] + + + + assertTitle + Individual Editing Form + + + + click + name=_delete + + + + assertConfirmation + Are you SURE you want to delete this individual? If in doubt, CANCEL. + + + + waitForPageToLoad + 5000 + + + + assertTitle + VIVO Site Administration + + + + clickAndWait + link=Index + + + + assertTitle + Index of Contents + + + + clickAndWait + link=Facility + + + + assertTitle + Facility + + + + clickAndWait + link=State Fair Park + + + + assertTitle + State Fair Park + + + + clickAndWait + link=Edit this individual + + + + assertTitle + Individual Control Panel + + + + clickAndWait + //input[@value='Edit This Individual'] + + + + assertTitle + Individual Editing Form + + + + click + name=_delete + + + + assertConfirmation + Are you SURE you want to delete this individual? If in doubt, CANCEL. + + + + waitForPageToLoad + 5000 + + + + assertTitle + VIVO Site Administration + + + + clickAndWait + link=Index + + + + assertTitle + Index of Contents + + + + */ \ No newline at end of file diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteOrganization.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteOrganization.java index 23b885cc..a9c9a786 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteOrganization.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteOrganization.java @@ -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(); } } diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteResearch.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteResearch.java new file mode 100644 index 00000000..4b923d88 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteResearch.java @@ -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(); + } +} diff --git a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/RebuildSearchIndex.java b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/RebuildSearchIndex.java index ce4ece4c..81224146 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/RebuildSearchIndex.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/RebuildSearchIndex.java @@ -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 } }