Skip to content

feat(attachments): attach logs, HAR files, videos, traces and HTML to tests - #36

Merged
snevesbarros merged 1 commit into
masterfrom
claude/angles-dashboard-sdet-features-g34tzr
Oct 3, 2026
Merged

snevesbarros merged 1 commit into
masterfrom
claude/angles-dashboard-sdet-features-g34tzr

Conversation

@snevesbarros

Copy link
Copy Markdown
Contributor

Summary

Adds reporter methods that upload a file against the current build and attach it to the current test, or to its last step:

reporter.fail("Order confirmation", "Order confirmed", "Payment declined", "");
reporter.attachDataToLastStep(driver.getPageSource().getBytes(StandardCharsets.UTF_8), "page.html");
reporter.attachFileToLastStep(screenshotFile);
reporter.attachFile(new File("target/videos/checkout.webm"));
reporter.attachFile(new File("target/network.har"));
reporter.saveTest();
  • Interface: AnglesReporterInterface gains six methods:

    • attachFile(File) and attachFile(File, fileName)
    • attachData(byte[], fileName)
    • attachFileToLastStep(File) and attachFileToLastStep(File, fileName)
    • attachDataToLastStep(byte[], fileName)

    AnglesReporterEmpty implements them as no-ops.

  • Behaviour: uploads are synchronous and only need the build id, so they work in batch mode. A failed upload throws an Error, the same as storeScreenshot.

  • New classes: AttachmentRequests (POST /build/{buildId}/attachment, from a file or a byte array) and the TestAttachment model.

  • Model fields: attachments on CreateExecution, Execution and Step. Step.attachments is null until used, so Gson leaves it out of requests for steps without attachments.

  • README: new Attachments section.

Fix

BaseRequests.getDefaultErrorMessage threw a NullPointerException for any error body without a "message" field. Upload rejections answer {"error": ...}, as the existing manual-attachment upload already does. It also tried to read the response body a second time in its fallback. It now reads the body once and uses message, then error, then the raw text.

Depends on

AnglesHQ/angles#133 (the API).

Testing

  • mvn -DskipTests -Dgpg.skip=true install builds every module.
  • Ran a small program against a running instance with the new API:
    • the kinds come from the extension, and a custom file name is kept
    • a failing step gets the HTML and the image, and the test gets the video, HAR and log; all five are linked server-side
    • an .exe is rejected with the server's message (this is what found the getDefaultErrorMessage NPE)
    • attaching to a step without one throws

🤖 Generated with Claude Code

https://claude.ai/code/session_01KgQXSUjuLVXmLWxobnMfSf


Generated by Claude Code

… tests

Adds reporter methods that upload a file against the current build and add
it to the current test or to its last step:

- attachFile(File), attachFile(File, fileName) and attachData(byte[],
  fileName) for the whole test (video, trace, HAR, console log)
- attachFileToLastStep / attachDataToLastStep for the most recent step
  (e.g. driver.getPageSource() as page.html right after a fail())

Uploads are synchronous and only need the build id, so they work in batch
mode too. A failed upload throws an Error, the same as storeScreenshot.
AnglesReporterEmpty implements them as no-ops.

Also adds AttachmentRequests (POST /build/{buildId}/attachment), a
TestAttachment model, and `attachments` on CreateExecution, Execution and
Step. Needs an Angles server with test attachment support (AnglesHQ/angles,
same branch name).

Fixes BaseRequests.getDefaultErrorMessage, which threw a
NullPointerException for an error body without a "message" field (upload
rejections answer {"error": ...}) and tried to read the response body twice.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgQXSUjuLVXmLWxobnMfSf
@snevesbarros
snevesbarros merged commit 5f51352 into master Oct 3, 2026
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.

2 participants