Skip to content

[UX] Screenshots attached in After Hooks are buried too deep (requires multiple clicks) #1396

@nirtal85

Description

@nirtal85

🧩 Improve visibility of failure screenshots in Allure Playwright reports

Problem Statement

When using allure-playwright, screenshots taken on test failure (either automatically or via custom hooks) are often attached under After Hooks.

In the Allure HTML report, this results in a poor user experience: the most important debugging artifact — the failure screenshot — is deeply nested and hard to discover.

To view a failure screenshot, I currently need to:

  1. Expand After Hooks
  2. Expand the specific hook (e.g. screenshot-on-failure)
  3. Expand attachments
  4. Click the screenshot

This process must be repeated for every failed test, which becomes very time-consuming when reviewing large test suites in CI.


Why this matters

Screenshots are typically the first artifact users look for when diagnosing failed UI tests.

Burying them several levels deep significantly slows down failure triage and reduces the usability of the report, especially in large Playwright test suites.


Current Structure (Example)

Test Body
 └─ After Hooks
    └─ Fixture "attachArtifacts"
       └─ Attach test artifacts
          └─ screenshot

Proposed Improvements

Option A — Bubble up screenshots

Automatically surface attachments with names like "Screenshot", "Failure Screenshot", or MIME type image/* at the top level of the test result view, regardless of whether they were attached in hooks or steps.

Option B — Dedicated screenshots section

Introduce a “Screenshots” gallery / preview section at the top of the test details pane that aggregates all screenshots attached anywhere in the test lifecycle (steps, hooks, fixtures).

This would make screenshots immediately visible without changing existing attachment behavior.


Alternatives Considered

Attaching screenshots directly to the test body

Not always feasible when screenshots are created in shared fixtures or global hooks.

Manually duplicating or renaming attachments

Adds boilerplate and still does not solve discoverability at scale.


Additional Context

This is a UX improvement rather than a functional change, but it would significantly improve failure analysis workflows for teams running large Playwright test suites in CI.

Example of current screenshot nesting in Allure report

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions