Skip to content

feat: added testcase metadata to report - #5743

Merged
pekkaklarck merged 2 commits into
robotframework:masterfrom
imbus:feature/test-metadata-in-report
Aug 26, 2026
Merged

pekkaklarck merged 2 commits into
robotframework:masterfrom
imbus:feature/test-metadata-in-report

Conversation

@febb0e

@febb0e febb0e commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

This pull request enhances the HTML report by adding support for showing test case metadata in the details table. The changes help that metadata is shown only when present, and that sorting and column toogles work correctly with the new metadata column. Test automation and validation scripts are also updated.

Rebot HTML report improvements:

  • Added a new "Metadata" column to the test details table, which is displayed only if at least one test case contains metadata.
  • Updated JavaScript logic in report.html to detect the presence of metadata, render the column, and adjust table sorting.
  • Added CSS rules for the new .details-col-metadata class to ensure proper column width and alignment.

Test and validation updates:

  • Fixed a typo in test keywords and extended validation to check for metadata in all relevant HTML outputs, including those generated by Rebot.

Copilot AI lite review requested due to automatic review settings August 13, 2026 12:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request updates Rebot’s HTML report so that test case metadata can be displayed in the test details table when present, while keeping column toggling and table sorting consistent regardless of whether the new column is rendered.

Changes:

  • Added conditional rendering of a new “Metadata” column in the test details table (shown only when at least one test has metadata).
  • Updated report JavaScript to detect metadata presence and to adjust tablesorter column indices accordingly.
  • Updated acceptance tests to validate metadata presence in Robot and Rebot generated HTML outputs, and fixed a keyword typo.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/robot/htmldata/rebot/report.html Adds metadata detection, conditional column rendering, and sorting/index adjustments for the test details table.
src/robot/htmldata/rebot/report.css Adds styling for the new .details-col-metadata column.
atest/robot/parsing/test_metadata.robot Fixes “metadate” typo and extends coverage to Rebot-generated log/report HTML outputs.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@febb0e febb0e mentioned this pull request Aug 13, 2026
@pekkaklarck

Copy link
Copy Markdown
Member

Are you sure hiding the column if no test has metadata is worth the extra complexity? I believe it would be better to always show it because:

  • We also show other colums regardless are they empty not. We could decide to change that, but then we should do that with all columns as part of a separate issue.
  • We already have a mechanism for persistently collapsing columns.
  • I'm slightly worried about the performance impact of going through all tests before rendering the table.
  • We are planning to do larger log and report redesign in the future. We'll certainly revisit how all this info is shown then.

@pekkaklarck pekkaklarck mentioned this pull request Aug 18, 2026
Copilot AI review requested due to automatic review settings August 21, 2026 06:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@febb0e

febb0e commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

Hey @pekkaklarck, I totally agree, the conditional rendering is not worth it. Reverted that in this commit:

  • The Metadata column is now always shown, exactly like Documentation and Tags. Empty metadata renders an empty cell.
  • Dropped the anyTestHasMetadata() pre-render scan, so your performance concern is gone: drawTestDetailsTable(), renderTestDetailsHeader(), renderTestDetails() and renderTestDetailsRows() are now identical to master again.
  • The column uses the existing persistent collapse mechanism so it can be hidden if it's in the way.

While checking this I noticed the existing HTML assertions don't actually verify anything about the column — the details table is rendered client-side, so report.html only contains embedded data, and File Should Contain <Metadata> passes without existing metadata, so I made the report tests check the templates.

@pekkaklarck pekkaklarck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me! I need to test this locally to see that everything works, but I believe there are no issues and merge this and test later.

@pekkaklarck
pekkaklarck merged commit 612956b into robotframework:master Aug 26, 2026
8 checks passed
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.

3 participants