diff --git a/installer/webapp/src/main/webResources/META-INF/context.xml b/installer/webapp/src/main/webResources/META-INF/context.xml index 415042c5..f4af100a 100644 --- a/installer/webapp/src/main/webResources/META-INF/context.xml +++ b/installer/webapp/src/main/webResources/META-INF/context.xml @@ -1,4 +1,4 @@ - + 4) { + 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.') @@ -71,6 +114,10 @@ public class AbstractSeleniumTest { driver.switchTo().defaultContent(); } + protected void verifyElementPresent(By by) { + Assert.assertNotNull(driver.findElement(by)); + } + protected void verifyTextPresent(String text) { Assert.assertNotNull(driver.findElement(xpathForTextPresent(text))); } 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 96eac167..7db18ada 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 @@ -193,7 +193,6 @@ public class CreateOrganization extends AbstractSeleniumTest { assertTitle("Primate College of America"); clickAndWait(By.xpath("(//img[@alt='add'])[13]")); - assertTitle("Edit"); selectByLabel(By.id("typeSelector"), "Consortium"); @@ -205,1476 +204,361 @@ public class CreateOrganization extends AbstractSeleniumTest { assertTitle("Primate College of America"); clickAndWait(By.cssSelector("a.add-hasCollaborator > img.add-individual")); - assertTitle("Edit"); - type(By.id("object"), "Primate His"); -// WebElement element; -// element.sendKeys(Keys.ARROW_DOWN); -// element.click(); + typeAutoCompleteSelect(By.id("object"), "Primate His", Keys.ARROW_DOWN); -// try {Thread.sleep(100000); } catch (Exception e) { } + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("(//img[@alt='add'])[14]")); + assertTitle("Edit"); + + type(By.id("typeSelector"), "Service"); + type(By.id("activity"), "Primate Heart Health"); + type(By.id("roleLabel"), "Founder"); + type(By.id("startField-year"), "2010"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[6]")); + clickAndWait(By.cssSelector("a.add-publisherOf > img.add-individual")); + assertTitle("Edit"); + +// type(By.id("typeOfNew"), "Database (vivo)"); + selectByLabel(By.id("typeOfNew"), "Database (vivo)"); + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Primate Info"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("#publicationsGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual")); + assertTitle("Edit"); + + type(By.id("typeSelector"), "Invited Talk"); + type(By.id("presentation"), "Primate Health and Fitness"); + type(By.id("roleLabel"), "Organizer"); + type(By.id("startField-year"), "2008"); + + clickAndWait(By.cssSelector("input.submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[10]")); + clickAndWait(By.cssSelector("#serviceGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual")); + assertTitle("Edit"); + + type(By.id("typeSelector"), "Event"); + type(By.id("activity"), "Primate Health Check"); + type(By.id("roleLabel"), "Sponsor"); + type(By.id("startField-year"), "2008"); + type(By.id("endField-year"), "2010"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[12]")); + clickAndWait(By.cssSelector("a.add-RO_0001025 > img.add-individual")); + assertTitle("Edit"); + + typeAutoCompleteSelect(By.id("object"), "northern Afr", Keys.ARROW_DOWN); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("(//img[@alt='add'])[34]")); + assertTitle("Edit"); + + type(By.id("emailAddress"), "info@primates.edu"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("article.property > #ARG_2000028 > a.add-ARG_2000028 > img.add-individual")); + assertTitle("Edit"); + + type(By.id("telephoneNumber"), "555-555-5555"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("(//h3[@id='ARG_2000028']/a)[2]")); + assertTitle("Edit"); + + type(By.id("telephoneNumber"), "555-555-5554"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("(//img[@alt='add'])[35]")); + assertTitle("Edit"); + + type(By.id("streetAddressOne"), "1234 Northern African Nation"); + type(By.id("city"), "Morocco City"); + type(By.id("postalCode"), "1234567890"); + type(By.id("countryEditMode"), "Morocco"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("li.nonSelectedGroupTab.clickable")); + clickAndWait(By.cssSelector("a.add-dateTimeInterval > img.add-individual")); + assertTitle("Edit"); + + type(By.id("startField-year"), "1959"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//h3[@id='abbreviation']/a/img")); + assertTitle("Edit"); + + typeTinyMCE("PCoA"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]")); + clickAndWait(By.xpath("//h3[@id='freetextKeyword']/a/img")); + assertTitle("Edit"); + + typeTinyMCE("Gorillas"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("li.nonSelectedGroupTab.clickable")); + clickAndWait(By.xpath("(//img[@alt='add'])[14]")); + assertTitle("Edit"); + + type(By.id("typeSelector"), "Workshop"); + type(By.id("activity"), "New Primate Students "); + type(By.id("startField-year"), "2006"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("(//img[@alt='add'])[15]")); + assertTitle("Edit"); + + type(By.id("typeSelector"), "Performance"); + type(By.id("activity"), "Primates in the Wild"); + type(By.id("startField-year"), "1997"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[6]")); + clickAndWait(By.cssSelector("a.add-featuredIn > img.add-individual")); + assertTitle("Edit"); + + selectByLabel(By.id("typeOfNew"), "Blog Posting (vivo)"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Primate Happenings"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("a.add-assigneeFor > img.add-individual")); + assertTitle("Edit"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "USA222333444555"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("a.add-translatorOf > img.add-individual")); + assertTitle("Edit"); + + selectByLabel(By.id("objectVar"), "Primate Happenings (Blog Posting)"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]")); + 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); + + clickAndWait(By.cssSelector("input.submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("a.add-ERO_0001520 > img.add-individual")); + assertTitle("Edit"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Human and Ape Brain Comparison"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[10]")); + clickAndWait(By.cssSelector("a.add-ERO_0000037 > img.add-individual")); + assertTitle("Edit"); + + selectByLabel(By.id("typeOfNew"), "Transport Service (obo)"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Gorilla Moving Company"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("#serviceGroup > article.property > #offers > a.add-offers > img.add-individual")); + assertTitle("Edit"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Introduction to Primates"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[12]")); + clickAndWait(By.cssSelector("a.add-hasSuccessorOrganization > img.add-individual")); + assertTitle("Edit"); + + selectByLabel(By.id("typeOfNew"), "University (vivo)"); + + clickAndWait(By.id("offerCreate")); + assertTitle("Edit"); + + type(By.id("label"), "Primate University of America"); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + clickAndWait(By.cssSelector("a.add-governingAuthorityFor > img.add-individual")); + assertTitle("Edit"); + + typeAutoCompleteSelect(By.id("object"), "primate colleges of the wor", Keys.ARROW_DOWN); + + clickAndWait(By.id("submit")); + assertTitle("Primate College of America"); + + // Verify everything entered is displaying properly + + clickAndWait(By.cssSelector("li.nonSelectedGroupTab.clickable")); + verifyTextPresent("PCoA"); + verifyTextPresent("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.cssSelector("li.nonSelectedGroupTab.clickable")); + 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 -"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[6]")); + 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")); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[8]")); + verifyElementPresent(By.linkText("Primate Habitat Research Grant")); + verifyElementPresent(By.linkText("Primate Survival Planning Grant")); + verifyElementPresent(By.linkText("Human and Ape Brain Comparison")); + verifyTextPresent("Gorillas"); + + clickAndWait(By.xpath("//div[@id='wrapper-content']/ul/li[10]")); + 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"); + 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 -"); + 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(); } } -/* - - -*/ - - -/* - -click -id=ui-active-menuitem - - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - -clickAndWait -xpath=(//img[@alt='add'])[14] - - - -assertTitle -Edit - - - -select -typeSelector -label=Service - - -type -id=activity -Primate Heart Health - - -type -roleLabel -Founder - - -type -startField-year -2010 - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - - -click -//div[@id='wrapper-content']/ul/li[6] - - - -clickAndWait -css=a.add-publisherOf > img.add-individual - - - -assertTitle -Edit - - - -select -id=typeOfNew -label=Database (vivo) - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Primate Info - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=#publicationsGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual - - - -assertTitle -Edit - - - -select -typeSelector -label=Invited Talk - - -type -id=presentation -Primate Health and Fitness - - -type -roleLabel -Organizer - - -type -startField-year -2008 - - -clickAndWait -css=input.submit - - - -assertTitle -Primate College of America - - - - -click -//div[@id='wrapper-content']/ul/li[10] - - - -clickAndWait -css=#serviceGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual - - - -assertTitle -Edit - - - -select -typeSelector -label=Event - - -type -id=activity -Primate Health Check - - -type -roleLabel -Sponsor - - -type -startField-year -2008 - - -type -endField-year -2010 - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - - -click -//div[@id='wrapper-content']/ul/li[12] - - - -clickAndWait -css=a.add-RO_0001025 > img.add-individual - - - -assertTitle -Edit - - - -type -id=object - - - -sendKeys -id=object -northern Afr - - -pause -5000 - - - -sendKeys -id=object -${KEY_DOWN} - - -click -id=ui-active-menuitem - - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - - -clickAndWait -xpath=(//img[@alt='add'])[34] - - - -assertTitle -Edit - - - -type -id=emailAddress -info@primates.edu - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=article.property > #ARG_2000028 > a.add-ARG_2000028 > img.add-individual - - - -assertTitle -Edit - - - -type -id=telephoneNumber -555-555-5555 - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -xpath=(//h3[@id='ARG_2000028']/a)[2] - - - -assertTitle -Edit - - - -type -id=telephoneNumber -555-555-5554 - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -xpath=(//img[@alt='add'])[35] - - - -assertTitle -Edit - - - -type -id=streetAddressOne -1234 Northern African Nation - - -type -id=city -Morocco City - - -type -id=postalCode -1234567890 - - -type -id=countryEditMode -Morocco - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - - -click -css=li.nonSelectedGroupTab.clickable - - - -clickAndWait -css=a.add-dateTimeInterval > img.add-individual - - - -assertTitle -Edit - - - -type -startField-year -1959 - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - - -clickAndWait -//h3[@id='abbreviation']/a/img - - - -assertTitle -Edit - - - -waitForElementPresent -tinymce - - - -runScript -tinyMCE.activeEditor.setContent('PCoA') - - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - -click -//div[@id='wrapper-content']/ul/li[8] - - - -clickAndWait -//h3[@id='freetextKeyword']/a/img - - - -assertTitle -Edit - - - -waitForElementPresent -tinymce - - - -runScript -tinyMCE.activeEditor.setContent('Gorillas') - - - -clickAndWait -submit - - - -assertTitle -Primate College of America - - - - -click -css=li.nonSelectedGroupTab.clickable - - - -clickAndWait -xpath=(//img[@alt='add'])[14] - - - -assertTitle -Edit - - - -select -id=typeSelector -label=Workshop - - -type -id=activity -New Primate Students - - -type -id=startField-year -2003 - - -type -id=endField-year -2006 - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -xpath=(//img[@alt='add'])[15] - - - -assertTitle -Edit - - - -select -id=typeSelector -label=Performance - - -type -id=activity -Primates in the Wild - - -type -id=startField-year -1997 - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -click -//div[@id='wrapper-content']/ul/li[6] - - - -clickAndWait -css=a.add-featuredIn > img.add-individual - - - -assertTitle -Edit - - - -select -id=typeOfNew -label=Blog Posting (vivo) - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Primate Happenings - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=a.add-assigneeFor > img.add-individual - - - -assertTitle -Edit - - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -USA222333444555 - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=a.add-translatorOf > img.add-individual - - - -assertTitle -Edit - - - -select -id=objectVar -label=Primate Happenings (Blog Posting) - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -click -//div[@id='wrapper-content']/ul/li[8] - - - -clickAndWait -css=#researchGroup > article.property > #RO_0000053 > a.add-RO_0000053 > img.add-individual - - - -assertTitle -Edit - - - -type -id=grant - - - -sendKeys -id=grant -primate hab - - -pause -5000 - - - -sendKeys -id=grant -${KEY_DOWN} - - -click -id=ui-active-menuitem - - - -clickAndWait -css=input.submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=a.add-ERO_0001520 > img.add-individual - - - -assertTitle -Edit - - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Human and Ape Brain Comparison - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -click -//div[@id='wrapper-content']/ul/li[10] - - - -clickAndWait -css=a.add-ERO_0000037 > img.add-individual - - - -assertTitle -Edit - - - -select -id=typeOfNew -label=Transport Service (obo) - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Gorilla Moving Company - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=#serviceGroup > article.property > #offers > a.add-offers > img.add-individual - - - -assertTitle -Edit - - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Introduction to Primates - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -click -//div[@id='wrapper-content']/ul/li[12] - - - -clickAndWait -css=a.add-hasSuccessorOrganization > img.add-individual - - - -assertTitle -Edit - - - -select -id=typeOfNew -label=University (vivo) - - -clickAndWait -id=offerCreate - - - -assertTitle -Edit - - - -type -id=label -Primate University of America - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - -clickAndWait -css=a.add-governingAuthorityFor > img.add-individual - - - -assertTitle -Edit - - - -type -id=object - - - -sendKeys -id=object -primate colleges of the wor - - -pause -5000 - - - -sendKeys -id=object -${KEY_DOWN} - - -click -id=ui-active-menuitem - - - -clickAndWait -id=submit - - - -assertTitle -Primate College of America - - - - - -click -css=li.nonSelectedGroupTab.clickable - - - -verifyTextPresent -PCoA - - - -verifyTextPresent -1959 - - - - -verifyElementPresent -link=B.S. Bachelor of Science - - - -verifyElementPresent -link=Primate Student of the Year - - - -verifyElementPresent -link=Best Primate College - - - - -click -css=li.nonSelectedGroupTab.clickable - - - -verifyTextPresent -faculty administrative position - - - -verifyElementPresent -link=Person, Polly - - - -verifyTextPresent -Person, Polly, Dr. 1999 - - - - -verifyElementPresent -link=Primate History Library - - - -verifyElementPresent -link=Primate Research Laboratory - - - -verifyElementPresent -link=Primates-r-us - - - -verifyTextPresent -Primates-r-us Founder 2010 - - - - -verifyElementPresent -link=Primate History Library - - - -verifyElementPresent -link=Primates-r-us - - - -verifyElementPresent -link=Primate Colleges of the World - - - -verifyTextPresent -Primate Colleges of the World Member 2009 - - - - -verifyElementPresent -link=Primate Heart Health - - - -verifyTextPresent -Primate Heart Health Founder 2010 - - - - -verifyElementPresent -link=New Primate Students - - - -verifyTextPresent -New Primate Students 2003 - 2006 - - - -verifyElementPresent -link=Primates in the Wild - - - -verifyTextPresent -Primates in the Wild 1997 - - - - - -click -//div[@id='wrapper-content']/ul/li[6] - - - -verifyElementPresent -link=Primate Info - - - -verifyTextPresent -invited talk - - - -verifyElementPresent -link=Primate Health and Fitness - - - -verifyTextPresent -Primate Health and Fitness, Organizer 2008 - - - -verifyElementPresent -link=Primate Happenings - - - -verifyElementPresent -link=USA222333444555 - - - - -click -//div[@id='wrapper-content']/ul/li[8] - - - -verifyElementPresent -link=Primate Habitat Research Grant - - - -verifyElementPresent -link=Primate Habitat Research Grant - - - -verifyElementPresent -link=Primate Survival Planning Grant - - - -verifyElementPresent -link=Human and Ape Brain Comparison - - - -verifyTextPresent -Gorillas - - - - -click -//div[@id='wrapper-content']/ul/li[10] - - - -verifyElementPresent -link=Gorilla Moving Company - - - -verifyElementPresent -link=Primate Health Check - - - -verifyTextPresent -Primate Health Check Sponsor 2008 - 2010 - - - -verifyElementPresent -link=Portable Primate Habitat - - - -verifyElementPresent -link=Introduction to Primates - - - - -click -//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 - - - -verifyElementPresent -link=northern Africa - - - -verifyElementPresent -link=Primate College of New York - - - -verifyElementPresent -link=Primate University of America - - - -verifyElementPresent -link=Primate Colleges of the World - - - - -click -//div[@id='wrapper-content']/ul/li[14] - - - -verifyTextPresent -PCoA - - - -verifyTextPresent -1959 - - - - -verifyElementPresent -link=B.S. Bachelor of Science - - - -verifyElementPresent -link=Primate Student of the Year - - - -verifyElementPresent -link=Best Primate College - - - -verifyTextPresent -faculty administrative position - - - -verifyElementPresent -link=Person, Polly - - - -verifyTextPresent -Person, Polly, Dr. 1999 - - - - -verifyElementPresent -link=Primate History Library - - - -verifyElementPresent -link=Primate Research Laboratory - - - -verifyElementPresent -link=Primates-r-us - - - -verifyTextPresent -Primates-r-us Founder 2010 - - - - -verifyElementPresent -link=Primate History Library - - - -verifyElementPresent -link=Primates-r-us - - - -verifyElementPresent -link=Primate Colleges of the World - - - -verifyTextPresent -Primate Colleges of the World Member 2009 - - - - -verifyElementPresent -link=Primate Heart Health - - - -verifyTextPresent -Primate Heart Health Founder 2010 - - - - -verifyElementPresent -link=New Primate Students - - - -verifyTextPresent -New Primate Students 2003 - 2006 - - - -verifyElementPresent -link=Primates in the Wild - - - -verifyTextPresent -Primates in the Wild 1997 - - - - -verifyElementPresent -link=Primate Info - - - -verifyTextPresent -invited talk - - - -verifyElementPresent -link=Primate Health and Fitness - - - -verifyTextPresent -Primate Health and Fitness, Organizer 2008 - - - -verifyElementPresent -link=Primate Happenings - - - -verifyElementPresent -link=USA222333444555 - - - -verifyElementPresent -link=Primate Happenings - - - -verifyElementPresent -link=Primate Habitat Research Grant - - - -verifyElementPresent -link=Primate Habitat Research Grant - - - -verifyElementPresent -link=Primate Survival Planning Grant - - - -verifyElementPresent -link=Human and Ape Brain Comparison - - - -verifyTextPresent -Gorillas - - - -verifyElementPresent -link=Gorilla Moving Company - - - -verifyElementPresent -link=Primate Health Check - - - -verifyTextPresent -Primate Health Check Sponsor 2008 - 2010 - - - -verifyElementPresent -link=Portable Primate Habitat - - - -verifyElementPresent -link=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 -link=northern Africa - - - -verifyElementPresent -link=Primate College of New York - - - -verifyElementPresent -link=Primate University of America - - - -verifyElementPresent -link=Primate Colleges of the World - - - - -clickAndWait -link=Home - - - -clickAndWait -link=Log out - - - -assertTitle -VIVO - - - - - -*/ \ 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 new file mode 100644 index 00000000..312249a0 --- /dev/null +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteOrganization.java @@ -0,0 +1,482 @@ +package org.vivoweb.vivo.selenium.tests; + +import org.junit.Test; +import org.openqa.selenium.By; + +public class DeleteOrganization extends AbstractSeleniumTest { + @Test + public void deleteOrganization() { + deleteAllVisibleCookies(); + + open("/"); + assertTitle("VIVO"); + + logIn("testAdmin@cornell.edu", "Password"); + + clickAndWait(By.linkText("Organization")); + assertTitle("Organization"); + + 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")); + + try { Thread.sleep(50000); } catch (Exception e) { } + + logOut(); + } +} +/* + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primate College of New York + + + + assertTitle + Primate College of New York + + + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primate Colleges of the World + + + + assertTitle + Primate Colleges of the World + + + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primate History Library + + + + assertTitle + Primate History Library + + + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primate Research Laboratory + + + + assertTitle + Primate Research Laboratory + + + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primate University of America + + + + assertTitle + Primate University of America + + + + 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=Organization + + + + assertTitle + Organization + + + + clickAndWait + link=Primates-r-us + + + + assertTitle + Primates-r-us + + + + 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