Skip to content

Update test helpers to understand field keys and names - #2450

Merged
labkey-tchad merged 46 commits into
developfrom
fb_trickyCharsPhase3
May 28, 2025
Merged

Update test helpers to understand field keys and names#2450
labkey-tchad merged 46 commits into
developfrom
fb_trickyCharsPhase3

Conversation

@labkey-tchad

Copy link
Copy Markdown
Member

Rationale

https://github.com/LabKey/kanban/issues/689

Field labels are an inconsistent way to define and reference data. We should encourage and enable tests to use field keys and field names instead.

This update allows data Maps to be keyed differently when extracted from various grid components for test validation. In addition to the existing label-keyed maps, there are now methods to key data by FieldKey or by name (unencoded FieldKey).

When looking for specific columns, the grid components will accept encoded or unencoded field keys in addition to labels. This allows the many existing tests that use field labels to continue to do so while allowing new tests to be more precise.

Some components that already found columns by encoded FieldKey (bulk update forms and details tables) have been updated to find FieldKey objects or Strings. Strings are assumed to be field names which the component will encode. This allows tests to not have to bother with fieldKey encoding except when absolutely necessary (e.g. parent or source lookups). Note: I would like to implement a similar change to the grids but that can wait

Related Pull Requests

Changes

  • Update Grid components to understand field keys and names
  • Update FieldKey to extend CharSequence
  • Update "Add Source" and "Add Parent" menu helpers to synchronize editable grid
  • Unify CSV/TSV generation between TestDataGenerator and TestDataUtils

Comment threadsrc/org/labkey/test/components/ui/entities/EntityBulkInsertDialog.java Outdated
Comment threadsrc/org/labkey/test/components/ui/entities/EntityInsertPanel.java Outdated
Comment threadsrc/org/labkey/test/components/ui/grids/DetailTableEdit.java Outdated
Comment threadsrc/org/labkey/test/components/ui/grids/DetailTableEdit.java
Comment threadsrc/org/labkey/test/components/ui/grids/EditableGrid.java Outdated
Comment threadsrc/org/labkey/test/components/ui/grids/ResponsiveGrid.java Outdated
Comment threadsrc/org/labkey/test/components/ui/grids/ResponsiveGrid.java Outdated
Comment threadsrc/org/labkey/test/params/FieldKey.java
@cnathe
cnathe removed their request for review May 28, 2025 12:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@labkey-tchad@labkey-susanh@labkey-danield