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

Proposal: Add support for attachments #49

Open
bryanbcook opened this issue Feb 26, 2024 · 0 comments · Fixed by #66
Open

Proposal: Add support for attachments #49

bryanbcook opened this issue Feb 26, 2024 · 0 comments · Fixed by #66

Comments

@bryanbcook
Copy link
Contributor

bryanbcook commented Feb 26, 2024

Proposal, add testcase.attachment:

{
  "suites": [
     {
        "cases": [
             {
                "name": "",
                "status": "",
                "meta_data": {
                },
                "attachments": [
                   {
                      "name": "optional",
                      "path": "required - file name that the user provided",
                   }
                ]
             }
        ]
     }
   ]
}

Note that not all frameworks have built in support for including attachments as part of the result.

  • Cucumber (🟨):

    It's unclear if cucumber supports this natively. The cucumber-json-converter project is supposedly a parser to represent the schema for various cucumber json outputs, but it doesn't explictly reference embeddings which is referenced elsewhere, eg XRay.

    "steps": [
           {
             "embeddings": [
               {
                   "mime_type": "text/plain",
                   "data": "{data base64}"
               },
               {
                   "mime_type": "text/plain",
                   "data": "{data base64}"
               }
           ...

    Note that the data appears to be embedded as base64. This makes the data easily transportable, but could lead towards larger files and a huger memory footprint for processing.

    The cucumber/common project refers to cucumber/messages which appears to be a successor to the JSON output format. We should consider adding a separate proposal to support cucumber message output.

  • JUnit (🟨):

    The JUnit schema does not have defined attributes for attachments. There are implementations out there that read the test output for a specific string [[ATTACHMENT]/path/to/file]]

  • MSTest (✅):

    Supported through TestContext.AddResultFile (link).

    According to the xsd (c:\program files\Microsoft Visual Studio\<version>\Xml\Schemas\vstst.xd), the files should appear under /TestRun/TestResults/*/ResultFiles

  • NUnit (✅):

    Supported through TestContext.AddTestAttachment (link).

    Appears in the xml as <attachments> (link) under <testsuite> or <testcase>.

  • xUnit (🟥):

    No native support in xUnit to capture attachments per test.

This was referenced Feb 27, 2024
@ASaiAnudeep ASaiAnudeep linked a pull request May 25, 2024 that will close this issue
@ASaiAnudeep ASaiAnudeep reopened this May 25, 2024
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 a pull request may close this issue.

2 participants