Skip to content

Issue 53306: Some LKS forms don't distinguish between fields properly #2521

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 23 commits into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
062901c
Issue 53306: Some LKS forms don't distinguish between fields differin…
labkey-jeckels Jun 27, 2025
9f3d181
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jun 27, 2025
0d906aa
Update expected field names
labkey-jeckels Jun 27, 2025
15153b8
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jun 27, 2025
680d396
Update input element names
labkey-jeckels Jun 28, 2025
4590fda
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jun 28, 2025
06aa62c
Fix build
labkey-jeckels Jun 28, 2025
b141a1d
Test fixes
labkey-jeckels Jun 28, 2025
9d08e26
Test fixes
labkey-jeckels Jun 28, 2025
a720c3a
Test fixes
labkey-jeckels Jun 29, 2025
ef1d0b5
Test fixes
labkey-jeckels Jul 2, 2025
e4c5884
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jul 2, 2025
d133285
Test fixes
labkey-jeckels Jul 7, 2025
cf61ec1
Test fixes
labkey-jeckels Jul 7, 2025
0c13db0
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jul 7, 2025
8a873ef
Test fixes
labkey-jeckels Jul 9, 2025
c86ea9a
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jul 9, 2025
8990ec8
Test fixes
labkey-jeckels Jul 10, 2025
7c22c8a
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jul 10, 2025
f5cc1cb
Test fixes
labkey-jeckels Jul 10, 2025
5ba4582
Update names
labkey-jeckels Jul 14, 2025
8bf93d2
More constants for field names
labkey-jeckels Jul 14, 2025
84564ab
Merge branch 'develop' into fb_53306_propertyName
labkey-jeckels Jul 14, 2025
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
2 changes: 1 addition & 1 deletion src/org/labkey/test/params/FieldDefinition.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public FieldDefinition withNewName(String newName)
* Define a String field
* @param name field name
*/
public FieldDefinition(String name)
public FieldDefinition(@NotNull String name)
{
this(name, ColumnType.String);
}
Expand Down
28 changes: 20 additions & 8 deletions src/org/labkey/test/tests/SampleTypeLineageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.labkey.test.params.FieldDefinition.DOMAIN_TRICKY_CHARACTERS;
import static org.labkey.test.util.exp.SampleTypeAPIHelper.SAMPLE_TYPE_DOMAIN_KIND;

@Category({Daily.class})
Expand Down Expand Up @@ -1116,31 +1117,37 @@ public void testDeleteSampleSources() throws CommandException, IOException
@Test
public void testDeleteSamplesSomeWithDerivedSamples()
{
final String SAMPLE_TYPE_NAME = "DeleteSamplesWithParents";
final String SAMPLE_TYPE_NAME = "DeleteSamplesWithParents" + DOMAIN_TRICKY_CHARACTERS;
List<String> parentSampleNames = Arrays.asList("P-1", "P-2", "P-3");
List<Map<String, String>> sampleData = new ArrayList<>();
parentSampleNames.forEach(name -> {
sampleData.add(Map.of("Name", name));
});
parentSampleNames.forEach(name -> sampleData.add(Map.of("Name", name)));

clickProject(PROJECT_NAME);
SampleTypeHelper sampleHelper = new SampleTypeHelper(this);
log("Create a sample type with some potential parents");
sampleHelper.createSampleType(new SampleTypeDefinition(SAMPLE_TYPE_NAME), sampleData);
sampleHelper.createSampleType(new SampleTypeDefinition(SAMPLE_TYPE_NAME).
addField(new FieldDefinition("Blood+")).
addField(new FieldDefinition("Blood-")),
sampleData);
DataRegionTable drtSamples = sampleHelper.getSamplesDataRegionTable();
log("Derive one sample from another");
drtSamples.checkCheckbox(drtSamples.getIndexWhereDataAppears(parentSampleNames.get(0), "Name"));
clickButton("Derive Samples");
waitAndClickAndWait(Locator.lkButton("Next"));
String childName = parentSampleNames.get(0) + ".1";
setFormElement(Locator.name("outputSample1_Name"), childName);
String nameFieldInputFieldName = "Output Sample 1_Name";
String bloodPlusFieldInputFieldName = "Output Sample 1_Blood+";
String bloodMinusFieldInputFieldName = "Output Sample 1_Blood-";
setFormElement(Locator.name(nameFieldInputFieldName), childName);
setFormElement(Locator.name(bloodPlusFieldInputFieldName), "blood plus");
setFormElement(Locator.name(bloodMinusFieldInputFieldName), "blood minus");
clickButton("Submit");

log("Derive a sample from the one just created");
clickAndWait(Locator.linkContainingText("derive samples from this sample"));
clickButton("Next");
String grandchildName = childName + ".1";
setFormElement(Locator.name("outputSample1_Name"), grandchildName);
setFormElement(Locator.name(nameFieldInputFieldName), grandchildName);
clickButton("Submit");

log("Derive a sample with two parents");
Expand All @@ -1150,11 +1157,16 @@ public void testDeleteSamplesSomeWithDerivedSamples()
clickButton("Derive Samples");
waitAndClickAndWait(Locator.lkButton("Next"));
String twoParentChildName = parentSampleNames.get(1) + "+" + childName + ".1";
setFormElement(Locator.name("outputSample1_Name"), twoParentChildName);
setFormElement(Locator.name(nameFieldInputFieldName), twoParentChildName);
clickButton("Submit");

clickAndWait(Locator.linkContainingText(SAMPLE_TYPE_NAME));

// Issue 53306 - ensure that names differing only by special characters were captured correctly and are being
// shown in the grid
assertTextPresent("blood plus", "blood minus");


log("Try to delete parent sample");
drtSamples.checkCheckbox(drtSamples.getIndexWhereDataAppears(parentSampleNames.get(0), "Name"));
drtSamples.clickHeaderButton("Delete");
Expand Down