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 index cf824fc5..8debca4a 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/AbstractVIVOSeleniumTest.java @@ -27,19 +27,21 @@ public class AbstractVIVOSeleniumTest extends AbstractSeleniumTest { while (autoComplete == null) { element.sendKeys(text); - try { - int findElementCount = 0; - while (autoComplete == null && findElementCount < 6) { - Thread.sleep(250); - autoComplete = driver.findElement(By.className("ui-autocomplete")); - if (autoComplete != null && !autoComplete.isDisplayed()) { - autoComplete = null; - } + int findElementCount = 0; + while (autoComplete == null && findElementCount < 6) { + try { + Thread.sleep(250); + + autoComplete = driver.findElement(By.className("ui-autocomplete")); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } catch (NoSuchElementException nse) { + System.out.println("Failure number: " + count); + } + + if (autoComplete != null && !autoComplete.isDisplayed()) { + autoComplete = null; } - } catch (InterruptedException e) { - throw new RuntimeException(e); - } catch (NoSuchElementException nse) { - System.out.println("Failure number: " + count); } if (autoComplete == null) { @@ -80,6 +82,25 @@ public class AbstractVIVOSeleniumTest extends AbstractSeleniumTest { clickAndWait(By.linkText(category)); assertTitle(category); + WebElement individualLink = null; + int pageCount = 1; + do { + try { + individualLink = driver.findElement(By.linkText(individual)); + } catch (NoSuchElementException nse) { + } + + if (individualLink == null) { + pageCount++; + try { + clickAndWait(By.linkText(Integer.toString(pageCount, 10))); + } catch (NoSuchElementException nse) { + break; + } + + } + } while (individualLink == null); + clickAndWait(By.linkText(individual)); assertTitle(individual); 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 index 20c0451e..78a14958 100644 --- a/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java +++ b/selenium/src/test/java/org/vivoweb/vivo/selenium/tests/DeleteLocations.java @@ -19,236 +19,37 @@ public class DeleteLocations extends AbstractVIVOSeleniumTest { vivoDeleteIndividual("Building", "Primate Memorial Building"); /* */ +/* from CreateEquipment */ + clickAndWait(By.linkText("Index")); + assertTitle("Index of Contents"); + + vivoDeleteIndividual("Facility", "Primate Research Lab Room 123"); +/* */ +/* from CreateEvent */ + clickAndWait(By.linkText("Index")); + assertTitle("Index of Contents"); + + vivoDeleteIndividual("Facility", "State Fair Park"); +/* */ /* from CreateLocation */ clickAndWait(By.linkText("Index")); assertTitle("Index of Contents"); vivoDeleteIndividual("Building", "Jane Memorial Building"); + + clickAndWait(By.linkText("Index")); + assertTitle("Index of Contents"); + + vivoDeleteIndividual("Facility", "Lab Admin Office"); + + clickAndWait(By.linkText("Index")); + assertTitle("Index of Contents"); + + vivoDeleteIndividual("Geographic Location", "Primate Quad"); /* */ vivoLogOut(); } } /* - -