Skip to content

feat(ui5-test-writer): Skip object page section marked with UI.Hidden - #5012

Open
sap-sebelao wants to merge 9 commits into
mainfrom
feat/ui5-test-writer/ui-hidden-for-sections
Open

feat(ui5-test-writer): Skip object page section marked with UI.Hidden#5012
sap-sebelao wants to merge 9 commits into
mainfrom
feat/ui5-test-writer/ui-hidden-for-sections

Conversation

@sap-sebelao

Copy link
Copy Markdown
Member

Internal issue
36742
Internal JIRA
FXUBRQ34-12674

@changeset-bot

changeset-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: eb03fb0

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 Minor
@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-pr-bot

Copy link
Copy Markdown
Contributor

Summary

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


Description

This change adds support for skipping Object Page sections (header sections, body sections, and sub-sections) that are annotated with UI.Hidden when generating OPA5 tests via @sap-ux/ui5-test-writer.

Previously, hidden sections were still included in the generated test journey files, which could lead to flaky or incorrect tests trying to interact with sections not visible in the UI.

Key changes:

  • modelUtils.ts: Extends the SectionItem interface with an optional properties field exposing hidden and hideByProperty annotation values. Also passes includeAnnotationProperties: true to readApp() so the specification model exposes these annotation properties.
  • objectPageUtils.ts: Introduces a new isSectionHidden() helper that returns true if a section has hidden.value === true or a non-empty hideByProperty.value (dynamic hide expression). This check is applied in all three extraction functions: header sections, body sections, and sub-sections.
  • Tests (fiori-elements.test.ts, objectPageUtils.test.ts): New unit and integration tests verify that:
    • Sections with hidden: { value: true } are excluded from the generated output.
    • Sections with hideByProperty (dynamic expression) are also excluded.
    • Visible sections are still correctly included and the section count reflects the filtered result.

Type of change

  • New feature (non-breaking change which adds a new feature)
  • Bug (non-breaking change which fixes an issue)
  • Breaking change (Bug or New feature that would cause existing functionality/consumers to not work as expected)
  • Non-Breaking chores (Changes to tools, libraries, build process, documentation, etc)
  • None of the above (Reviewers might ask for more clarification)

How have you tested?

  • Unit tests added for isSectionHidden logic covering hidden.value: true, hidden.value: false, and hideByProperty cases for header sections, body sections, and sub-sections.
  • Integration test added to fiori-elements.test.ts simulating a section marked UI.Hidden and asserting it is excluded from the generated journey file while visible sections remain.

Checklist:

  • The code conforms to the general development principles
  • Supplied as many details as possible on this change
  • The code is easy to read and maintainable by others
  • Corresponding changes to the documentation has been done
  • Already existing and new unit tests pass locally

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

Version: 1.29.14

  • Output Template: Repository PR Template
  • Event Trigger: pull_request.ready_for_review
  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 11502e50-8f02-11f1-9b1a-05e6976fa552
  • Summary Prompt: Default Prompt
  • File Content Strategy: Full file content

@hyperspace-pr-bot hyperspace-pr-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The PR introduces a well-scoped feature with good test coverage across unit and integration levels. Two issues were flagged: the includeAnnotationProperties parameter is smuggled into ReadAppParams via an intersection type without any upstream type declaration, which may silently fail at runtime if readApp ignores unknown fields; and the hideByProperty truthiness check is inconsistent with the accompanying comment that says "treat any value as hidden" — a false boolean value would not be treated as hidden despite the annotation's presence indicating conditional hiding.

PR Bot Information

Version: 1.29.14

  • Experiment Variant: control
  • Event Trigger: pull_request.ready_for_review
  • LLM: anthropic--claude-4.6-sonnet
  • Correlation ID: 11502e50-8f02-11f1-9b1a-05e6976fa552
  • Agent Instructions:
  • File Content Strategy: Full file content

Comment thread packages/ui5-test-writer/src/utils/modelUtils.ts
Comment thread packages/ui5-test-writer/src/utils/objectPageUtils.ts Outdated

@heimwege heimwege left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

see comments

Comment thread packages/ui5-test-writer/src/utils/modelUtils.ts
Comment thread packages/ui5-test-writer/src/utils/objectPageUtils.ts Outdated
Comment thread packages/ui5-test-writer/test/unit/fiori-elements.test.ts
@sonarqubecloud

sonarqubecloud Bot commented Aug 7, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui5-test-writer @sap-ux/ui5-test-writer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants