Skip to content

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

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:

angles_reporter.fail_step("Order confirmation", "Order confirmed", "Payment declined", "")
angles_reporter.attach_data_to_last_step(page.content(), "page.html")   # this step
angles_reporter.attach_file_to_last_step("artifacts/failure.png")
angles_reporter.attach_file("artifacts/trace.zip")                      # the whole test
angles_reporter.attach_data("\n".join(console_lines), "console.log")
angles_reporter.save_test()
  • Methods: attach_file(file_path, file_name=None) and attach_data(data, file_name) attach to the whole test. attach_file_to_last_step and attach_data_to_last_step attach to the most recent step. data may be bytes or str.
  • Behaviour: uploads only need the build id, so they work in batch mode. A rejected upload raises AnglesApiError. Calling these without a started test, or *_to_last_step without a step, raises RuntimeError before anything is uploaded.
  • AttachmentRequests (exported) covers upload from a path or from in-memory content, listing by execution or build, file download and delete. Uploads use a 300 s timeout instead of the 10 s JSON default, because videos and traces can be large.
  • Model fields: attachments on CreateExecution, Execution and Step (default None, so they're left out of the JSON when unused).
  • README: new Attachments section.

Depends on

AnglesHQ/angles#133 (the API).

Release

release-on-main.yml publishes the current version on merge and then bumps the patch. If you want this released as a minor version, bump pyproject.toml first.

Testing

  • New tests/test_reporter_attachments.py (6 tests) covers:

    • execution- and step-level ids
    • serialisation of the ids with the execution
    • batch mode
    • the guards for no test and no step

    pytest: 21 passed (15 existing plus 6 new).

  • Ran the client against a running instance with the new API:

    • every kind comes from the extension
    • three execution-level ids and two step-level ids end up on the saved test, and all five are linked server-side
    • a downloaded file matches what was uploaded
    • an .exe is rejected with a 400 AnglesApiError

🤖 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:

- attach_file(file_path, file_name=None) and attach_data(data, file_name)
  for the whole test (video, trace, HAR, console log)
- attach_file_to_last_step / attach_data_to_last_step for the most recent
  step (e.g. page.content() as page.html right after fail_step())

Uploads only need the build id, so they work in batch mode too. A rejected
upload raises AnglesApiError.

Also adds AttachmentRequests (POST /build/{buildId}/attachment, listing by
execution or build, file download and delete) with a longer timeout for
uploads, and `attachments` on CreateExecution, Execution and Step. Needs an
Angles server with test attachment support (AnglesHQ/angles, same branch
name).

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