Skip to content

Commit 33591e3

Browse files
authored
Attempt to debug test failure (#23)
1 parent b2d9dfb commit 33591e3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

LDK/test/src/org/labkey/test/util/external/labModules/LabModuleHelper.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ private String removeSpaces(String text)
239239
text = text.replaceAll("<[^>]+>|&[^;]+;", "");
240240
text = text.replaceAll(" {2,}", " ");
241241
text = text.replaceAll(", ", ",\n").replaceAll("] ", "]\n");
242-
return text;
242+
return StringUtils.trimToNull(text);
243243
}
244244

245245
public void goToAssayResultImport(String assayName)
@@ -290,22 +290,19 @@ private String getExampleData(String currentWindow)
290290
_test.log("Current window: " + currentWindow + ", all: [" + StringUtils.join(handles, ",") + "]");
291291
for (String handle : handles)
292292
{
293-
_test.log("inspecting window: " + handle);
294293
if (!currentWindow.equals(handle))
295294
{
296295
_test.log("switching to: " + handle);
297296
_test.getDriver().switchTo().window(handle);
298297
ret = _test.shortWait().withMessage("Unable to retrieve example data after shortWait")
299-
.until(wd -> StringUtils.trimToNull(_test.getHtmlSource()));
298+
.until(wd -> removeSpaces(StringUtils.trimToNull(_test.getHtmlSource())));
300299

301300
if (StringUtils.trimToNull(ret) == null)
302301
{
303302
_test.checker().takeScreenShot("DownloadExampleData" + handle);
304303
}
305304

306-
Assert.assertNotNull("Unable to retrieve example data for window: " + handle, StringUtils.trimToNull(ret));
307-
ret = StringUtils.trimToNull(removeSpaces(ret));
308-
Assert.assertNotNull("Unable to retrieve example data for window after remove spaces: " + handle, ret);
305+
Assert.assertNotNull("Unable to retrieve example data for window: " + handle, ret);
309306

310307
_test.getDriver().close();
311308
_test.getDriver().switchTo().window(currentWindow);

0 commit comments

Comments
 (0)