Skip to content

Commit 785f0f8

Browse files
committed
Improve getExampleData() logic
1 parent c2f6e64 commit 785f0f8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ public Locator getAssayWell(String text, String color)
228228

229229
private String removeSpaces(String text)
230230
{
231+
if (text == null)
232+
{
233+
return null;
234+
}
235+
231236
//the browser converts line breaks to spaces. this is a hack to get them back
232237
text = text.replaceAll("<[^>]+>|&[^;]+;", "");
233238
text = text.replaceAll(" {2,}", " ");
@@ -289,9 +294,8 @@ private String getExampleData(String currentWindow)
289294
{
290295
_test.getDriver().switchTo().window(handle);
291296
ret = _test.shortWait().withMessage("Unable to retrieve example data")
292-
.until(wd -> StringUtils.trimToNull(_test.getHtmlSource()));
297+
.until(wd -> removeSpaces(StringUtils.trimToNull(_test.getHtmlSource())));
293298

294-
ret = removeSpaces(ret);
295299
_test.getDriver().close();
296300
_test.getDriver().switchTo().window(currentWindow);
297301
}

0 commit comments

Comments
 (0)