gurock / trcli

TR CLI (trcli) is a command line tool for interacting with TestRail.
Mozilla Public License 2.0
48 stars 39 forks source link

Trying Playwright x Testrail Sample got Error #169

Closed ImBIOS closed 8 months ago

ImBIOS commented 8 months ago

TestRail CLI Version

1.6.1

CLI Environment

No response

TestRail Version

TestRail v8.0.1 Default (1033)

TestRail Instance Type

NA

Current behavior

Parsing JUnit report.
Processed 7 test cases in 2 sections.
Checking project. Done.
Traceback (most recent call last):
  File "/opt/homebrew/bin/trcli", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/trcli/cli.py", line 239, in main
    return super().main(windows_expand_args=False, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/trcli/commands/results_parser_helpers.py", line 101, in wrapper_common_options
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/trcli/commands/cmd_parse_junit.py", line 36, in cli
    result_uploader.upload_results()
  File "/opt/homebrew/lib/python3.11/site-packages/trcli/api/results_uploader.py", line 67, in upload_results
    missing_test_cases, error_message = self.api_request_handler.check_missing_test_cases_ids(
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/lib/python3.11/site-packages/trcli/api/api_request_handler.py", line 297, in check_missing_test_cases_ids
    aut_case_id = case["custom_automation_id"]
                  ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'custom_automation_id'

Desired behavior

Parsed and uploaded successfully.

More Details

command:

trcli -y -c "trcli-config.yml" parse_junit -f "test-results/junit-report.xml" 

envinfo:


  System:
    OS: macOS 14.0
    CPU: (8) arm64 Apple M2
    Memory: 161.28 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.8.0 - ~/.proto/bin/node
    npm: 10.1.0 - ~/.proto/bin/npm
    pnpm: 8.7.6 - ~/.proto/bin/pnpm
  Languages:
    Bash: 3.2.57 - /bin/bash
    Go: 1.21.0 - /usr/local/go/bin/go
    Java: 17.0.8.1 - /usr/bin/javac
    Perl: 5.30.3 - /usr/bin/perl
    PHP: 8.2.11 - /Users/ImBIOS/Library/Application Support/Herd/bin/php
    Protoc: 3.21.9 - /usr/local/bin/protoc
    Python: 3.11.6 - /opt/homebrew/opt/python@3.11/libexec/bin/python
    Python3: 3.11.6 - /opt/homebrew/bin/python3
    Ruby: 2.6.10 - /usr/bin/ruby
    Rust: 1.73.0 - /Users/ImBIOS/.cargo/bin/rustc
  npmPackages:
    @playwright/test: 1.36.2 => 1.36.2 
bitcoder commented 8 months ago
  1. Can you please share the JUnit XMl report?
  2. Have you tagged the Playwright tests with test case ids, or not really?
  3. have you created the custom field "automation_id" as detailed on https://github.com/gurock/trcli#1-using-automation-id-code-first-approach ?
bitcoder commented 8 months ago

Seems a duplicate of #144 . Can you please check that issue? I think you may be missing the automation_id configuration

bitcoder commented 8 months ago

@ImBIOS have you seen my previous comment? Does the provided info resolved your issue?

bitcoder commented 8 months ago

closing for lack of feedback