Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CTRF Summary Formatting Issues #35

Open
simontao18 opened this issue Sep 20, 2024 · 5 comments
Open

CTRF Summary Formatting Issues #35

simontao18 opened this issue Sep 20, 2024 · 5 comments
Assignees

Comments

@simontao18
Copy link

simontao18 commented Sep 20, 2024

Hi team,

I'm running into the issue where for failed tests, there is a long stretch of empty lines before the actual table is printed. I'm not using any custom formatter, and this is just the default output from running npx github-actions-ctrf failed test_results.json

In addition, as shown in the screenshot, the table seems to be longer in width than the actual space, which means I would need to scroll to the right to see the full message. Is there a way to format the summary boxes such that they are not longer than the page width?

Thank you!

Screenshot 2024-09-20 at 2 42 22 PM
@Ma11hewThomas Ma11hewThomas self-assigned this Sep 30, 2024
@Ma11hewThomas
Copy link
Contributor

Hello @simontao18

I'm unable to recreate either issue.

image

Can you please share the raw markdown generated with sensitive data removed? You can see this by clicking the ellipses on the summary and selecting view raw markdown.

In the meantime, the custom method with handlebars template might prove useful for you.

@Ma11hewThomas
Copy link
Contributor

Thanks for sharing this @niklasschaeffer.

I noticed that the failure messages sometimes include line breaks, for example:

expect(received).toBeLessThanOrEqual(expected)

        Expected: <= 5
        Received: 7.042

I suspect this might not be rendering correctly with GitHub Markdown. Could you share the CTRF test object for one of these tests? This would help me understand the structure of the message property string, and it should be straightforward to fix from there.

You can test this by editing your message above to remove these line breaks. The markdown is rendered correctly.

Thanks

@niklasschaeffer
Copy link

niklasschaeffer commented Nov 20, 2024

@Ma11hewThomas

Sry had to delete the post before. There was just to much sensitive information in it.

I cant exactly give you the full report since this a company test but. Here is some of the offending code.

{
        "name": "Some failing function",
        "status": "failed",
        "duration": 33701,
        "start": 1731924317,
        "stop": 1731924351,
        "message": "Expect window to have url\n\nExpected: StringContaining \"something\"\nReceived: \"url_here\"",
        "trace": "Error: Expect window to have url\n\nExpected: StringContaining \"something\"\nReceived: \"url_here\"\n    at ASDASDSAD.ASDASD (file:///)\n    at async ASDASDSAD.ASDASD (file:///)\n    at async Context.<anonymous> (file:///)",
        "rawStatus": "failed",
        "type": "e2e",
        "retries": 0,
        "flaky": false,
        "suite": "My Suite",
        "filePath": "",
        "browser": "chrome 128.0.6613.137"
      },
{
        "name": "Some Test Case",
        "status": "failed",
        "duration": 21172,
        "start": 1730279797,
        "stop": 1730279818,
        "message": "expect(received).toBeLessThanOrEqual(expected)\n\nExpected: <= 2\nReceived:    7.612",
        "trace": "Error: expect(received).toBeLessThanOrEqual(expected)\n\nExpected: <= 2\nReceived:    7.612\n    at asdf.asdf (file:///)\n    at async Context.<anonymous> (file:///)",
        "rawStatus": "failed",
        "type": "e2e",
        "retries": 0,
        "flaky": false,
        "suite": "My Suite",
        "filePath": "myfile",
        "browser": "chrome 128.0.6613.137"
      }

@Ma11hewThomas
Copy link
Contributor

Thanks @niklasschaeffer, please can you try v0.0.50

@niklasschaeffer
Copy link

niklasschaeffer commented Nov 20, 2024

@Ma11hewThomas
This fix seemed to fix the failed test table but not all the <br> before the actual table. Funny thing. The count of the <br> is not exactly equal to the failed tests which leads me to think that his is an actual issue with template variable or some sort of for/foreach structure.

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

No branches or pull requests

3 participants