Skip to content

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

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

snevesbarros merged 1 commit into
mainfrom
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:

anglesReporter.fail('Order confirmation', 'Order confirmed', 'Payment declined', '');
await anglesReporter.attachDataToLastStep(await page.content(), 'page.html'); // this step
await anglesReporter.attachFileToLastStep('/path/to/failure.png');
await anglesReporter.attachFile('/path/to/trace.zip');                         // the whole test
await anglesReporter.attachData(consoleLines.join('\n'), 'console.log');
await anglesReporter.saveTest();
  • Methods: attachFile(filePath, fileName?) and attachData(data, fileName) attach to the whole test. attachFileToLastStep and attachDataToLastStep attach to the most recent step.
  • Timing: the id is added once the upload finishes, so callers await the attach before saveTest(). The test and step are captured when the call is made, so a slow upload still lands on the right test.
  • Batch mode: works too, because the upload only needs the build id.
  • Requests and models:
    • AttachmentRequests.uploadTestAttachment / uploadTestAttachmentData call POST /build/:buildId/attachment (Node only, unlimited body size).
    • getAttachments accepts executionId and buildId.
    • New TestAttachment model (exported), and attachments on CreateExecution and Execution.
  • README: new Attachments section.

Depends on

AnglesHQ/angles#133 (the API).

Release

The commit message includes minor_bump, so the release workflow publishes this as a minor version (3.2.0) rather than a patch. Remove it from the merge commit if you'd prefer a patch release.

Testing

  • npm run build passes. npm run lint reports the same 20 errors as main (all pre-existing max-classes-per-file), so this PR adds none.
  • Ran the built client against a running instance with the new API. Eight checks, all passing:
    • each extension maps to the right kind
    • no server paths in the response
    • three execution-level ids and two step-level ids end up on the saved test
    • all five are linked server-side
    • a batched test claims its HAR file
    • an .exe is rejected with a 400
    • attaching to a step without one throws
  • Note: npm ci fails on main as well, because package-lock.json pins ts-node 10.4.0 while package.json asks for ^10.9.2. This PR leaves that alone.

🤖 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(filePath, fileName?) and attachData(data, fileName) for the
  whole test (video, trace, HAR, console log)
- attachFileToLastStep / attachDataToLastStep for the most recent step
  (e.g. page.content() as page.html right after a fail())

The id is added to the test or step once the upload finishes, so callers
await the attach before saveTest(). It works in batch mode too, because the
upload only needs the build id.

Also adds AttachmentRequests.uploadTestAttachment / uploadTestAttachmentData
(POST /build/:buildId/attachment), executionId and buildId filters on
getAttachments, a TestAttachment model, and `attachments` on CreateExecution
and Execution. Needs an Angles server with test attachment support
(AnglesHQ/angles, same branch name).

minor_bump

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KgQXSUjuLVXmLWxobnMfSf
@snevesbarros
snevesbarros merged commit 2566295 into main 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