Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion src/org/labkey/test/tests/SampleTypeFolderExportImportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,37 @@ public void testExportImportDerivedSamples() throws Exception
}
}

@Test
public void testExportImportSampleTypesWithSubfolder()
{
String subfolder = "subfolderNoSampleType";
String projectSampleType = "testSamplesWithSubfolder";
String importProject = "testDupeTypeImportProject";

_containerHelper.createSubfolder(getProjectName(), subfolder);
_containerHelper.deleteProject(importProject, false);
_containerHelper.createProject(importProject);
log("Create a sample type in the parent folder");
List<FieldDefinition> testFields = SampleTypeAPIHelper.sampleTypeTestFields(false);
SampleTypeDefinition testSampleType = new SampleTypeDefinition(projectSampleType).setFields(testFields);
SampleTypeAPIHelper.createEmptySampleType(getProjectName(), testSampleType);

goToProjectHome();
ExportFolderPage exportPage = goToFolderManagement()
.goToExportTab();
exportPage.includeSubfolders(true);
File exportedFolderFile = exportPage.exportToBrowserAsZipFile();

goToProjectHome(importProject);
importFolderFromZip(exportedFolderFile, false, 1);
goToProjectFolder(importProject, subfolder);
PortalHelper portalHelper = new PortalHelper(this);
portalHelper.addWebPart("Sample Types");
DataRegionTable table = DataRegionTable.DataRegion(getDriver()).withName("SampleSet").waitFor();
List<String> typeNames = table.getColumnDataAsText("Name");
checker().verifyEquals("Type names not as expected", List.of(projectSampleType), typeNames);
}

@Test
public void testExportImportSampleTypesWithAssayRuns() throws Exception
{
Expand Down Expand Up @@ -650,7 +681,7 @@ public void testExportImportSampleTypesWithAssayRuns() throws Exception
runRecords2.add(Map.of("sampleId", "sample2", "resultData", "less thing"));
runRecords2.add(Map.of("sampleId", "sample3", "resultData", "the other other thing"));

ImportRunCommand importRunCommand2 = new ImportRunCommand(protocolId, runRecords1);
ImportRunCommand importRunCommand2 = new ImportRunCommand(protocolId, runRecords2);
importRunCommand2.setName("secondRun");
importRunCommand2.setBatchId(124);
importRunCommand2.execute(createDefaultConnection(), subfolderPath);
Expand Down
Loading