Skip to content

Commit

Permalink
Set expected file path according to OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
labkey-danield committed Nov 6, 2024
1 parent 7aceebb commit d6f5e33
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.labkey.test.tests.study;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.SystemUtils;
import org.jetbrains.annotations.Nullable;
import org.junit.BeforeClass;
import org.junit.Test;
Expand Down Expand Up @@ -121,7 +122,18 @@ public void testFileField() throws IOException
.selectDatasetByName(datasetName)
.clickViewData();

assertElementPresent("Did not find the expected sample.txt from the imported dataset.", Locator.tagWithText("a", " datasetdata/sample.txt"), 1);
String expectedText;

if (SystemUtils.IS_OS_WINDOWS)
{
expectedText = " datasetdata\\sample.txt";
}
else
{
expectedText = " datasetdata/sample.txt";
}

assertElementPresent("Did not find the expected sample.txt from the imported dataset.", Locator.tagWithText("a", expectedText), 1);
downloadedFile = doAndWaitForDownload(() -> waitAndClick(WAIT_FOR_JAVASCRIPT, Locator.tagWithAttribute("a", "title", "Download attached file"), 0));
checker().verifyTrue("Incorrect file content ", FileUtils.contentEquals(downloadedFile, inputFile));

Expand Down

0 comments on commit d6f5e33

Please sign in to comment.