Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -397,12 +397,14 @@ public void testAllowedFileExtensionsInSampleType()
log("Create a sample that tries to upload a disallowed file type.");
String sampleId = String.format("S-%d", i);
String description= "Some text for the description.";
String amount = "5.0";
String amount = "5.1";
String units = "mg";

fieldMap = Map.of("Name", sampleId,
"Description", description,
stFileField, fileMap.get(excludedType).getAbsolutePath(),
"StoredAmount", amount);
"StoredAmount", amount,
"Units", units);
sampleTypeHelper.insertRow(fieldMap);

validateErrorPage(fileMap.get(excludedType).getName(), allowedTypes);
Expand All @@ -413,7 +415,8 @@ public void testAllowedFileExtensionsInSampleType()
sampleTypeHelper.goToSampleType(stName);
fieldMap = Map.of("Name", sampleId,
"Description", description,
"StoredAmount", amount);
"StoredAmount", amount,
"Units", units);
sampleTypeHelper.insertRow(fieldMap);

Map<String, String> rowMap = sampleTypeHelper.getSamplesDataRegionTable().getRowDataAsMap(0);
Expand All @@ -424,6 +427,9 @@ public void testAllowedFileExtensionsInSampleType()
checker().verifyEquals("'Amount' field in grid does not have expected value.",
amount, rowMap.get("StoredAmount"));

checker().verifyEquals("'Units' field in grid does not have expected value.",
units, rowMap.get("Units"));

checker().verifyEquals(String.format("'%s' field in grid does not have expected value.", stFileField),
" ", rowMap.get(stFileField));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void testLookupByIntColumn()
sampleTypeList.clickInsertNewRow();

String comment = "inserted with lookup by ingredient.intcolumn";
setFieldValues("intSample", comment, "3.5", "2");
setFieldValues("intSample", comment, "3.5", "mL", "2");

sampleTypeList = DataRegionTable.DataRegion(getDriver()).withName("Material").waitFor();
var row = sampleTypeList.getRowDataAsMap("Comment", comment);
Expand All @@ -111,7 +111,7 @@ public void testLookupByTextColumn()
sampleTypeList.clickInsertNewRow();

String comment = "inserted with lookup by ingredient.titleColumn";
setFieldValues("nameSample", comment, "3.5", "sodium hexafluoride");
setFieldValues("nameSample", comment, "3.5", "mL", "sodium hexafluoride");

sampleTypeList = DataRegionTable.DataRegion(getDriver()).withName("Material").waitFor();
var row = sampleTypeList.getRowDataAsMap("Comment", comment);
Expand All @@ -129,13 +129,14 @@ public void testLookupByTextColumn()

}

private void setFieldValues(String name, String comment, String amount, String ingredient)
private void setFieldValues(String name, String comment, String amount, String units, String ingredient)
{
var insertPage = new UpdateQueryRowPage(getDriver());
if (name != null) // for update, name field is disabled
insertPage.setField("Name", name);
insertPage.setField("comment", comment);
insertPage.setField("StoredAmount", amount);
insertPage.setField("Units", units);
insertPage.setField("ingredient", ingredient);
insertPage.submit();
}
Expand Down