5656import org .labkey .test .pages .core .admin .ShowAdminPage ;
5757import org .labkey .test .pages .user .UserDetailsPage ;
5858import org .labkey .test .util .APIUserHelper ;
59+ import org .labkey .test .util .ApiPermissionsHelper ;
5960import org .labkey .test .util .DataRegionTable ;
6061import org .labkey .test .util .LabKeyExpectedConditions ;
6162import org .labkey .test .util .LogMethod ;
@@ -772,6 +773,9 @@ else if (getDriver().getTitle().startsWith("Sign In"))
772773 // Note: leave the self-report setting unchanged
773774 customizeSitePage .save ();
774775 }
776+
777+ verifySiteGroups ();
778+
775779 /*
776780 Waiting for search service to boot up
777781 Issue 50601: PDF indexing is slow on first file after server startup on Windows
@@ -786,10 +790,12 @@ else if (getDriver().getTitle().startsWith("Sign In"))
786790 waitForElement (Locator .id ("status-progress-bar" ).withText ("Module startup complete" ), WAIT_FOR_PAGE );
787791 clickAndWait (Locator .lkButton ("Next" ));
788792 Locator .lkButton ("Next" )
789- .findOptionalElement (getDriver ())
790- .ifPresent (button ->
791- doAndWaitForPageToLoad (() ->
792- shortWait ().until (LabKeyExpectedConditions .clickUntilStale (button ))));
793+ .findOptionalElement (getDriver ())
794+ .ifPresent (button ->
795+ doAndWaitForPageToLoad (() ->
796+ shortWait ().until (LabKeyExpectedConditions .clickUntilStale (button ))
797+ )
798+ );
793799 }
794800 else
795801 {
@@ -952,6 +958,23 @@ public boolean isRedirected(HttpRequest httpRequest, HttpResponse httpResponse,
952958 }
953959 }
954960
961+ @ LogMethod
962+ private void verifySiteGroups ()
963+ {
964+ // Simple verification of the site groups created at bootstrap time, Issue #52166
965+ ApiPermissionsHelper helper = new ApiPermissionsHelper (this );
966+ // Site groups are returned in known order: alphabetical by name, except that "Users" is replaced with
967+ // "All Site Users" after sorting takes place
968+ List <Map <String , Object >> siteGroups = helper .getSiteGroups ();
969+ assertEquals (2 , siteGroups .size ());
970+ Map <String , Object > guests = siteGroups .get (0 );
971+ assertEquals ("Guests" , guests .get ("name" ));
972+ assertEquals (-3 , guests .get ("id" ));
973+ Map <String , Object > users = siteGroups .get (1 );
974+ assertEquals ("All Site Users" , users .get ("name" ));
975+ assertEquals (-2 , users .get ("id" ));
976+ }
977+
955978 public static final Pattern ERROR_PATTERN = Pattern .compile ("^(ERROR|FATAL)" , Pattern .MULTILINE );
956979
957980 public void checkErrors ()
@@ -982,7 +1005,7 @@ public void checkErrors()
9821005 else if (currentError .size () == 1 )
9831006 {
9841007 // Line after the ERROR usually has the exception type and error message
985- TestLogger .error (" " + iterator . next () );
1008+ TestLogger .error (" " + line );
9861009 }
9871010 else if (line .startsWith ("Caused by:" ))
9881011 {
0 commit comments