Skip to content

feat(report): copy failure details button on failed tests - #230

Merged
shossain786 merged 1 commit into
masterfrom
feat/216-copy-failure-details
Nov 1, 2026
Merged

shossain786 merged 1 commit into
masterfrom
feat/216-copy-failure-details

Conversation

@shossain786

Copy link
Copy Markdown
Contributor

Closes #216

What & why

Adds a Copy failure details button to the expanded detail row of failed tests (Test Cases and Failures tabs). It copies the test id, error message and stack trace to the clipboard and shows "Copied" for 1.5s.

  • Only rendered for FAILED tests that have an error message or stack trace.
  • Uses navigator.clipboard when available, otherwise falls back to a hidden textarea + execCommand('copy'), so it works from file://.
  • Reads text from the existing .error-msg / .stack-trace nodes, so the report doesn't grow; the test id is HTML-escaped in a data attribute.

Verification

  • New HtmlReportGeneratorTest.copyFailureButton_onlyOnFailedTestsWithErrorDetail fails without the change and passes with it.
  • Full mvn test: 870 tests, 0 failures.
  • Generated a report and clicked the button in headless Chrome: both the clipboard-API path and the fallback copied Test: …\nError: …\n\n<stack trace>, and the label reverted after "Copied". Not checked: dark theme visually, a matrix run, or a real clipboard paste.

Type of change

  • New feature (opt-in, report only)

Checklist

  • Tests pass, new behaviour covered
  • No new dependencies
  • No changes to @SeleniumBootApi
  • CHANGELOG.md updated

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@shossain786
shossain786 merged commit ce2d65a into master Nov 1, 2026
2 checks passed
@shossain786
shossain786 deleted the feat/216-copy-failure-details branch November 1, 2026 02:14
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.

Report: "Copy failure details" button on failed tests

1 participant