Skip to content

feat(ui5-test-writer): Generate tests for Form and Table content of Object Page Sections#4593

Open
sap-sebelao wants to merge 5 commits intomainfrom
feat/ui5-test-writer/gen-op-section-content
Open

feat(ui5-test-writer): Generate tests for Form and Table content of Object Page Sections#4593
sap-sebelao wants to merge 5 commits intomainfrom
feat/ui5-test-writer/gen-op-section-content

Conversation

@sap-sebelao
Copy link
Copy Markdown
Member

@sap-sebelao sap-sebelao commented Apr 23, 2026

  • generate checks for form fields in op sections
  • genereate checks for table columns in op sections
  • new tableUtils file for shared table-related stuff valid for both LR and OP

Internal issue
36742

…Object Page Sections

- generate checks for form fields in op sections
- genereate checks for table columns in op sections
- new tableUtils file for shared table-related stuff valid for both LR and OP
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

🦋 Changeset detected

Latest commit: e9b81e3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@sap-ux/ui5-test-writer Patch
@sap-ux/fiori-elements-writer Patch
@sap-ux/fiori-freestyle-writer Patch
@sap-ux/fiori-app-sub-generator Patch
@sap-ux/repo-app-import-sub-generator Patch
@sap-ux/generator-simple-fe Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@hyperspace-insights
Copy link
Copy Markdown
Contributor

Summary

The following content is AI-generated and provides a summary of the pull request:


ui5-test-writer: Generate Tests for Form and Table Content in Object Page Sections

New Feature

✨ Extended the @sap-ux/ui5-test-writer package to automatically generate OPA5 test assertions for Form fields (iCheckField) and Table columns (iCheckColumns) within Object Page body sections and sub-sections. This applies both to sections with sub-sections and to flat sections without them.

Changes

  • types.ts: Added SectionFormField type, and extended BodySubSectionFeatureData and BodySectionFeatureData with fields, tableColumns, and navigationProperty fields.

  • utils/tableUtils.ts (new): Introduced a shared utility module with getColumnIdentifier, transformTableColumns, and extractTableColumnsFromNode functions — usable for both List Report and Object Page table column extraction.

  • utils/modelUtils.ts: Removed inline getColumnIdentifier, transformTableColumns, and getTableColumns functions, replacing them with calls to the new shared extractTableColumnsFromNode from tableUtils.ts.

  • utils/objectPageUtils.ts: Added extractFormFields to pull form field properties from body sections/sub-sections, and getNavigationPropertyFromKey to derive the OData navigation property from spec model section keys (e.g., _Booking::@annotation_Booking). Both fields and tableColumns are now populated for each section and sub-section (empty for custom sections).

  • templates/v4/integration/ObjectPageJourney.js: Updated the EJS template to emit iCheckField calls for each form field and iCheckColumns calls for table columns, for both sub-sections and flat sections.

  • test/test-input/constants.ts: Enhanced the V4_WITH_SUB_OBJECT_PAGE test fixture to include form field aggregations (for BookingData sub-section) and table column aggregations (for AdministrativeData sub-section).

  • test/unit/fiori-elements.test.ts: Added integration test assertions verifying iCheckField and iCheckColumns are generated for the booking object page journey.

  • test/unit/utils/modelUtils.test.ts: Removed getTableColumns tests (logic moved to tableUtils).

  • test/unit/utils/tableUtils.test.ts (new): Added unit tests covering getColumnIdentifier, transformTableColumns, and extractTableColumnsFromNode.

  • test/unit/utils/objectPageUtils.test.ts: Added extensive unit tests for form field extraction, table column extraction, navigation property parsing, and custom section exclusion logic.

  • .changeset/breezy-candies-go.md: Added patch changeset entry for @sap-ux/ui5-test-writer.


  • 🔄 Regenerate and Update Summary
  • ✏️ Insert as PR Description (deletes this comment)
  • 🗑️ Delete comment
PR Bot Information

Version: 1.20.23

  • Summary Prompt: Default Prompt
  • Output Template: Default Template
  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Correlation ID: 3d22c69f-2e54-4cdf-9352-52d157ac58ac
  • Event Trigger: pull_request.opened

Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR introduces useful new functionality for generating OPA5 test assertions for form fields and table columns in Object Page sections, with good test coverage. However, there are two notable correctness issues: (1) the template uses subSection.navigationProperty || subSection.id as a fallback for onTable({ property: ... }), which produces an invalid OData navigation path for standard sub-sections and causes a related integration test assertion to validate incorrect output; and (2) extractFormFields and extractTableColumnsFromNode are each called on the wrong section type (form extractor runs on table sections and vice versa), wasting effort and potentially producing unexpected results. Additionally, the missing columns aggregation path in tableUtils.ts lacks an early-return guard that would make the code more defensive and consistent with the existing table-missing guard.

PR Bot Information

Version: 1.20.23

  • LLM: anthropic--claude-4.6-sonnet
  • File Content Strategy: Full file content
  • Correlation ID: 3d22c69f-2e54-4cdf-9352-52d157ac58ac
  • Event Trigger: pull_request.opened
  • Agent Instructions:

Comment thread packages/ui5-test-writer/templates/v4/integration/ObjectPageJourney.js Outdated
Comment thread packages/ui5-test-writer/test/unit/fiori-elements.test.ts Outdated
Comment thread packages/ui5-test-writer/src/utils/objectPageUtils.ts Outdated
Comment thread packages/ui5-test-writer/src/utils/objectPageUtils.ts Outdated
Comment thread packages/ui5-test-writer/src/utils/tableUtils.ts Outdated
@sap-sebelao sap-sebelao changed the title (feat) ui5-test-writer: Generate tests for Form and Table content of Object Page Sections feat(ui5-test-writer): Generate tests for Form and Table content of Object Page Sections Apr 23, 2026
@sap-sebelao sap-sebelao requested a review from docirl April 23, 2026 07:45
@sonarqubecloud
Copy link
Copy Markdown

@sap-sebelao sap-sebelao requested review from a team April 23, 2026 11:23
Sign up for free to 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.

1 participant