test-reporter icon indicating copy to clipboard operation
test-reporter copied to clipboard

dorny/test-reporter fails with error `Error: TypeError: stackTrace.split is not a function` when there is test failure.

Open Anudeep33 opened this issue 1 year ago • 7 comments

dorny/test-reporter fails with error when there is test failure.

Error: TypeError: stackTrace.split is not a function below is junit.xml file

64 | await this.page.locator(this.offlineSummarySelector).waitFor(); | ^ 65 | await this.page.locator(this.onlineSummarySelector).waitFor(); 66 | await expect(this.onlineSummary).toHaveText("Online"); 67 | await expect(this.offlineSummary).toHaveText("Offline"); at OverviewPage.verifyOverviewPageElements (/qa-automation/test/frontend/login/login.test.ts:41:34 attachment #1: screenshot (image/png) ---------------------------------------------------------- test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome/test-failed-1.png ------------------------------------------------------------------------------------------------ Retry #1 --------------------------------------------------------------------------------------- locator.waitFor: Timeout 30000ms exceeded. =========================== logs =========================== waiting for selector "[data-testid="summary-Offline"]" to be visible ============================================================ at ../page/OverviewPage.ts:64 62 | 63 | async verifyOverviewPageElements() { > 64 | await this.page.locator(this.offlineSummarySelector).waitFor(); | ^ 65 | await this.page.locator(this.onlineSummarySelector).waitFor(); 66 | await expect(this.onlineSummary).toHaveText("Online"); 67 | await expect(this.offlineSummary).toHaveText("Offline"); at OverviewPage.verifyOverviewPageElements (/qa-automation/test/frontend/login/login.test.ts:41:34 attachment #1: trace (application/zip) --------------------------------------------------------- test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome-retry1/trace.zip Usage: npx playwright show-trace test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome-retry1/trace.zip ------------------------------------------------------------------------------------------------ attachment #2: screenshot (image/png) ---------------------------------------------------------- test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome-retry1/test-failed-1.png ------------------------------------------------------------------------------------------------ ]]> [[ATTACHMENT|../test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome-retry1/trace.zip]]

[[ATTACHMENT|../test-results/frontend-login-login--login-RTA-83-Verify-user-is-able-to-log-in-with-an-admin-account-sanity-mobile-Chrome-retry1/test-failed-1.png]] ]]>

Anudeep33 avatar Mar 24 '23 19:03 Anudeep33

its playwright report with junit format . pls check this https://playwright.dev/docs/test-reporters

Anudeep33 avatar Mar 24 '23 19:03 Anudeep33

Seeing the same with cypress junit reports Edit: have seen the same in the past with pytest suites

ArcadeMode avatar Apr 12 '23 13:04 ArcadeMode

Try your luck by changing the reporter format to java-junit:

  - name: visualise-test-reports
    if: always()
    uses: dorny/test-reporter@v1
    with:
      name: Test Reports
      path: /tests/*.xml
      reporter: java-junit

Karamann avatar May 05 '23 13:05 Karamann

Hello,

I've seen the fix in v1.7.0 release (PR #258), so I tried using dorny/[email protected] in my github action :

      - name: e2e test report
        uses: dorny/[email protected]
        if: always()
        with:
          name: e2e tests
          path: e2e-junit.xml
          reporter: jest-junit

But I experiment the the same error :

Creating test report e2e tests
  Processing test results for check run e2e tests
  Error: Processing test results from e2e-junit.xml failed
Error: TypeError: stackTrace.split is not a function

Is there another case that causes the error ?

Here is my jest_junit file (generated with vitest) :

junit.xml.tar.gz

Thanks for your help

agjini avatar Nov 16 '23 15:11 agjini

Ran into this with Vitest results, using java-junit fixes it.

jlukic avatar Feb 14 '24 20:02 jlukic

Ran into this with Vitest results, using java-junit fixes it.

Same here.

kureey avatar May 15 '24 13:05 kureey