@@ -65,7 +65,7 @@ public void testMccModule() throws Exception
6565 testAnimalImportAndTransfer ();
6666 }
6767
68- private void testAnimalImportAndTransfer ()
68+ private void testAnimalImportAndTransfer () throws Exception
6969 {
7070 beginAt (getProjectName () + "/Colonies/SNPRC/project-begin.view" );
7171 waitAndClickAndWait (Locator .tagWithText ("a" , "Import Excel-Based Data" ));
@@ -130,6 +130,14 @@ private void testAnimalImportAndTransfer()
130130 Assert .assertEquals ("Incorrect Status" , "<Alive>" , dr .getDataAsText (0 , "Status" ));
131131 Assert .assertEquals ("Incorrect Colony" , "TargetColony" , dr .getDataAsText (0 , "colony" ));
132132 Assert .assertEquals ("Incorrect Source" , "SNPRC" , dr .getDataAsText (0 , "source" ));
133+
134+ // These were inserted using a cross-folder SaveRows, and this check ensures the trigger script containerPath and serverContex works as expected:
135+ // SelectRowsCommand sr = new SelectRowsCommand("study", "demographics");
136+ // sr.setColumns(Arrays.asList("Id", "QCState/Label"));
137+ // SelectRowsResponse srr = sr.execute(createDefaultConnection(), getProjectName() + "/Colonies/Other");
138+ // srr.getRows().forEach(row -> {
139+ // Assert.assertEquals("Incorrect QCState", "Completed", row.get("QCState/Label"));
140+ // });
133141 }
134142
135143 private static class FormElement
@@ -292,12 +300,16 @@ private Locator getButton(String text)
292300 return Locator .tagWithText ("button" , text );
293301 }
294302
303+ private void waitForCensusToLoad ()
304+ {
305+ waitForElement (Locator .tagWithText ("div" , "Age (Living Animals)" )); //proxy for data loading
306+ }
307+
295308 private void goToAnimalRequests ()
296309 {
297310 goToProjectHome ();
298- waitForElement ( Locator . tagWithText ( "div" , "Age (Living Animals)" )); //proxy for data loading
311+ waitForCensusToLoad ();
299312 waitAndClickAndWait (Locator .tagContainingText ("div" , "Animal Requests" ));
300-
301313 waitForElement (Locator .tagWithText ("a" , "Submit New Animal Request" ));
302314 }
303315
@@ -733,7 +745,7 @@ private void doSetup() throws Exception
733745
734746 beginAt ("/mcc/" + getProjectName () + "/configureMcc.view" );
735747 clickButton ("OK" );
736- waitForElement ( Locator . tagWithText ( "a" , "Populate Lookups" ) );
748+ waitForCensusToLoad ( );
737749
738750 ApiPermissionsHelper helper = new ApiPermissionsHelper (this );
739751 if (!helper .isUserInGroup (getCurrentUser (), "MCC RAB Members" , "/" , PermissionsHelper .PrincipalType .USER ))
@@ -751,6 +763,7 @@ private void doSetup() throws Exception
751763 {
752764 _containerHelper .createSubfolder (getProjectName () + "/Colonies" , name , "MCC Colony" );
753765 importStudy (getProjectName () + "/Colonies/" + name );
766+ waitForElement (Locator .tagWithText ("a" , "Populate Lookups" ));
754767 }
755768 }
756769
@@ -770,7 +783,6 @@ private void importStudy(String containerPath)
770783
771784 beginAt (WebTestHelper .getBaseURL () + "/ehr/" + containerPath + "/ensureQcStates.view" );
772785 clickButton ("OK" );
773-
774786 }
775787
776788 @ Before
0 commit comments