diff --git a/data/api/EmbeddedQueryWebPart.html b/data/api/EmbeddedQueryWebPart.html index 55f4729e41..6acd215c52 100644 --- a/data/api/EmbeddedQueryWebPart.html +++ b/data/api/EmbeddedQueryWebPart.html @@ -1,4 +1,5 @@
+ \ No newline at end of file diff --git a/data/api/webdavTest.html b/data/api/webdavTest.html index d029237750..13c515ab85 100644 --- a/data/api/webdavTest.html +++ b/data/api/webdavTest.html @@ -1,4 +1,5 @@
+ diff --git a/modules/simpletest/resources/views/testCustomLogin.html b/modules/simpletest/resources/views/testCustomLogin.html index b2e7ed0618..bb0ce2ea73 100644 --- a/modules/simpletest/resources/views/testCustomLogin.html +++ b/modules/simpletest/resources/views/testCustomLogin.html @@ -8,7 +8,7 @@ @@ -17,7 +17,7 @@
Terms of Use
- +
diff --git a/modules/simpletest/resources/views/testCustomLoginWithReturnUrl.html b/modules/simpletest/resources/views/testCustomLoginWithReturnUrl.html index b9b1d18b31..a323639feb 100644 --- a/modules/simpletest/resources/views/testCustomLoginWithReturnUrl.html +++ b/modules/simpletest/resources/views/testCustomLoginWithReturnUrl.html @@ -9,7 +9,7 @@ @@ -18,12 +18,12 @@
Terms of Use
- +
- +
Sign In diff --git a/src/org/labkey/test/components/ui/FilterStatusValue.java b/src/org/labkey/test/components/ui/FilterStatusValue.java index 4b4c0557c3..34422a9060 100644 --- a/src/org/labkey/test/components/ui/FilterStatusValue.java +++ b/src/org/labkey/test/components/ui/FilterStatusValue.java @@ -33,7 +33,7 @@ public WebDriver getDriver() public String getText() { - return elementCache().textSpan().getText(); + return elementCache().textSpan.getText(); } private boolean isActive() @@ -52,16 +52,16 @@ public void remove() getWrapper().mouseOver(getComponentElement()); getWrapper().mouseOver(elementCache().icon); WebDriverWrapper.waitFor(()-> isActive() && isClose(), - "the filter status item with text ["+getText()+"] did not become active", 500); + "The filter status item with text ["+getText()+"] did not become active.", 500); elementCache().icon.click(); - // if the item you're dismissing is not the rightmost, it won't become stale; instead, its text will + // If the item you're dismissing is not the rightmost, it won't become stale; instead, its text will // be swapped out with the one to its right. So, we check to see that either the text has changed or - // the item became stale. - WebDriverWrapper.waitFor(()-> { - return ExpectedConditions.stalenessOf(getComponentElement()).apply(getDriver()) - || !getText().equals(originalText); - }, "the value item ["+originalText+"] did not disappear", 1000); + // the item became stale. ExpectedConditions.textToBePresentInElement returns false if element is stale. + WebDriverWrapper.waitFor(()-> ExpectedConditions.not( + ExpectedConditions.textToBePresentInElement(elementCache().textSpan, originalText)) + .apply(getDriver()) + , "The value item ["+originalText+"] did not disappear.", 1000); } /** @@ -82,10 +82,7 @@ protected ElementCache newElementCache() protected class ElementCache extends Component.ElementCache { - public WebElement textSpan() - { - return Locator.tag("span").findElement(getComponentElement()); - } + public final WebElement textSpan = Locator.tag("span").refindWhenNeeded(getComponentElement()); public final WebElement icon = Locator.tag("i").findWhenNeeded(getComponentElement()); } diff --git a/src/org/labkey/test/tests/AdminConsoleTest.java b/src/org/labkey/test/tests/AdminConsoleTest.java index 2108286bea..a63f0c7598 100644 --- a/src/org/labkey/test/tests/AdminConsoleTest.java +++ b/src/org/labkey/test/tests/AdminConsoleTest.java @@ -68,7 +68,7 @@ public void testRibbonBar() waitForElement(Locator.xpath("//div[contains(text(), 'Cannot enable the ribbon message without providing a message to show')]")); String linkText = "and also click this..."; - String html = "READ ME!!! " + linkText + ""; + String html = "READ ME!!! " + linkText + ""; //only check if not already checked checkbox = Locator.checkboxByName("showRibbonMessage").findElement(getDriver()); @@ -84,7 +84,7 @@ public void testRibbonBar() Locator ribbonLink = Locator.tagWithClassContaining("div", "alert").append(Locator.linkContainingText("and also click this...")); assertElementPresent(ribbonLink); String href = ribbonLink.findElement(getDriver()).getAttribute("href"); - String expected = WebTestHelper.getBaseURL() + "/project/home/begin.view"; + String expected = WebTestHelper.getBaseURL() + "/home/project-begin.view"; assertEquals("Incorrect URL", expected, href); goToHome(); diff --git a/src/org/labkey/test/tests/BaseTermsOfUseTest.java b/src/org/labkey/test/tests/BaseTermsOfUseTest.java index 8a0e5acbed..29322ded18 100644 --- a/src/org/labkey/test/tests/BaseTermsOfUseTest.java +++ b/src/org/labkey/test/tests/BaseTermsOfUseTest.java @@ -153,7 +153,6 @@ public List getAssociatedModules() protected void goToProjectBegin(String projectName) { - beginAt("project/" + projectName + "/begin.view?"); + beginAt(projectName + "/project-begin.view"); } - } \ No newline at end of file diff --git a/src/org/labkey/test/tests/ContainerContextTest.java b/src/org/labkey/test/tests/ContainerContextTest.java index bf2b1c807a..f3ee55a4cd 100644 --- a/src/org/labkey/test/tests/ContainerContextTest.java +++ b/src/org/labkey/test/tests/ContainerContextTest.java @@ -263,7 +263,7 @@ public void testIssue15751() throws Exception insertJobIntoSubFolder(SUB_FOLDER_B); log("** Viewing pipeline status from project container. Sort by Description (report name) and include sub-folders"); - beginAt("/pipeline-status/" + getProjectName() + "/showList.view?StatusFiles.sort=Description&StatusFiles.containerFilterName=CurrentAndSubfolders"); + beginAt("/" + getProjectName() + "/pipeline-status-showList.view?StatusFiles.sort=Description&StatusFiles.containerFilterName=CurrentAndSubfolders"); log("** Checking URLs go to correct container..."); String href = getAttribute(Locator.tagWithText("a", "COMPLETE").index(0), "href"); diff --git a/src/org/labkey/test/tests/CrossSiteScriptingForDeleteTest.java b/src/org/labkey/test/tests/CrossSiteScriptingForDeleteTest.java index b4863de3e7..945b9372a8 100644 --- a/src/org/labkey/test/tests/CrossSiteScriptingForDeleteTest.java +++ b/src/org/labkey/test/tests/CrossSiteScriptingForDeleteTest.java @@ -19,7 +19,7 @@ public class CrossSiteScriptingForDeleteTest extends BaseWebDriverTest { protected static final String PROJECT_NAME = "CrossSiteScriptingForDeleteTest"; protected static final String REPORT_NAME = BaseWebDriverTest.INJECT_CHARS_1; - private static final String LINK_REPORT_URL = "/project/home/begin.view"; + private static final String LINK_REPORT_URL = "/home/project-begin.view"; @BeforeClass public static void initTest() diff --git a/src/org/labkey/test/tests/FileAttachmentColumnTest.java b/src/org/labkey/test/tests/FileAttachmentColumnTest.java index dd16f916f6..70f3291666 100644 --- a/src/org/labkey/test/tests/FileAttachmentColumnTest.java +++ b/src/org/labkey/test/tests/FileAttachmentColumnTest.java @@ -100,7 +100,7 @@ private void doSetup() private void createList() { - beginAt("/project/" + getProjectName() +"/"+ FOLDER_NAME + "/begin.view?"); + beginAt(getProjectName() + "/" + FOLDER_NAME + "/project-begin.view"); clickTab("Portal"); ListHelper listHelper = new ListHelper(getDriver()); @@ -130,7 +130,7 @@ private void createList() private void createSampleType() { - beginAt("/project/" + getProjectName() +"/"+ FOLDER_NAME + "/begin.view?"); + beginAt(getProjectName() + "/" + FOLDER_NAME + "/project-begin.view"); clickTab("Portal"); PortalHelper portalHelper = new PortalHelper(getDriver()); @@ -160,7 +160,7 @@ private void createSampleType() @Before public void preTest() { - beginAt("/project/" + getProjectName() +"/"+ FOLDER_NAME + "/begin.view?"); + beginAt(getProjectName() + "/" + FOLDER_NAME + "/project-begin.view"); } @Override diff --git a/src/org/labkey/test/tests/JUnitTest.java b/src/org/labkey/test/tests/JUnitTest.java index 03e14314c5..db74952bb2 100644 --- a/src/org/labkey/test/tests/JUnitTest.java +++ b/src/org/labkey/test/tests/JUnitTest.java @@ -201,7 +201,7 @@ private static TestSuite _suite(Predicate> accept, boolean sk CloseableHttpResponse response = null; try (CloseableHttpClient client = WebTestHelper.getHttpClient()) { - final String url = WebTestHelper.getBaseURL() + "/junit-testlist.view?"; + final String url = WebTestHelper.getBaseURL() + "/junit-testlist.view"; HttpGet method = new HttpGet(url); try { diff --git a/src/org/labkey/test/tests/NonStudyReportsTest.java b/src/org/labkey/test/tests/NonStudyReportsTest.java index 9eb7a9aa15..5d3949800b 100644 --- a/src/org/labkey/test/tests/NonStudyReportsTest.java +++ b/src/org/labkey/test/tests/NonStudyReportsTest.java @@ -56,7 +56,7 @@ public class NonStudyReportsTest extends ReportTest private static final String DISCUSSION_BODY_3 = "Editing a discussion response"; private static final String LINK_REPORT1_NAME = "Link report 1" + BaseWebDriverTest.INJECT_CHARS_2; private static final String LINK_REPORT1_DESCRIPTION = "Link report 1" + BaseWebDriverTest.INJECT_CHARS_2; - private static final String LINK_REPORT1_URL = "/project/home/begin.view"; + private static final String LINK_REPORT1_URL = "/home/project-begin.view"; private static final String LINK_REPORT2_NAME = "Link report 2" + BaseWebDriverTest.INJECT_CHARS_2; private static final String LINK_REPORT2_DESCRIPTION = "This link report points links to an external page."; protected final PortalHelper portalHelper = new PortalHelper(this); diff --git a/src/org/labkey/test/tests/SecurityTest.java b/src/org/labkey/test/tests/SecurityTest.java index d1d983c987..670f02d5c4 100644 --- a/src/org/labkey/test/tests/SecurityTest.java +++ b/src/org/labkey/test/tests/SecurityTest.java @@ -167,23 +167,23 @@ public void testSteps() throws IOException protected void cantReachAdminToolFromUserAccount() { final String historyTabTitle = "History:"; - final Set unreachableUrls = new HashSet<>(Arrays.asList("/admin/showAdmin.view?", "/user/showUsers.view?", - "/security/group.view?group=Administrators", "/security/group.view?group=Developers", - "/user/showUsers.view?", "/security/project.view?returnUrl=%2Fuser%2FshowUsers.view%3F", "/admin/createFolder.view?", - "/analytics/begin.view?", "/login/configure.view?", "/admin/customizeEmail.view?", "/admin/filesSiteSettings.view?", - "/admin/projectSettings.view?", "/flow/flowAdmin.view?", "/admin/reorderFolders.view?", "/admin/customizeSite.view?", - "/core/configureReportsAndScripts.view?", "/audit/showAuditLog.view?", "/search/admin.view?", - "/ms2/showMS2Admin.view?", "/experiment-types/begin.view?", "/pipeline-status/showList.view?", - "/pipeline/setup.view?", "/ms2/showProteinAdmin.view?", "/admin/actions.view?", "/admin/caches.view?", - "/admin/dbChecker.view?", "/query/dataSourceAdmin.view?", "/admin/dumpHeap.view?", "/admin/environmentVariables.view?", - "/admin/memTracker.view?", "/admin/queries.view?", "/admin/resetErrorMark.view?", "/admin/showThreads.view?", - "/admin-sql/scripts.view?", "/admin/systemProperties.view?", "/admin/emailTest.view?", "/admin/showAllErrors.view?", - "/admin/showErrorsSinceMark.view?", "/admin/showPrimaryLog.view?", + final Set unreachableUrls = new HashSet<>(Arrays.asList("/admin-showAdmin.view", "/user-showUsers.view", + "/security-group.view?group=Administrators", "/security-group.view?group=Developers", + "/user-showUsers.view", "/security-project.view?returnUrl=%2Fuser%2FshowUsers.view%3F", "/admin-createFolder.view", + "/analytics-begin.view", "/login-configure.view", "/admin-customizeEmail.view", "/admin-filesSiteSettings.view", + "/admin-projectSettings.view", "/flow-flowAdmin.view", "/admin-reorderFolders.view", "/admin-customizeSite.view", + "/core-configureReportsAndScripts.view", "/audit-showAuditLog.view", "/search-admin.view", + "/ms2-showMS2Admin.view", "/experiment-types-begin.view", "/pipeline-status-showList.view", + "/pipeline-setup.view", "/ms2-showProteinAdmin.view", "/admin-actions.view", "/admin-caches.view", + "/admin-dbChecker.view", "/query-dataSourceAdmin.view", "/admin-dumpHeap.view", "/admin-environmentVariables.view", + "/admin-memTracker.view", "/admin-queries.view", "/admin-resetErrorMark.view", "/admin-showThreads.view", + "/admin-sql-scripts.view", "/admin-systemProperties.view", "/admin-emailTest.view", "/admin-showAllErrors.view", + "/admin-showErrorsSinceMark.view", "/admin-showPrimaryLog.view", /* Management actions shouldn't be reachable by non-admins */ - "/admin-missingValues.view", "/admin-manageFolders.view", "/admin-moduleProperties.view", "/admin-concepts.view", - "/search-searchSettings.view", "/admin-notifications.view", "/admin-exportFolder.view", "/admin-importFolder.view", - "/admin-fileRoots.view", "/admin-folderInformation.view" + "/admin-missingValues.view", "/admin-manageFolders.view", "/admin-moduleProperties.view", "/admin-concepts.view", + "/search-searchSettings.view", "/admin-notifications.view", "/admin-exportFolder.view", "/admin-importFolder.view", + "/admin-fileRoots.view", "/admin-folderInformation.view" )); @@ -430,7 +430,7 @@ protected void checkGroupMembership(String userName, String groupName, int expec @LogMethod protected void tokenAuthenticationTest() throws IOException { - beginAt("/project/SecurityVerifyProject/begin.view?"); + beginAt("/SecurityVerifyProject/project-begin.view"); String homePageUrl = removeUrlParameters(getURL().toString()); // Absolute URL for redirect, get rid of '?' String relUrl = getCurrentRelativeURL(); boolean newSchool = relUrl.contains("project-"); diff --git a/src/org/labkey/test/tests/SimpleModuleTest.java b/src/org/labkey/test/tests/SimpleModuleTest.java index dba01d3d66..7052761223 100644 --- a/src/org/labkey/test/tests/SimpleModuleTest.java +++ b/src/org/labkey/test/tests/SimpleModuleTest.java @@ -98,11 +98,12 @@ public class SimpleModuleTest extends BaseWebDriverTest public static final String VEHICLE_SCHEMA = "vehicle"; public static final String CORE_SCHEMA = "core"; public static final String LIST_NAME = "People"; - public static final String LIST_DATA = "Name\tAge\tCrazy\n" + - "Dave\t39\tTrue\n" + - "Adam\t65\tTrue\n" + - "Britt\t30\tFalse\n" + - "Josh\t30\tTrue"; + public static final String LIST_DATA = """ + Name\tAge\tCrazy + Dave\t39\tTrue + Adam\t65\tTrue + Britt\t30\tFalse + Josh\t30\tTrue"""; public static final String STUDY_FOLDER_TAB_NAME = "Study Container Tab"; public static final String ASSAY_FOLDER_TAB_NAME = "Assay Container Tab 2"; @@ -132,57 +133,62 @@ public class SimpleModuleTest extends BaseWebDriverTest private static final File CAMRY_THUMBNAIL = TestFileUtils.getSampleData("thumbnails/camry.jpg"); private static final File FOCUS_POPUP = TestFileUtils.getSampleData("thumbnails/focusPopup.jpg"); - private static final String XML_METADATA = " \n" + - " \n" + - " \n" + - " \n" + - " varchar\n" + - " \n" + - " org.labkey.api.data.URLDisplayColumn$Factory\n" + - " \n" + - " /_webdav/SimpleModuleTest%20Project/%40files/${thumbnailImage}\n" + - " /_webdav/SimpleModuleTest%20Project/%40files/${popupImage}\n" + - " 150px\n" + - " \n" + - " \n" + - " /_webdav/SimpleModuleTest%20Project/%40files/${Image}\n" + - " \n" + - " \n" + - "
\n" + - "
\n"; - - private static final String XML_METADATA_NO_POPUP = " \n" + - " \n" + - " \n" + - " \n" + - " varchar\n" + - " \n" + - " org.labkey.api.data.URLDisplayColumn$Factory\n" + - " \n" + - " /_webdav/SimpleModuleTest%20Project/%40files/${thumbnailImage}\n" + - " \n" + - " \n" + - " \n" + - " /_webdav/SimpleModuleTest%20Project/%40files/${Image}\n" + - " \n" + - " \n" + - "
\n" + - "
\n"; - - private static final String XML_METADATA_CUSTOM_QUERY = "\n" + - " \n" + - " Name\n" + - " /query/insertQueryRow.view?schemaName=vehicle&queryName=Colors \n" + - " /query/updateQueryRow.view?schemaName=vehicle&queryName=Colors&Name=${Name} \n" + - " /query/import.view?schemaName=vehicle&queryName=Colors \n" + - " /query/deleteQueryRows.view?schemaName=vehicle&queryName=Colors \n" + - " \n" + - " \t\n" + - " \ttrue\n" + - " \n" + - " \n" + - "
\n" + - "
"; + private static final String XML_METADATA = """ + + + + + varchar + + org.labkey.api.data.URLDisplayColumn$Factory + + /_webdav/SimpleModuleTest%20Project/%40files/${thumbnailImage} + /_webdav/SimpleModuleTest%20Project/%40files/${popupImage} + 150px + + + /_webdav/SimpleModuleTest%20Project/%40files/${Image} + + +
+
+ """; + + private static final String XML_METADATA_NO_POPUP = """ + + + + + varchar + + org.labkey.api.data.URLDisplayColumn$Factory + + /_webdav/SimpleModuleTest%20Project/%40files/${thumbnailImage} + + + + /_webdav/SimpleModuleTest%20Project/%40files/${Image} + + +
+
+ """; + + private static final String XML_METADATA_CUSTOM_QUERY = """ + + + Name + /query/insertQueryRow.view?schemaName=vehicle&queryName=Colors\s + /query/updateQueryRow.view?schemaName=vehicle&queryName=Colors&Name=${Name}\s + /query/import.view?schemaName=vehicle&queryName=Colors\s + /query/deleteQueryRows.view?schemaName=vehicle&queryName=Colors\s + + + true + + +
+
"""; private final PortalHelper portalHelper = new PortalHelper(this); @@ -590,7 +596,7 @@ else if (name.equalsIgnoreCase("F150")) assertTextPresent("Name", "Toyota"); log("** Testing vehicle.Model RowId url link..."); - beginAt("/query/" + getProjectName() + "/begin.view?"); + beginAt(getProjectName() + "/query-begin.view"); viewQueryData(VEHICLE_SCHEMA, "Models"); clickAndWait(Locator.linkWithText("Prius")); assertTextPresent("Hooray!"); @@ -855,7 +861,7 @@ private void validateThumbnails(String thumbnailImage, @Nullable String thumbnai @LogMethod private void doTestViewEditing() { - beginAt("/query/" + getProjectName() + "/executeQuery.view?schemaName=" + VEHICLE_SCHEMA + "&query.queryName=Vehicles"); + beginAt("/" + getProjectName() + "/query-executeQuery.view?schemaName=" + VEHICLE_SCHEMA + "&query.queryName=Vehicles"); DataRegionTable dr = new DataRegionTable("query", this); @@ -1181,7 +1187,6 @@ private void doTestReportThumbnails() @LogMethod private void doTestReportIcon() { - log("Verify custom module report icon image"); setFormElement(Locator.xpath("//table[contains(@class, 'dataset-search')]//input"), KNITR_PEOPLE); waitForElementToDisappear(Locator.tag("tr").withClass("x4-grid-row").containing(WANT_TO_BE_COOL).notHidden()); @@ -1394,78 +1399,79 @@ private void doTestFilterSort() throws Exception assertEquals("Expected first row to be 2000.", 2000, selectResp.getRows().get(1).get("ModelYear")); assertTrue("Expected the column 'ModelId/ManufacturerId/Name' to be included based on the default view", selectResp.getColumnModel("ModelId/ManufacturerId/Name") != null); assertEquals("Expected to return 6 columns, based on the default view", 6, selectResp.getColumnModel().size()); - } - private final String subfolderPath = "/project/" + getProjectName() + "/" + FOLDER_NAME +"/begin.view?"; - - private final static String GET_MODULEP_PROPS_SCRIPT = "library('Rlabkey')\n" + - "baseUrl = labkey.url.base\n" + - "folderPath = \"SimpleModuleTest Project/subfolder\"\n" + - "moduleName = \"simpletest\"\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestProp1\")\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestProp2\")\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestTextArea\")\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestCheckbox\")\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestSelect\")\n" + - "labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestCombo\")"; - - private static final String SET_MODULE_PROPS_SCRIPT = "library('Rlabkey')\n" + - "baseUrl = labkey.url.base\n" + - "moduleName = \"simpletest\"\n" + - "\n" + - "## set site wide properties\n" + - "folderPath = \"/\"\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestProp1\", propValue = \"Prop1apiValue\")\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestCheckbox\", propValue = \"false\")\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestSelect\", propValue = \"value2\")\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestCombo\", propValue = \"comboValue2\")\n" + - "\n" + - "## set folder level properties\n" + - "folderPath = \"SimpleModuleTest Project/subfolder\"\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestProp2\", propValue = \"Prop2apiValue\")\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestTextArea\", propValue = \"$$folder1value$$\")\n" + - "\n" + - "## set folder level property for another folder\n" + - "folderPath = \"SimpleModuleTest Project/subfolder2\"\n" + - "labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = \"TestTextArea\", propValue = \"$$folder2value$$\")"; - - - private static final String ENSURE_RLIBPATHS_SOURCE = "library('Rlabkey')\n" + - "baseUrl = labkey.url.base\n" + - "moduleName = \"simpletest\"\n" + - "propName = \"TestTextArea\"\n" + - "\n" + - "labkey.ensureRLibPath <- function(append=FALSE)\n" + - "{\n" + - " propValue <- labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName)\n" + - " \n" + - " splits <- strsplit(propValue, '\\r\\n|\\n|\\r')\n" + - " paths <- splits[[1]]\n" + - " \n" + - " if (append == TRUE)\n" + - " \t.libPaths(c(paths, .libPaths()))\n" + - " else\n" + - " \t.libPaths(c(paths[1], paths[2]))\n" + - " \n" + - " .libPaths()\n" + - "}\n" + - " \n" + - "folderPath = \"SimpleModuleTest Project/subfolder\"\n" + - "print(\"BEGIN-FIRST-CALL\")\n" + - "labkey.ensureRLibPath() \n" + - "print(\"END-FIRST-CALL\")\n" + - " \n" + - "folderPath = \"SimpleModuleTest Project/subfolder2\" \n" + - "print(\"BEGIN-SECOND-CALL\")\n" + - "labkey.ensureRLibPath()\n" + - "print(\"END-SECOND-CALL\") \n" + - "\n" + - "folderPath = \"SimpleModuleTest Project/subfolder\" \n" + - "print(\"BEGIN-THIRD-CALL\")\n" + - "labkey.ensureRLibPath(append=TRUE)\n" + - "print(\"END-THIRD-CALL\")\n" + - " "; + private final String subfolderPath = getProjectName() + "/" + FOLDER_NAME + "/project-begin.view"; + + private final static String GET_MODULE_PROPS_SCRIPT = """ + library('Rlabkey') + baseUrl = labkey.url.base + folderPath = "SimpleModuleTest Project/subfolder" + moduleName = "simpletest" + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestProp1") + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestProp2") + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestTextArea") + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestCheckbox") + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestSelect") + labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName = "TestCombo")"""; + + private static final String SET_MODULE_PROPS_SCRIPT = """ + library('Rlabkey') + baseUrl = labkey.url.base + moduleName = "simpletest" + + ## set site wide properties + folderPath = "/" + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestProp1", propValue = "Prop1apiValue") + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestCheckbox", propValue = "false") + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestSelect", propValue = "value2") + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestCombo", propValue = "comboValue2") + + ## set folder level properties + folderPath = "SimpleModuleTest Project/subfolder" + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestProp2", propValue = "Prop2apiValue") + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestTextArea", propValue = "$$folder1value$$") + + ## set folder level property for another folder + folderPath = "SimpleModuleTest Project/subfolder2" + labkey.setModuleProperty(baseUrl, folderPath, moduleName, propName = "TestTextArea", propValue = "$$folder2value$$")"""; + + private static final String ENSURE_RLIBPATHS_SOURCE = """ + library('Rlabkey') + baseUrl = labkey.url.base + moduleName = "simpletest" + propName = "TestTextArea" + + labkey.ensureRLibPath <- function(append=FALSE) + { + propValue <- labkey.getModuleProperty(baseUrl, folderPath, moduleName, propName) + \s + splits <- strsplit(propValue, '\\r\\n|\\n|\\r') + paths <- splits[[1]] + \s + if (append == TRUE) + \t.libPaths(c(paths, .libPaths())) + else + \t.libPaths(c(paths[1], paths[2])) + \s + .libPaths() + } + \s + folderPath = "SimpleModuleTest Project/subfolder" + print("BEGIN-FIRST-CALL") + labkey.ensureRLibPath() \s + print("END-FIRST-CALL") + \s + folderPath = "SimpleModuleTest Project/subfolder2" \s + print("BEGIN-SECOND-CALL") + labkey.ensureRLibPath() + print("END-SECOND-CALL") \s + + folderPath = "SimpleModuleTest Project/subfolder" \s + print("BEGIN-THIRD-CALL") + labkey.ensureRLibPath(append=TRUE) + print("END-THIRD-CALL") + \s"""; @LogMethod @Test @@ -1500,7 +1506,7 @@ public void testModuleProperties() throws Exception validateValues(propList); log("Verify get module properties using Rlabkey api"); - String apiModulePropResults = rReportHelper.createAndRunRReport("getModuleProps", GET_MODULEP_PROPS_SCRIPT, false); + String apiModulePropResults = rReportHelper.createAndRunRReport("getModuleProps", GET_MODULE_PROPS_SCRIPT, false); List expectedProps = Arrays.asList("[1] \"Prop1Value\"\n", "[1] \"FolderValue\"\n", "[1] \"updated1\\nupdated2\"\n", @@ -1557,7 +1563,6 @@ public void testModuleProperties() throws Exception goToProjectHome(); assertEquals("Module context not set properly", "DefaultValue", executeScript("return LABKEY.getModuleContext('simpletest')." + prop2)); - } private String getContainerRoot(String containerPath) @@ -1696,29 +1701,30 @@ private void editMetadata(String schemaName, String tableName, String operations clickButton("Save & Finish"); } - private static final String vehicleMetadataJsQuery = "function onFailure(errorInfo, options, responseObj)\n" + - "{\n" + - " if (errorInfo && errorInfo.exception)\n" + - " callback(\"Failure: \" + errorInfo.exception);\n" + - " else\n" + - " callback(\"Failure: \" + responseObj.statusText);\n" + - "}\n" + - "\n" + - "function onSuccess(data)\n" + - "{\n" + - " if(data)\n" + - " callback(data);\n" + - " else\n" + - " callback(\"No data returned!\");\n" + - "}\n" + - "\n" + - "LABKEY.Query.selectRows({\n" + - " schemaName: 'vehicle',\n" + - " queryName: 'Vehicles',\n" + - " columns: ['Color'],\n" + - " success: onSuccess,\n" + - " failure: onFailure\n" + - " });"; + private static final String vehicleMetadataJsQuery = """ + function onFailure(errorInfo, options, responseObj) + { + if (errorInfo && errorInfo.exception) + callback("Failure: " + errorInfo.exception); + else + callback("Failure: " + responseObj.statusText); + } + + function onSuccess(data) + { + if(data) + callback(data); + else + callback("No data returned!"); + } + + LABKEY.Query.selectRows({ + schemaName: 'vehicle', + queryName: 'Vehicles', + columns: ['Color'], + success: onSuccess, + failure: onFailure + });"""; @LogMethod private void doTestFkLookupFilter() diff --git a/src/org/labkey/test/tests/UserTest.java b/src/org/labkey/test/tests/UserTest.java index 26d87fd152..ff5fb6dc1e 100644 --- a/src/org/labkey/test/tests/UserTest.java +++ b/src/org/labkey/test/tests/UserTest.java @@ -307,7 +307,7 @@ private void changeEmailAddress(String currentEmail, String newEmail) private String getEmailChangeMsgBody(String subjectRegex) { EmailRecordTable ert = new EmailRecordTable(getDriver()); - beginAt("/dumbster/begin.view?"); + beginAt("/dumbster-begin.view"); EmailRecordTable.EmailMessage eMsg = ert.getMessageRegEx(subjectRegex); ert.clickMessage(eMsg); eMsg = ert.getMessageRegEx(subjectRegex); diff --git a/src/org/labkey/test/util/SecurityHelper.java b/src/org/labkey/test/util/SecurityHelper.java index 686ec5ae14..ceb0e4b663 100644 --- a/src/org/labkey/test/util/SecurityHelper.java +++ b/src/org/labkey/test/util/SecurityHelper.java @@ -40,7 +40,7 @@ public void setProjectPerm(String userOrGroupName, String permission) public void setProjectPerm(String userOrGroupName, String folder, String permission) { if(_test.getCurrentContainerPath().equals("/" + folder)) - _test.beginAt("/project/" + folder + "/begin.view?"); + _test.beginAt("/" + folder + "/project-begin.view"); _test._permissionsHelper.setPermissions(userOrGroupName, permission); } } diff --git a/src/org/labkey/test/util/WorkbookHelper.java b/src/org/labkey/test/util/WorkbookHelper.java index 38a222b664..3302bf1cc6 100644 --- a/src/org/labkey/test/util/WorkbookHelper.java +++ b/src/org/labkey/test/util/WorkbookHelper.java @@ -62,15 +62,15 @@ public int createWorkbook(String containerPath, String title, String description public int getWorkbookIdFromUrl(URL url) { - // path is something like "http://localhost:8080/labkey/project/ContainerContextTest/2/begin.view?" + // path is something like "http://localhost:8080/labkey/ContainerContextTest/2/project-begin.view" // this code pulls "2" out by finding the last and second to last slashes try { - String path = url.toURI().getPath(); - int idx = path.lastIndexOf("/"); - path = path.substring(0, idx); - idx = path.lastIndexOf("/"); - return Integer.parseInt(path.substring(idx + 1)); + String path = url.toURI().getPath(); + int idx = path.lastIndexOf("/"); + path = path.substring(0, idx); + idx = path.lastIndexOf("/"); + return Integer.parseInt(path.substring(idx + 1)); } catch (URISyntaxException e) { diff --git a/src/org/labkey/test/util/login/AuthenticationAPIUtils.java b/src/org/labkey/test/util/login/AuthenticationAPIUtils.java index 5b556cd8db..d0e9949265 100644 --- a/src/org/labkey/test/util/login/AuthenticationAPIUtils.java +++ b/src/org/labkey/test/util/login/AuthenticationAPIUtils.java @@ -31,7 +31,7 @@ private AuthenticationAPIUtils() {} // private constructor to prevent instantiat "primaryProviders": { "TestSSO": { "helpLink": "https://www.labkey.org/Documentation/20.0/wiki-page.view?name=authenticationModule", - "saveLink": "/labkey/testsso-testSsoSaveConfiguration.view?", + "saveLink": "/labkey/testsso-testSsoSaveConfiguration.view", "settingsFields": [], "description": "A trivial, insecure SSO authentication provider (for test purposes only)", "sso": true @@ -70,7 +70,7 @@ private AuthenticationAPIUtils() {} // private constructor to prevent instantiat "secondaryProviders": { "TestSecondary": { "helpLink": "https://www.labkey.org/Documentation/20.0/wiki-page.view?name=authenticationModule", - "saveLink": "/labkey/testsecondary-testSecondarySaveConfiguration.view?", + "saveLink": "/labkey/testsecondary-testSecondarySaveConfiguration.view", "settingsFields": [], "description": "Adds a trivial, insecure secondary authentication requirement (for test purposes only)" }