Skip to content
Merged
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
25 changes: 9 additions & 16 deletions src/org/labkey/test/tests/SampleTypeFolderExportImportTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
import org.labkey.test.util.TestDataGenerator;
import org.labkey.test.util.exp.DataClassAPIHelper;
import org.labkey.test.util.exp.SampleTypeAPIHelper;
import org.labkey.test.util.query.QueryApiHelper;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.ExpectedConditions;

Expand Down Expand Up @@ -217,7 +218,7 @@ protected List<Map<String, String>> getSampleDataFromDB(String folderPath, Strin
}

@Test
public void testExportAndImportWithMissingAndRequiredFields()
public void testExportAndImportWithMissingAndRequiredFields() throws Exception
{
final String SAMPLE_TYPE_NAME = "ExportMissingValues";

Expand Down Expand Up @@ -309,25 +310,17 @@ public void testExportAndImportWithMissingAndRequiredFields()
cv.saveCustomView();

log("Derive a sample from the given samples, this will create an experiment run which is needed for export.");

drtSamples.checkAllOnPage();
clickAndWait(Locator.lkButtonContainingText("Derive Sample"));

selectOptionByText(Locator.name("targetSampleTypeId"), SAMPLE_TYPE_NAME + " in /" + PROJECT_NAME);
clickButtonContainingText("Next");

// TODO: Should validate that the Derive Samples action shows the various fields as expected. That is the required and missing value fields should have the correct input type. Will be fixed in 19.2.
setFormElement(Locator.tagWithName("input", "Output Sample 1_Name"), sampleNames[8]);
setFormElement(Locator.tagWithName("input", "Output Sample 1_" + REQUIRED_FIELD_NAME), "Required text for this field.");
setFormElement(Locator.tagWithName("input", "Output Sample 1_" + MISSING_FIELD_NAME), "Q");
clickButtonContainingText("Submit");
Map<String, Object> derivedSample = Map.of(
"Name", sampleNames[8],
REQUIRED_FIELD_NAME, "Required text for this field.",
MISSING_FIELD_NAME, "Q",
"MaterialInputs/" + SAMPLE_TYPE_NAME, String.join(",", Arrays.copyOf(sampleNames, 8)));
new QueryApiHelper(createDefaultConnection(), PROJECT_NAME, "samples", SAMPLE_TYPE_NAME)
.insertRows(List.of(derivedSample));

// TODO: There is a bug where derived values do not honor missing value fields (treat them as a text field). So the indicator field for this sample will be empty. Will be fixed in 19.2.
expectedValuesInDB.add(Map.of("Name", sampleNames[8], REQUIRED_FIELD_NAME, "Required text for this field.", MISSING_FIELD_NAME, "Q", INDICATOR_FIELD_NAME, ""));

// Wait for the header to show up, and view this as success.
waitForElementToBeVisible(Locator.tagWithText("h3", "Sample DerivedSample01"));

goToProjectHome();

log("Export folder. Sample Types export should be selected by default.");
Expand Down
Loading