Skip to content

[Feature]: a reporter hook between onTestEnd and onEnd #37498

@pk-adesso

Description

@pk-adesso

🚀 Feature Request

I was trying to extend the error report information of the result, like which expect check failed and stacktrace is shown. But there is now way to do this.

I would love to add some information after the title of the error 1) [Desktop Chrome] › webtests/t...., it is fine if I could just add something additional to the report

I am talking about this:


    Error: expect(locator).toBeVisible() failed

    Locator:  getByTestId('item-123').getByTestId('remove-link')
    Expected: visible
    Received: <element(s) not found>
    Timeout:  5000ms

    Call log:
      - Expect "toBeVisible" with timeout 5000ms
      - waiting for getByTestId('item-123').getByTestId('remove-link')


       at ../steps/my-page.ts:388

      386 |   await test.step(`Expect remove link for item code ${itemCode} to be visible`, async () => {
      387 |     const removeLink = itemRemoveLink(myPage(page), itemCode)
    > 388 |     await test.expect(removeLink).toBeVisible({ timeout: 5000, visible })
          |                                   ^
      389 |   })
      390 | }
      391 |
        at /projects/best-project/webtests/steps/my-page.ts:388:35
        at expectCouponRemoveLinkToBeVisible (/projects/best-project/webtests/steps/my-page.ts:386:14)
        at /projects/best-project/webtests/tests/coupon-handling.spec.ts:72:50

    attachment #1: screenshot (image/png) ──────────────────────────────────────────────────────────
    webtests/test-results/check-items-remove-a-item-code-Desktop-Chrome/test-failed-1.png
    ────────────────────────────────────────────────────────────────────────────────────────────────

Example

No response

Motivation

More and better reports

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions