Updates to the Selenium WebDriver tests.

This commit is contained in:
Graham Triggs 2016-01-20 13:26:55 +00:00
parent 550db92748
commit 6b296f00c1
5 changed files with 65 additions and 20 deletions

View file

@ -28,7 +28,8 @@ public class AbstractVIVOSeleniumTest extends AbstractSeleniumTest {
element.sendKeys(text);
int findElementCount = 0;
while (autoComplete == null && findElementCount < 6) {
while (autoComplete == null && findElementCount < 5) {
findElementCount++;
try {
Thread.sleep(250);
@ -50,6 +51,11 @@ public class AbstractVIVOSeleniumTest extends AbstractSeleniumTest {
throw new NoSuchElementException("Auto complete is not visible");
}
try {
Thread.sleep(500);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
count++;
}
}

View file

@ -15,8 +15,8 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Grants"));
verifyTextPresent(
"1 Books ",
"3 Grants "
"1 Books",
"3 Grants"
);
clickAndWait(By.linkText("View all ..."));
@ -60,27 +60,33 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("University (1)"));
clickAndWait(By.xpath("//li[@id='college']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate College of New York"));
verifyElementPresent(By.linkText("Primate College of America"));
clickAndWait(By.linkText("Company (1)"));
pause(500);
verifyElementPresent(By.linkText("Primates-r-us"));
clickAndWait(By.xpath("//li[@id='consortium']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Colleges of the World"));
clickAndWait(By.xpath("//li[@id='laboratory']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Research Laboratory"));
clickAndWait(By.xpath("//li[@id='library']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate History Library"));
clickAndWait(By.xpath("//li[@id='organization']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate College of America"));
verifyElementPresent(By.linkText("Primate College of New York"));
@ -91,7 +97,9 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Primates-r-us"));
clickAndWait(By.xpath("//li[@id='organization']/a"));
pause(500);
clickAndWait(By.linkText("P"));
pause(500);
verifyElementPresent(By.linkText("Primate College of America"));
verifyElementPresent(By.linkText("Primate College of New York"));
@ -102,6 +110,7 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Primates-r-us"));
clickAndWait(By.linkText("University (1)"));
pause(500);
verifyElementPresent(By.linkText("Primate University of America"));
clickAndWait(By.linkText("Research"));
@ -120,16 +129,20 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Webpage (1)"));
clickAndWait(By.linkText("Article (1)"));
pause(500);
verifyElementPresent(By.linkText("Primate Happenings"));
clickAndWait(By.linkText("Award or Honor (2)"));
pause(500);
verifyElementPresent(By.linkText("Best Primate College"));
verifyElementPresent(By.linkText("Primate Student of the Year"));
clickAndWait(By.xpath("//li[@id='book']/a"));
pause(500);
verifyElementPresent(By.linkText("PHC Proceedings"));
clickAndWait(By.xpath("//li[@id='concept']/a"));
pause(500);
verifyElementPresent(By.linkText("Animal Health"));
verifyElementPresent(By.linkText("Ape Health"));
@ -140,35 +153,43 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Primate Student of the Year"));
clickAndWait(By.xpath("//li[@id='concept']/a"));
pause(500);
clickAndWait(By.linkText("P"));
pause(500);
verifyElementPresent(By.linkText("Primate Diet"));
verifyElementPresent(By.linkText("Primate Health"));
verifyElementPresent(By.linkText("Primate Student of the Year"));
clickAndWait(By.xpath("//li[@id='database']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Info"));
clickAndWait(By.xpath("//li[@id='grant']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Elderly Care"));
verifyElementPresent(By.linkText("Primate Habitat Research Grant"));
verifyElementPresent(By.linkText("Primate Survival Planning Grant"));
clickAndWait(By.linkText("Human Study (1)"));
pause(500);
verifyElementPresent(By.linkText("Human and Ape Brain Comparison"));
clickAndWait(By.linkText("Patent (1)"));
pause(500);
verifyElementPresent(By.linkText("USA222333444555"));
clickAndWait(By.xpath("//li[@id='proceedings']/a"));
pause(500);
verifyElementPresent(By.linkText("PHC Proceedings"));
clickAndWait(By.xpath("//li[@id='webpage']/a"));
pause(500);
verifyElementPresent(By.linkText("http://primatehealthintro.cornell.edu"));
@ -184,10 +205,12 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Workshop (1)"));
clickAndWait(By.xpath("//li[@id='conference']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Health Conference"));
clickAndWait(By.xpath("//li[@id='event']/a"));
pause(500);
verifyElementPresent(By.linkText("Introduction to Primate Health"));
verifyElementPresent(By.linkText("Introduction to Primates"));
@ -198,22 +221,27 @@ public class CheckBrowseOptions extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Primates in the Wild"));
clickAndWait(By.xpath("//li[@id='invitedTalk']/a"));
pause(500);
verifyElementPresent(By.linkText("Primate Health and Fitness"));
clickAndWait(By.linkText("Performance (1)"));
pause(500);
verifyElementPresent(By.linkText("Primates in the Wild"));
clickAndWait(By.linkText("Presentation (1)"));
pause(500);
verifyElementPresent(By.linkText("Primate Health and Fitness"));
clickAndWait(By.linkText("Seminar Series (1)"));
pause(500);
verifyElementPresent(By.linkText("Primate Health Talks"));
clickAndWait(By.linkText("Workshop (1)"));
pause(500);
verifyElementPresent(By.linkText("New Primate Students"));

View file

@ -19,6 +19,8 @@ public class RebuildSearchIndex extends AbstractVIVOSeleniumTest {
clickAndWait(By.linkText("Rebuild search index")); // clickAndWait,link=Rebuild search index
assertTitle("Rebuild Search Index"); // assertTitle,Rebuild Search Index
waitForTextPresent("Reset the search index and re-populate it."); // waitForTextPresent,Reset the search index and re-populate it.
clickAndWait(By.name("rebuild")); // clickAndWait,name=rebuild
assertTitle("Rebuild Search Index"); // assertTitle, Rebuild Search Index

View file

@ -27,7 +27,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
selectByLabel(By.id("typeSelect"), "Browse Class Group");
selectByLabel(By.id("selectClassGroup"), "activities");
clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
// clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
clickAndWait(By.id("doneWithContent"));
clickAndWait(By.id("menuCheckbox"));
@ -51,7 +51,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
selectByLabel(By.id("typeSelect"), "Browse Class Group");
selectByLabel(By.id("selectClassGroup"), "courses");
clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
// clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
clickAndWait(By.id("doneWithContent"));
clickAndWait(By.id("menuCheckbox"));
@ -76,7 +76,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
selectByLabel(By.id("typeSelect"), "Browse Class Group");
selectByLabel(By.id("selectClassGroup"), "equipment");
clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
// clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
clickAndWait(By.id("doneWithContent"));
clickAndWait(By.id("menuCheckbox"));
@ -111,7 +111,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
selectByLabel(By.id("typeSelect"), "Browse Class Group");
selectByLabel(By.id("selectClassGroup"), "locations");
clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
// clickAndWait(By.cssSelector("option[value=\"http://vivoweb.org/ontology#vitroClassGroupactivities\"]"));
clickAndWait(By.id("doneWithContent"));
clickAndWait(By.id("menuCheckbox"));
@ -132,19 +132,23 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
assertTitle("Activities");
clickAndWait(By.linkText("Project (1)"));
pause(500);
verifyElementPresent(By.linkText("Human and Ape Brain Comparison"));
clickAndWait(By.linkText("Research Project (1)"));
pause(500);
verifyElementPresent(By.linkText("Human and Ape Brain Comparison"));
clickAndWait(By.linkText("Service (2)"));
pause(500);
verifyElementPresent(By.linkText("Gorilla Moving Company"));
verifyElementPresent(By.linkText("Primate Heart Health"));
clickAndWait(By.linkText("Transport Service (1)"));
pause(500);
verifyElementPresent(By.linkText("Gorilla Moving Company"));
@ -152,6 +156,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
assertTitle("Courses");
clickAndWait(By.linkText("Course (2)"));
pause(500);
verifyTextPresent("Course");
verifyElementPresent(By.linkText("Introduction to Primates"));
@ -161,6 +166,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
assertTitle("Equipment");
clickAndWait(By.linkText("Equipment (2)"));
pause(500);
verifyTextPresent("Equipment");
verifyElementPresent(By.linkText("Portable Primate Habitat"));
@ -170,12 +176,14 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
assertTitle("Locations");
clickAndWait(By.linkText("Building (2)"));
pause(500);
verifyTextPresent("Building");
verifyElementPresent(By.linkText("Jane Memorial Building"));
verifyElementPresent(By.linkText("Primate Memorial Building"));
clickAndWait(By.linkText("Facility (5)"));
pause(500);
verifyElementPresent(By.linkText("Jane Memorial Building"));
verifyElementPresent(By.linkText("Lab Admin Office"));
@ -184,6 +192,7 @@ public class TestMenuManagement extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("State Fair Park"));
clickAndWait(By.linkText("Room (1)"));
pause(500);
verifyElementPresent(By.linkText("Lab Admin Office"));

View file

@ -11,7 +11,7 @@ public class VerifyAllThingsSearchable extends AbstractVIVOSeleniumTest {
open("/");
assertTitle("VIVO");
type(By.id("querytext"), "primates");
type(By.name("querytext"), "primates");
clickAndWait(By.xpath("//input[@value='Search']"));
@ -46,10 +46,10 @@ public class VerifyAllThingsSearchable extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Primate Health Check"));
verifyElementPresent(By.linkText("Primate Health Conference"));
verifyElementPresent(By.linkText("Primate Heart Health"));
verifyElementPresent(By.linkText("New Primate Student"));
verifyElementPresent(By.linkText("New Primate Students"));
verifyElementPresent(By.linkText("Primate Habitat Research Grant"));
verifyElementPresent(By.linkText("Primate Memorial Building"));
verifyElementPresent(By.linkText("Primate Student of the Year"));
verifyElementPresent(By.linkText("Best Primate College"));
verifyElementPresent(By.linkText("Primate History Library"));
verifyTextPresent(
"Primates in the Wild Performance",
@ -75,15 +75,15 @@ public class VerifyAllThingsSearchable extends AbstractVIVOSeleniumTest {
"Primate Heart Health Service",
"New Primate Students Workshop",
"Primate Habitat Research Grant Grant",
"Primate Memorial Building Building",
"Primate Student of the Year Award or Honor"
"Best Primate College Award or Honor",
"Primate History Library Library"
);
clickAndWait(By.linkText("2"));
assertTitle("primates - VIVO Search Results");
verifyElementPresent(By.linkText("Best Primate College"));
verifyElementPresent(By.linkText("Primate History Library"));
verifyElementPresent(By.linkText("Primate Memorial Building"));
verifyElementPresent(By.linkText("Primate Student of the Year"));
verifyElementPresent(By.linkText("Primate Survival Planning Grant"));
verifyElementPresent(By.linkText("Primate College of New York"));
verifyElementPresent(By.linkText("Primate Research Lab Room 123"));
@ -91,7 +91,7 @@ public class VerifyAllThingsSearchable extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Ape Health"));
verifyElementPresent(By.linkText("Elderly Care"));
verifyElementPresent(By.linkText("Jane Memorial Building"));
// verifyElementPresent(By.linkText("exact:http://primatehealthintro.cornell.edu"));
verifyElementPresent(By.linkText("http://primatehealthintro.cornell.edu"));
verifyElementPresent(By.linkText("Human and Ape Brain Comparison"));
verifyElementPresent(By.linkText("Person, Polly"));
verifyElementPresent(By.linkText("Gorilla Moving Company"));
@ -102,8 +102,8 @@ public class VerifyAllThingsSearchable extends AbstractVIVOSeleniumTest {
verifyElementPresent(By.linkText("Kenya"));
verifyTextPresent(
"Best Primate College Award or Honor",
"Primate History Library Library",
"Primate Memorial Building Building",
"Primate Student of the Year Award or Honor",
"Primate Survival Planning Grant Grant",
"Primate College of New York College",
"Primate Research Lab Room 123 Facility",