GithubHelp home page GithubHelp logo

trcli's Introduction

Tests

trcli - The TestRail CLI

The TestRail CLI (trcli) is a command line tool for interacting with TestRail. It integrates directly with the TestRail API and provides abstractions to easily create test cases and upload automated test results.

The TestRail CLI currently supports:

  • Uploading automated test results from JUnit reports
  • Uploading automated test results from Robot Framework reports
  • Auto-generating test cases from OpenAPI specifications

To see further documentation about the TestRail CLI, please refer to the TestRail CLI documentation pages on the TestRail help center.

Installation

If you already have Python and pip installed, you can simply run the command below in your terminal. We recommend using Python 3.10 or newer.

pip install trcli

To verify the installation was successful, you can run the trcli command.

trcli

You should get something like this:

TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Supported and loaded modules:
    - parse_junit: JUnit XML Files (& Similar)
    - parse_robot: Robot Framework XML Files
    - parse_openapi: OpenAPI YML Files

CLI general reference

$ trcli --help
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Usage: trcli [OPTIONS] COMMAND [ARGS]...

  TestRail CLI

Options:
  -c, --config       Optional path definition for testrail-credentials file or
                     CF file.
  -h, --host         Hostname of instance.
  --project          Name of project the Test Run should be created under.
  --project-id       Project id. Will be only used in case project name will
                     be duplicated in TestRail  [x>=1]
  -u, --username     Username.
  -p, --password     Password.
  -k, --key          API key.
  -v, --verbose      Output all API calls and their results.
  --verify           Verify the data was added correctly.
  --insecure         Allow insecure requests.
  -b, --batch-size   Configurable batch size.  [default: (50); x>=2]
  -t, --timeout      Batch timeout duration.  [default: (30); x>=0]
  -y, --yes          answer 'yes' to all prompts around auto-creation
  -n, --no           answer 'no' to all prompts around auto-creation
  -s, --silent       Silence stdout
  --help             Show this message and exit.

Commands:
  parse_junit    Parse JUnit report and upload results to TestRail
  parse_openapi  Parse OpenAPI spec and create cases in TestRail
  parse_robot    Parse Robot Framework report and upload results to TestRail

Uploading automated test results

The parse_junit command allows you to upload automated test results, provided that you are using a framework that supports generating JUnit XML report files, such as Cypress, Playwright, JUnit5, TestNG, and Pytest. In case you are using Robot Framework, you can use the parse_robot command using the same parameters.

In the next sections you will find information on how to use the TestRail CLI for code-first and specification-first approaches to test automation.

Reference

trcli parse_junit --help
Usage: trcli parse_junit [OPTIONS]

  Parse report files and upload results to TestRail

Options:
  -f, --file          Filename and path.
  --close-run         Close the newly created run
  --title             Title of Test Run to be created in TestRail.
  --case-matcher      Mechanism to match cases between the report and
                      TestRail.
  --suite-id          Suite ID to submit results to.  [x>=1]
  --suite-name        Suite name to submit results to.
  --run-id            Run ID for the results they are reporting (otherwise the
                      tool will attempt to create a new run).  [x>=1]
  --plan-id           Plan ID with which the Test Run will be associated.
                      [x>=1]
  --config-ids        Comma-separated configuration IDs to use along with Test
                      Plans (i.e.: 34,52).
  --milestone-id      Milestone ID to which the Test Run should be associated
                      to.  [x>=1]
  --section-id        Section ID to create new sections with test cases under
                      (optional).  [x>=1]
  --run-description   Summary text to be added to the test run.
  --case-fields       List of case fields and values for new test cases
                      creation. Usage: --case-fields type_id:1 --case-fields
                      priority_id:3
  --result-fields     List of result fields and values for test results
                      creation. Usage: --result-fields custom_field_a:value1
                      --result-fields custom_field_b:3
  --allow-ms          Allows using milliseconds for elapsed times.
  --special-parser    Optional special parser option for specialized JUnit
                      reports.
  --help              Show this message and exit.

JUnit XML report example

<testsuites name="test suites root">
  <testsuite failures="0" errors="0" skipped="1" tests="1" time="3049" name="tests.LoginTests">
    <properties>
      <property name="setting1" value="True"/>
      <property name="setting2" value="value2"/>
    </properties>
    <testcase classname="tests.LoginTests" name="test_case_1" time="159">
      <skipped type="pytest.skip" message="Please skip">skipped by user</skipped>
    </testcase>
    <testcase classname="tests.LoginTests" name="test_case_2" time="650">
    </testcase>
    <testcase classname="tests.LoginTests" name="test_case_3" time="121">
      <failure type="pytest.failure" message="Fail due to...">failed due to...</failure>
      <properties>
        <property name="testrail_attachment" value="path_to/screenshot.jpg"/>
      </properties>
    </testcase>
  </testsuite>
</testsuites>

Mapping JUnit elements to TestRail entities:

XML junit file tag TestRail entity
<testsuites> suite
<testsuite> section
<testcase> case

For further detail, please refer to the JUnit to TestRail mapping documentation.

Uploading test results

To submit test case results, the TestRail CLI will attempt to match the test cases in your automation suite to test cases in TestRail. There are 2 mechanisms to match test cases:

  1. Using Automation ID
  2. Using Case ID (in test case name or property)

The first mechanism allows to automatically match test cases, meaning you can take a code-first approach, while the second one is suited for a specification-first approach, where you write your test cases in TestRail and add the case ID to your automated tests.

Notes:

  1. The TestRail CLI has a prompt mechanism that allows you to choose whether you want test cases to be automatically created:
  • If you enter yes (or use the -y option), the TestRail CLI will automatically create any test case it can't match in TestRail
  • If you enter no (or use the -n option), the TestRail CLI will not create any new test cases
  1. If you are using a multi-suite project in TestRail, you should provide the ID of the test suite you want the cases to be created in using the --suite-id command line option, otherwise the CLI tool will attempt to find the suite on TestRail or create it.

1. Using Automation ID (code-first approach)

To use this mechanism, you must first add a new custom field of type Text with system name automation_id.

The TestRail CLI will use the unique combination of your automation test case’s classname and name (expressed as classname.name) to compare against values of the automation_id field in your TestRail test case repository. If a match is found, this test case will be included in the auto-generated test run for this upload.

Example:

Test Result from Automation Results File Automation ID in TestRail
<testcase classname="tests.LoginTests" name="test_case_1" time="159"></testcase> tests.LoginTests.test_case_1

Important usage notes:

  1. If you would like to upload automation results for test cases that already exist in TestRail, be sure to update the automation_id for those test cases before uploading your automation results
  2. If you change the test name in your automation suite later, that will create a new test case in TestRail, unless you also update the automation_id field for the test case in TestRail
  3. If you are using the CLI tool in a CI context, we recommend using the -y option to automatically accept test case creation prompts

For more detail, please refer to the Automation workflows - Code-first documentation.

2. Using Case ID (specification-first approach)

You can use the Case ID mechanism if you want to manually match your automated test cases to case IDs in TestRail. From an implementation perspective, you can do this in one of two ways:

  1. Map by setting the case ID in the test name, using the case-matcher name:
<testsuites name="test suites root">
  <testsuite failures="0" errors="0" skipped="1" tests="1" time="3049" name="tests.LoginTests">
    <testcase classname="tests.LoginTests" name="[C123] test_case_1" time="650" />
  </testsuite>
</testsuites>
  1. Map by setting the case ID in a test case property, using case-matcher property:
<testsuites name="test suites root">
  <testsuite failures="0" errors="0" skipped="1" tests="1" time="3049" name="tests.LoginTests">
    <testcase classname="tests.LoginTests" name="test_case_1" time="650">
     <properties>
         <property name="test_id" value="C123"/>
     </properties>
    </testcase>
  </testsuite>
</testsuites>

Important usage notes:

  • We recommend using the -n option to skip creating new test cases due to the potential risk of duplication

For more details, please refer to the Automation workflows - Specification-first documentation.

Exploring other features

General features

Please refer to the Usage examples documentation page to see how you can leverage all the functionalities provided by the TestRail CLI.

SauceLabs saucectl reports

If you are using saucectl from SauceLabs to execute your automation projects, the TestRail CLI has an enhanced parser that fetches session information and adds it to your test runs. You can enable this functionality by using the --special-parser saucectl command line option.

Please refer to the SauceLabs and saucectl reports documentation for further information.

Generating test cases from OpenAPI specs

The parse_openapi command allows you to automatically generate and upload test cases to TestRail based on an OpenAPI specification. This feature is intended to be used once to quickly bootstrap your test case design, providing you with a solid base of test cases, which you can further expand on TestRail.

Reference

$ trcli parse_openapi --help
TestRail CLI v1.9.0
Copyright 2024 Gurock Software GmbH - www.gurock.com
Usage: trcli parse_openapi [OPTIONS]

  Parse OpenAPI spec and create cases in TestRail

Options:
  -f, --file      Filename and path.
  --suite-id      Suite ID to create the tests in (if project is multi-suite).
                  [x>=1]
  --case-fields   List of case fields and values for new test cases creation.
                  Usage: --case-fields type_id:1 --case-fields priority_id:3
  --help          Show this message and exit.

OpenAPI specification example

openapi: 3.0.0
info:
  description: This is a sample API.
  version: 1.0.0
  title: My API
paths:
  /pet:
    post:
      summary: Add a new pet to the store
      description: Add new pet to the store inventory.
      operationId: addPet
      responses:
        '200':
          description: Pet created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
        '400':
          description: Invalid request
      requestBody:
        $ref: '#/components/schemas/Pet'
  '/pet/{petId}':
    get:
      summary: Find pet by ID
      description: Returns a single pet
      operationId: getPetById
      parameters:
        - name: petId
          in: path
          description: ID of pet to return
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Successful operation
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Pet'
        '400':
          description: Invalid request
        '404':
          description: Pet not found
components:
  schemas:
    Pet:
      type: object
      required:
        - name
      properties:
        id:
          type: integer
          format: int64
          readOnly: true
        name:
          description: The name given to a pet
          type: string
          example: Guru

Generating test cases

The test cases are generated based on the OpenAPI specification paths, operation verbs and possible response status codes, which provides a good basic test coverage for an API, although we recommend you further expand your test cases to cover specific business logic and workflows.

Pattern Test case title example
VERB /path -> status_code (summary) GET /pet/{petId} -> 200 (Successful operation)

Parameter sources

You can choose to set parameters from different sources, like a default config file, environment variables, custom config file, cli parameters or in some cases use default values. The priority of setting parameters from different sources is as per the table below, where 1 is the highest priority.

priority source
1 cli parameters
2 custom config file
3 environment variables
4 default config file
5 default value

For more details, please refer to the Parameter sources documentation.

Return values and messaging

trcli tool will return 0 to the console in case of success and value greater than 1 (usually 1 or 2) in other cases. Messages that are being printed on the console are being redirected to sys.stdout or sys.stderr.

Multithreading

trcli allows users to upload test cases and results using multithreading. This is enabled by default and set to MAX_WORKERS_ADD_CASE = 5 and MAX_WORKERS_ADD_RESULTS = 10 in trcli/settings.py. To disable multithreading, set those to 1.

During performance tests we discovered that using more than 10 workers didn't improve time of upload and could cause errors. Please set it accordingly to your machine specs. Average time for uploading:

  • 2000 test cases was around 460 seconds
  • 5000 test cases was around 1000 seconds

Contributing

Interested in contributing and helping improve the TestRail CLI client? Please start by looking into CONTRIBUTING.md and creating an issue.

License

The TestRail CLI client is licensed under the Mozilla Public License 2.0.

trcli's People

Contributors

11chri avatar bitcoder avatar brentahughes avatar chrisdavi avatar d-rede avatar germandz avatar jpita avatar konradzuwala avatar lchoj avatar maksimkravchuk avatar mattkiazyk avatar mrudni avatar robwar avatar testinator-x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

trcli's Issues

Improve the formatting of the description of an imported file

Steps to reproduce:

  • Import the following report:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Functional Tests Suite" time="150.939" tests="2" failures="0" errors="0">
   <testsuite name="Functional Tests Suite" tests="2" failures="0" errors="0" time="150.939" skipped="0" timestamp="2022-05-18 14:57:42" hostname="localhost - computername">
      <properties>
         <property name="deviceName" value=""/>
         <property name="devicePlatform" value=""/>
         <property name="logFolder" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737"/>
         <property name="logFiles" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737\\execution0.log"/>
         <property name="attachments" value=""/>
         <property name="hostName" value="localhost - computername"/>
         <property name="os" value="Windows 10 64bit"/>
         <property name="katalonVersion" value="8.3.5.208"/>
         <property name="browser" value="Chrome 101.0.4951.67"/>
         <property name="hostAddress" value="127.0.0.1"/>
         <property name="sessionId" value="b48814780035cdbfdcb820cc6131f166"/>
         <property name="seleniumVersion" value="3.141.59"/>
         <property name="proxyInformation" value="ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList=&quot;&quot;, isApplyToDesiredCapabilities=true }"/>
         <property name="platform" value="Windows 10"/>
      </properties>
      <testcase name="Test Cases/Add to Cart Test" time="73.239" classname="Test Cases/Add to Cart Test" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:57:43 - [TEST_CASE][PASSED] - Test Cases/Add to Cart Test: Test Cases/Add to Cart Test

2022-05-18 14:57:43 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:57:43 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:57:43 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:57:54 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:57:54 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Home Page/a_Product 2")): Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Product Details Page/button_Add to cart")): Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout")): Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - verifyElementText(findTestObject("Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products"), "1 Product"): Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - delay(3): Delayed 3 second(s)

2022-05-18 14:58:55 - [MESSAGE][PASSED] - Delayed 3 second(s)

2022-05-18 14:58:55 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 14:58:56 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <testcase name="Test Cases/User Account Tests/Login Tests/Login Manual Mode" time="77.47" classname="Test Cases/User Account Tests/Login Tests/Login Manual Mode" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:58:56 - [TEST_CASE][PASSED] - Test Cases/User Account Tests/Login Tests/Login Manual Mode: Test Cases/User Account Tests/Login Tests/Login Manual Mode

2022-05-18 14:58:56 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:58:56 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:58:56 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - maximizeWindow(): Current window maximized

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Current window maximized

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [TEST_STEP][PASSED] - click(findTestObject("Home Page/button_Sign in")): Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [TEST_STEP][PASSED] - setText(findTestObject("User Account Pages/Login Page/Login Section/input_Email address"), "[email protected]"): Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [MESSAGE][PASSED] - Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [TEST_STEP][PASSED] - setEncryptedText(findTestObject("User Account Pages/Login Page/Login Section/input_Password"), "2yzypAZhesWDBbg9RlLtEQ=="): Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [MESSAGE][PASSED] - Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [TEST_STEP][PASSED] - click(findTestObject("User Account Pages/Login Page/Login Section/button_Sign in")): Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [MESSAGE][PASSED] - Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [TEST_STEP][PASSED] - verifyElementVisible(findTestObject("User Account Pages/My Account Page/h1_My account")): Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <system-out><![CDATA[2022-05-18 14:57:42 - [TEST_SUITE][PASSED] - Functional Tests Suite: Test Cases/User Account Tests/Login Tests/Login Manual Mode]]></system-out>
      <system-err><![CDATA[]]></system-err>
   </testsuite>
</testsuites>

Actual Result

  • The imported result is not user readable
  • image

Expected Result

  • The result should be formatted in a more user readable way, eg. as List.

suite_id value not set on delete when upload fails

TestRail CLI Version

1.3.1

CLI Environment

No response

TestRail Version

7.5.6 Default (3001)

TestRail Instance Type

Professional Cloud

Current behavior

suite_id seems to lose the initial value when test results fail to upload for some reason, so request sent with /api/v2/delete_cases/-1 , which fails with {'error': 'Field :suite_id is not a valid test suite.'}

`****
Adding test cases: 6/148
Adding test cases: 6/148
Your upload to TestRail did not receive a successful response from your TestRail Instance. Please check your settings and try again.

**** API Call
method: POST
url: https://xx.testrail.io/index.php?/api/v2/delete_cases/-1
payload: {'case_ids': [6622, 6627, 6624, 6671, 6626, 6623, 6625]}
response status code: 400
response body: {'error': 'Field :suite_id is not a valid test suite.'}


Unable to delete created test cases: Field :suite_id is not a valid test suite.
===== Upload nebula/.github/scripts/step-upload-results-testrail/client-api.sh to TestRail Step Failed ====`

Desired behavior

suite_id value properly set

More Details

No response

Field :section_id is not a valid ID - Question

Hi, I'm having issue when trying to upload test results from XML to testRail.

The below is the command I used
trcli -y -c "trcli-config.yml" parse_junit -f "reports/junit-report.xml"

and this is the config file.

host: https://XXXX.testrail.io/
project: SMOKE TEST
username: [email protected]
password: XXXX
title: Cypress Automated Test
file: reports/junit-report.xml
suite_id: 170
auto_creation_response: true

The below is what I've got, and I have no idea what's section id and why it's a problem because it was working well before. Does anyone have any idea? I would appreciate it if anyone could help me.

trcli -y -c "trcli-config.yml" parse_junit -f "reports/junit-report.xml"
Checking project. Done.
Found test cases not matching any TestRail case (count: 1)
Adding missing test cases to the suite.
Adding test cases: 0/1
Error during add_case. Trying to cancel scheduled tasks.

Aborting: add_case. Trying to cancel scheduled tasks.
Adding test cases: 0/1
Field :section_id is not a valid ID.

Provide ability to publish results from multiple XML files

What would you like the TestRail CLI to be able to do?

It would be helpful if we're able to specify either a directory or multiple files for the -f flag instead of one single file.

Alternatively could there be a --run-name similar to --run-id, which we can use if we don't know the run ID. This would allows us to run multiple scripts and upload the results to the same test run as we'd be able to specify the run name as we don't know the run ID that the cli creates.

Ultimately, it's just providing the ability to uploading result from multiple XML files to the same run id which will be created by the cli.

Why is this feature necessary on the TestRail CLI?

We sometimes split our test runs in our pipeline which generates multiple XML files. Currently we're unable to create 1 test run which contains the results as the cli doesn't accept multiple result files.

In your article here - https://www.gurock.com/testrail/introducing-the-testrail-cli/ it suggests running the script multiple times which we can do, but if we create a run id on the first execution we don't know the run id for the second execution. The cli fails if you use the same name.

More details

No response

Interested in implementing it yourself?

No

Need support for adding multiple testrail case IDs in single test

What would you like the TestRail CLI to be able to do?

Can we add multiple case IDs in single test like below?
title= test_case_1 [C123 C456 C789]

We usually combine multiple cases in 1 automation test in order to reduce test execution time. And a capability of adding multiple case IDs in single test and updating all those test scenarios in testrail when this 1 test passes, will be a great advantage I believe.

Why is this feature necessary on the TestRail CLI?

We usually combine multiple cases in 1 automation test in order to reduce test execution time. And a capability of adding multiple case IDs in single test and updating all those test scenarios in testrail when this 1 test passes, will be a great advantage I believe.

More details

No response

Interested in implementing it yourself?

No

TestRail CLI can check only first 250 projects

TestRail CLI Version

1.3.1

CLI Environment

Windows 10 Pro

TestRail Version

7.5.6 Default (3001)

TestRail Instance Type

Professional Cloud

Current behavior

Now it's not possible to use trcli for projects created after 250.
TR CLI failed in project checking with message: "Checking project.
Please specify a valid project name using the --project argument"

Desired behavior

I would expect that TR CLI should work correctly with a TestRail instance with more than 250 projects

More Details

Perhaps the problem may be related to the GET request get_projects and default limit parameter that equals 250

Getting error "TypeError: 'type' object is not subscriptable" with trcli v1.3.1

Problem Statement
I'm running trcli on Linux agent and getting the error "TypeError: 'type' object is not subscriptable" even just try with command "trcli --version"

Python 3.6.8
14:20:20   pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)
14:20:21   WARNING: Running pip install with root privileges is generally not a good idea. Try `pip3 install --user` instead.
14:20:21   Collecting trcli
14:20:21     Downloading https://files.pythonhosted.org/packages/b7/51/b783b673acbd759fecb0c9ccc146dd4c01d54c4e87a6d1d55df85931e9ea/trcli-1.3.1-py3-none-any.whl
14:20:21   Collecting tqdm (from trcli)
14:20:21     Downloading https://files.pythonhosted.org/packages/47/bb/849011636c4da2e44f1253cd927cfb20ada4374d8b3a4e425416e84900cc/tqdm-4.64.1-py2.py3-none-any.whl (78kB)
14:20:21   Collecting click (from trcli)
14:20:21     Downloading https://files.pythonhosted.org/packages/4a/a8/0b2ced25639fb20cc1c9784de90a8c25f9504a7f18cd8b5397bd61696d7d/click-8.0.4-py3-none-any.whl (97kB)
14:20:21   Requirement already satisfied: pyyaml in /usr/lib64/python3.6/site-packages (from trcli)
14:20:22   Collecting humanfriendly (from trcli)
14:20:22     Downloading https://files.pythonhosted.org/packages/f0/0f/310fb31e39e2d734ccaa2c0fb981ee41f7bd5056ce9bc29b2248bd569169/humanfriendly-10.0-py2.py3-none-any.whl (86kB)
14:20:22   Collecting junitparser (from trcli)
14:20:22     Downloading https://files.pythonhosted.org/packages/7d/fc/d14dc065156780558af1fd306a883f552daf38031fc02c0b2822f3fecc6c/junitparser-2.8.0-py2.py3-none-any.whl
14:20:22   Requirement already satisfied: requests in /usr/local/lib/python3.6/site-packages (from trcli)
14:20:22   Collecting pyserde (from trcli)
14:20:22     Downloading https://files.pythonhosted.org/packages/ae/e2/feded00359535e3e7ee7cb9c26eed9c0469586c5e144d8088668935bf909/pyserde-0.7.0-py3-none-any.whl (69kB)
14:20:22   Requirement already satisfied: importlib-resources; python_version < "3.7" in /usr/local/lib/python3.6/site-packages (from tqdm->trcli)
14:20:22   Requirement already satisfied: importlib-metadata; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from click->trcli)
14:20:22   Collecting future (from junitparser->trcli)
14:20:22     Downloading https://files.pythonhosted.org/packages/45/0b/38b06fd9b92dc2b68d58b75f900e97884c45bedd2ff83203d933cf5851c9/future-0.18.2.tar.gz (829kB)
14:20:23   Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.6/site-packages (from requests->trcli)
14:20:23   Requirement already satisfied: charset-normalizer~=2.0.0; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->trcli)
14:20:23   Requirement already satisfied: idna<4,>=2.5; python_version >= "3" in /usr/local/lib/python3.6/site-packages (from requests->trcli)
14:20:23   Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.6/site-packages (from requests->trcli)
14:20:23   Collecting jinja2 (from pyserde->trcli)
14:20:23     Downloading https://files.pythonhosted.org/packages/20/9a/e5d9ec41927401e41aea8af6d16e78b5e612bca4699d417f646a9610a076/Jinja2-3.0.3-py3-none-any.whl (133kB)
14:20:23   Collecting stringcase (from pyserde->trcli)
14:20:23     Downloading https://files.pythonhosted.org/packages/f3/1f/1241aa3d66e8dc1612427b17885f5fcd9c9ee3079fc0d28e9a3aeeb36fa3/stringcase-1.2.0.tar.gz
14:20:24   Collecting dataclasses; python_version < "3.7" (from pyserde->trcli)
14:20:24     Downloading https://files.pythonhosted.org/packages/fe/ca/75fac5856ab5cfa51bbbcefa250182e50441074fdc3f803f6e76451fab43/dataclasses-0.8-py3-none-any.whl
14:20:24   Collecting typing_inspect>=0.4.0 (from pyserde->trcli)
14:20:24     Downloading https://files.pythonhosted.org/packages/be/01/59b743dca816c4b6ca891b9e0f84d20513cd61bdbbaa8615de8f5aab68c1/typing_inspect-0.8.0-py3-none-any.whl
14:20:24   Collecting backports-datetime-fromisoformat<2,>=1; python_version < "3.7" (from pyserde->trcli)
14:20:24     Downloading https://files.pythonhosted.org/packages/20/15/4bc39da78d00da480ff627398ad25770be1f0c3cf40ea9bc5e9030b441fb/backports-datetime-fromisoformat-1.0.0.tar.gz
14:20:25   Requirement already satisfied: zipp>=3.1.0; python_version < "3.10" in /usr/local/lib/python3.6/site-packages (from importlib-resources; python_version < "3.7"->tqdm->trcli)
14:20:25   Requirement already satisfied: typing-extensions>=3.6.4; python_version < "3.8" in /usr/local/lib/python3.6/site-packages (from importlib-metadata; python_version < "3.8"->click->trcli)
14:20:25   Collecting MarkupSafe>=2.0 (from jinja2->pyserde->trcli)
14:20:25     Downloading https://files.pythonhosted.org/packages/fc/d6/57f9a97e56447a1e340f8574836d3b636e2c14de304943836bd645fa9c7e/MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl
14:20:25   Collecting mypy-extensions>=0.3.0 (from typing_inspect>=0.4.0->pyserde->trcli)
14:20:25     Downloading https://files.pythonhosted.org/packages/5c/eb/975c7c080f3223a5cdaff09612f3a5221e4ba534f7039db34c35d95fa6a5/mypy_extensions-0.4.3-py2.py3-none-any.whl
14:20:25   Installing collected packages: tqdm, click, humanfriendly, future, junitparser, MarkupSafe, jinja2, stringcase, dataclasses, mypy-extensions, typing-inspect, backports-datetime-fromisoformat, pyserde, trcli
14:20:25     Running setup.py install for future: started
14:20:26       Running setup.py install for future: finished with status 'done'
14:20:26     Running setup.py install for stringcase: started
14:20:26       Running setup.py install for stringcase: finished with status 'done'
14:20:26     Running setup.py install for backports-datetime-fromisoformat: started
14:20:28       Running setup.py install for backports-datetime-fromisoformat: finished with status 'done'
14:20:28   Successfully installed MarkupSafe-2.0.1 backports-datetime-fromisoformat-1.0.0 click-8.0.4 dataclasses-0.8 future-0.18.2 humanfriendly-10.0 jinja2-3.0.3 junitparser-2.8.0 mypy-extensions-0.4.3 pyserde-0.7.0 stringcase-1.2.0 tqdm-4.64.1 trcli-1.3.1 typing-inspect-0.8.0
14:20:29   Traceback (most recent call last):
14:20:29     File "/usr/local/bin/trcli", line 11, in <module>
14:20:29       sys.exit(cli())
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1128, in __call__
14:20:29       return self.main(*args, **kwargs)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1052, in main
14:20:29       with self.make_context(prog_name, args, **extra) as ctx:
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 914, in make_context
14:20:29       self.parse_args(ctx, args)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1615, in parse_args
14:20:29       rest = super().parse_args(ctx, args)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1370, in parse_args
14:20:29       value, args = param.handle_parse_result(ctx, opts, args)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 2347, in handle_parse_result
14:20:29       value = self.process_value(ctx, value)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 2309, in process_value
14:20:29       value = self.callback(ctx, self, value)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1270, in show_help
14:20:29       echo(ctx.get_help(), color=ctx.color)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 693, in get_help
14:20:29       return self.command.get_help(self)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1295, in get_help
14:20:29       self.format_help(ctx, formatter)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1326, in format_help
14:20:29       self.format_options(ctx, formatter)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1524, in format_options
14:20:29       self.format_commands(ctx, formatter)
14:20:29     File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1588, in format_commands
14:20:29       cmd = self.get_command(ctx, subcommand)
14:20:29     File "/usr/local/lib/python3.6/site-packages/trcli/cli.py", line 210, in get_command
14:20:29       mod = __import__(f"trcli.commands.cmd_{name}", None, None, ["cli"])
14:20:29     File "/usr/local/lib/python3.6/site-packages/trcli/commands/cmd_parse_junit.py", line 6, in <module>
14:20:29       from trcli.api.results_uploader import ResultsUploader
14:20:29     File "/usr/local/lib/python3.6/site-packages/trcli/api/results_uploader.py", line 6, in <module>
14:20:29       from trcli.api.api_request_handler import ApiRequestHandler
14:20:29     File "/usr/local/lib/python3.6/site-packages/trcli/api/api_request_handler.py", line 27, in <module>
14:20:29       class ApiRequestHandler:
14:20:29     File "/usr/local/lib/python3.6/site-packages/trcli/api/api_request_handler.py", line 393, in ApiRequestHandler
14:20:29       def upload_attachments(self, report_results: [dict], results: list[dict], run_id: int):
14:20:29   TypeError: 'type' object is not subscriptable
14:20:29   Process exited with code 1

Note:

  • This issue does not happen with version 1.3.0 before
  • This issue does not happen when I run from my Mac local
  • It happens when I run from the Teamcity

Error when `automation_id` field is missing

TestRail CLI Version

1.2.0

CLI Environment

Mac M1, Python 3.10.5

TestRail Version

v7.5.4

TestRail Instance Type

NA

Current behavior

Precondition: No custom field automation_id in Testrail.

When I upload test results I got the following error:

Traceback (most recent call last):
  File "/opt/homebrew/bin/trcli", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/click/core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/opt/homebrew/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 46, in cli
    result_uploader.upload_results()
  File "/opt/homebrew/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 92, in upload_results
    added_test_cases, result_code = self.add_missing_test_cases(
  File "/opt/homebrew/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 288, in add_missing_test_cases
    ) = self.api_request_handler.check_missing_test_cases_ids(project_id)
  File "/opt/homebrew/lib/python3.10/site-packages/trcli/api/api_request_handler.py", line 295, in check_missing_test_cases_ids
    aut_case_id = case["custom_automation_id"]
KeyError: 'custom_automation_id'

Desired behavior

Expected a catched error (with user error message) instead of a Python error message.

More Details

No response

Automation ID field does not work if test case names are different with test case names in automation project

Problem statement

My issue is:

  1. Let's say I set up automation_id custom field for my project
  2. My junit xml like below
<testsuites name="test suites root">
  <testsuite failures="0" errors="0" skipped="1" tests="1" time="0.05" name="LoginTests">
    <properties><property name="setting1" value="True"/></properties>
    <testcase classname="LoginTests" name="test_case_1" time="159">
      <skipped type="pytest.skip" message="Please skip">skipped by user</skipped>
    </testcase>
    <testcase classname="LoginTests" name="test_case_2" time="650">
    </testcase>
  </testsuite>
</testsuites>
  1. In TesRail, my project will have section & test cases are structured as below
LoginTests
|
|____Test case 1 (has Automation ID = `LoginTests.test_case_1`)
|
|____Test case 2 (has Automation ID = `LoginTests.test_case_2`)
  1. Now when I run the Testrail CLI with right configure and I'm seeing
    • It can create a new Test Run, but there neither test case "Test case 1" nor "Test case 2" are added to the test run

My expectation:

  • It should add the existing test cases "Test case 1" and "Test case 2" to the test run because they have the "Automation ID" matched with combination "classname.name" of node in xml file

What I played around

  • If I rename my test cases in TestRail like "test_case_1" and "test_case_2" with the Automation ID are still like above
  • Re-run TestRail CLI, those existing test cases will be added to test run successfully

So my concern and question
Are we requiring both test case name and automation id in TestRail to be able to map the existing test cases to add to test run when running TestRail CLI?

My use case here is, I have a lot of test cases defined in TestRail that were set the names are not the same in automation test scripts. So we just tried to update the Automation IDs with the format we defined in TestRail CLI document and hopefully the tool can base on the automation ids to add to test result.

Originally posted by @tdnguyen84 in #70 (comment)

Overwrite the section-id that is provided within the import file

Steps to reproduce:

  • Import the following report:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Functional Tests Suite" time="150.939" tests="2" failures="0" errors="0">
   <testsuite name="Functional Tests Suite" tests="2" failures="0" errors="0" time="150.939" skipped="0" timestamp="2022-05-18 14:57:42" hostname="localhost - computername" id="Test Suites/Functional Tests Suite">
      <properties>
         <property name="deviceName" value=""/>
         <property name="devicePlatform" value=""/>
         <property name="logFolder" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737"/>
         <property name="logFiles" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737\\execution0.log"/>
         <property name="attachments" value=""/>
         <property name="hostName" value="localhost - computername"/>
         <property name="os" value="Windows 10 64bit"/>
         <property name="katalonVersion" value="8.3.5.208"/>
         <property name="browser" value="Chrome 101.0.4951.67"/>
         <property name="hostAddress" value="127.0.0.1"/>
         <property name="sessionId" value="b48814780035cdbfdcb820cc6131f166"/>
         <property name="seleniumVersion" value="3.141.59"/>
         <property name="proxyInformation" value="ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList=&quot;&quot;, isApplyToDesiredCapabilities=true }"/>
         <property name="platform" value="Windows 10"/>
      </properties>
      <testcase name="Test Cases/Add to Cart Test" time="73.239" classname="Test Cases/Add to Cart Test" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:57:43 - [TEST_CASE][PASSED] - Test Cases/Add to Cart Test: Test Cases/Add to Cart Test

2022-05-18 14:57:43 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:57:43 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:57:43 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:57:54 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:57:54 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Home Page/a_Product 2")): Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Product Details Page/button_Add to cart")): Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout")): Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - verifyElementText(findTestObject("Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products"), "1 Product"): Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - delay(3): Delayed 3 second(s)

2022-05-18 14:58:55 - [MESSAGE][PASSED] - Delayed 3 second(s)

2022-05-18 14:58:55 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 14:58:56 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <testcase name="Test Cases/User Account Tests/Login Tests/Login Manual Mode" time="77.47" classname="Test Cases/User Account Tests/Login Tests/Login Manual Mode" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:58:56 - [TEST_CASE][PASSED] - Test Cases/User Account Tests/Login Tests/Login Manual Mode: Test Cases/User Account Tests/Login Tests/Login Manual Mode

2022-05-18 14:58:56 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:58:56 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:58:56 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - maximizeWindow(): Current window maximized

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Current window maximized

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [TEST_STEP][PASSED] - click(findTestObject("Home Page/button_Sign in")): Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [TEST_STEP][PASSED] - setText(findTestObject("User Account Pages/Login Page/Login Section/input_Email address"), "[email protected]"): Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [MESSAGE][PASSED] - Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [TEST_STEP][PASSED] - setEncryptedText(findTestObject("User Account Pages/Login Page/Login Section/input_Password"), "2yzypAZhesWDBbg9RlLtEQ=="): Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [MESSAGE][PASSED] - Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [TEST_STEP][PASSED] - click(findTestObject("User Account Pages/Login Page/Login Section/button_Sign in")): Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [MESSAGE][PASSED] - Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [TEST_STEP][PASSED] - verifyElementVisible(findTestObject("User Account Pages/My Account Page/h1_My account")): Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <system-out><![CDATA[2022-05-18 14:57:42 - [TEST_SUITE][PASSED] - Functional Tests Suite: Test Cases/User Account Tests/Login Tests/Login Manual Mode]]></system-out>
      <system-err><![CDATA[]]></system-err>
   </testsuite>
</testsuites>

Actual Result

  • I got the error: ValueError: invalid literal for int() with base 10: 'Test Suites/Functional Tests Suite', even when I ran it with the commandline parameter --suite-id 14
  • After some try and error, I manually edited this report and completely removed the ID id="Test Suites/Functional Tests Suite" from the report file, afterwards the report could be processed

Expected Result

  • A command line parameter should overwrite the elements in the file.

CLI does not match automation_id with test cases's classname and name

Hello 👋

We're trying to match automation_id with case's classname and name, but it seems to not work correctly. Steps we taken trying to achieve this:

  • Created a new custom field of type String with system name automation_id.
  • Our test framework (Playwright) generated a Junit report xml file
  • We added an automation_id field in one of the cases we have described. It matches the pattern which get created from <testcase> classname and name, for example hello.world
  • We use the CLI to upload the file trcli -c testrail.config.yml parse_junit
Checking project. Done.
Adding missing sections to the suite.
Creating test run. Done.
Adding results: 0/0, Done.
Done.

Got:
it creates a new section with a name taken from <testsuite> name (in our case filename) and the section is empty. The test case, where the test result should be posted is empty as well.

Expected:
To post automated test results to test case with id hello.world

Uploading attachments to TestRail

What would you like the TestRail CLI to be able to do?

I want to be able to upload attachments like logs, screenshots, etc., to the TestRail test results.

Why is this feature necessary on the TestRail CLI?

Testrail CLI could be a good tool to gather all tests' results in one place, but when tests fail you need a reason, not only "failed" bage.

More details

We need to parse a new key from xUnit report. Something like attachments : ["path_to_attachment_1.json", "path_to_attachment_2.json"].
Then upload the files to test results.

Interested in implementing it yourself?

Maybe, let's talk!

Adding Testruns under a milestone using Trcli calls

What would you like the TestRail CLI to be able to do?

I would like to automatically add a test run under a specific exiting milestone on testrail or create a new milestone if it does not exisit

Why is this feature necessary on the TestRail CLI?

So that we do not have to do this manually by editing a test run.

More details

No response

Interested in implementing it yourself?

No

Field :type_id is not a valid case type.

TestRail CLI Version

1.4.2

CLI Environment

No response

TestRail Version

7.5.6

TestRail Instance Type

NA

Current behavior

When I upload this file to the trcli, the result fails when trying to add these new test cases to my suite. I've been able to get other files to work but it doesn't work with this specific file for some reason. It's interesting because the type_id field is actually a integer which seems to fit the requirements for the cli tool but something is strange is happing at the /add_case API call.

cypress.txt
image

Desired behavior

The file gets uploaded to testrail

More Details

No response

Test Cases less than .5 seconds do not upload time elapsed

TestRail CLI Version

1.30

CLI Environment

Python 3.10.6

TestRail Version

7.5.4

TestRail Instance Type

Professional Cloud

Current behavior

Automated tests tend to run in milliseconds however the current trcli implementation rounds the time to the nearest second and omits anything less than a second.

Desired behavior

If a test is less than a second the estimate should be provided in milliseconds.

More Details

I have confirmed testrail's system elapsed field supports ms time units.

Can we use just testcaseName or case id(from testrail) for matching testcases from automation suite?

I am using Playwright tool for automating my tests and it is generating xml file and classname will be the browser I am running my tests on.

Let's say there is one testcase in testrail for profile update and I will be running this test on multiple browsers so the xml file will have
testcase name=profile-update classname=chromium
testcase name=profile-update classname=firefox
testcase name=profile-update classname=webkit

So when testrail cli tries to match the testcase from testrail, it will create automation-id as profile-update.chromium for the first time and next time, testrail cli can't recognize the test which ran on firefox as same testcase as above since this time automation-id it will be searching for will be profile-update.firefox

Is there any way to overcome this issue?

  1. Is it possible to recognize automation-id if we mention in the title of test like below?
    Testrail testcase automation_id: 123
    testcase name=profile-update automation-id-123 classname=chromium

when trail cli tries to match testcase, if there is automation_id available in the testcaseName, then it will match.

  1. Is it possible to recognize testrail testcase with case id available in the testrail
    testcase name=profile-update C123 classname=chromium

Any possible solution to resolve this would be greatly appreciated. Thanks!

Correct small typo in the README

What would you like the TestRail CLI to be able to do?

Minor issue, but significant: in the README file in the section on "Uploading test results", the Example presented in table format shows an incorrect "Automation ID in TestRail" value.

The example entry from the Junit XML file is shown as:

testcase classname="tests.LoginTests" name="test_case_1"

...while the matching automation_id is shown as:

test.LoginTests.test_case_1

I believe the automation_id value is incorrect; it should be the following (note the extra "s" in "tests"):

tests.LoginTests.test_case_1

Why is this feature necessary on the TestRail CLI?

Small change, but it will make the README documentation more accurate.

More details

That's it - I propose to add a single "s" character in the README!

Interested in implementing it yourself?

Yes

Flag for Section parent ID to nest automated tests in to

What would you like the TestRail CLI to be able to do?

Been using the tool and there isn't a good way to organize the tests by means of the automation. It would be nice to specify a specific parent ID to target and nest test cases inside of.

Why is this feature necessary on the TestRail CLI?

It would allow customization of where the tests go when using automation of the trcli

More details

No response

Interested in implementing it yourself?

Maybe, let's talk!

Submit custom result fields values through junit testcase properties.

What would you like the TestRail CLI to be able to do?

In your support article Integrating with Pytest you are providing the following example to add an attachment to a test case with the record_property fixture. I would like to use the same record_property to submit values for custom result fields added through the admin dashboard. I've looked through the trcli source and I could not find a way to submit these values.

Why is this feature necessary on the TestRail CLI?

We should be able to submit values for custom result fields using trcli as these values are useful for filtering, sorting and generating reports.

More details

No response

Interested in implementing it yourself?

No

"AttributeError: 'TestRailCase' object has no attribute 'result_fields'" even when not using the optional parameter

TestRail CLI Version

1.4.0

CLI Environment

Windows 10 E 21H2 x64, Python 3.9.5

TestRail Version

TestRail v7.8.0 Default (1136)

TestRail Instance Type

Enterprise Cloud

Current behavior

TRCLI fails to generate or update TestCases with the error:
"AttributeError: 'TestRailCase' object has no attribute 'result_fields'" even when not using the optional parameter

This worked on previous version.

Command:
trcli -h "https://company.testrail.net/" -u "[email protected]" -p "api_key" --project "Project Name" --project-id 1 -y parse_junit --title "Pytest POC Suite" --run-description "Pytest POC Suite" -f "junit-report.xml" --case-fields custom_automation_type:3 --case-matcher "name"

CLI Output:

TestRail CLI v1.4.0
Copyright 2021 Gurock Software GmbH - www.gurock.com
Parse JUnit Execution Parameters
> Report file: junit-report.xml
> Config file: None
> TestRail instance: https://company.testrail.net (user: [email protected])
> Project: PROJECT NAME
> Run title: Pytest POC Suite
> Update run: No
> Add to milestone: No
> Auto-create entities: True
Parsing JUnit report.
Processing suite - None
Processed 5 test cases in 1 sections.
Checking project. Done.
Found 5 test cases without case ID in the report file.
Adding missing test cases to the suite.
Traceback (most recent call last):
  File "c:\users\username\appdata\local\programs\python\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\username\appdata\local\programs\python\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\username\AppData\Local\Programs\Python\Python39\Scripts\trcli.exe\__main__.py", line 7, in <module>
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\commands\cmd_parse_junit.py", line 92, in cli
    result_uploader.upload_results()
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\api\results_uploader.py", line 94, in upload_results
    added_test_cases, result_code = self.add_missing_test_cases()
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\api\results_uploader.py", line 287, in add_missing_test_cases
    added_cases, result_code = self.prompt_user_and_add_items(
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\api\results_uploader.py", line 311, in prompt_user_and_add_items
    added_items, error_message = add_function()
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\api\api_request_handler.py", line 341, in add_cases
    add_case_data = self.data_provider.add_cases()
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\data_providers\api_data_provider.py", line 40, in add_cases
    case.add_global_case_fields(self.case_fields)
  File "c:\users\username\appdata\local\programs\python\python39\lib\site-packages\trcli\data_classes\dataclass_testrail.py", line 150, in add_global_case_fields
    new_results_fields.update(self.result_fields)
AttributeError: 'TestRailCase' object has no attribute 'result_fields'

Desired behavior

Test Cases are updated or created in TestRail

More Details

No response

CASE ID is getting auto generated though we are providing an existing run id

TestRail CLI Version

1.4.2

CLI Environment

Windows 11, Python 3.10

TestRail Version

TestRail v7.5.6 Default (3001)

TestRail Instance Type

Professional Cloud

Current behavior

CASE ID is getting auto generated though we are providing an existing run id

command used:
trcli -y -h "https://.testrail.io/" -v -u "" -p "" --project "" parse_junit --case-matcher "property" --title "<SOME_TITLE>" --run-id 10 -f "output.xml"

Desired behavior

Expected not to generate any new case id when providing an existing run id should be taking the previous case ids allocated in that run id and update those with the Junit xml status

NOTE:
If the run id is not provided then its creating a new run id and new case id and updating it as per status

More Details

No response

trcli sometimes defaults to CP1252 instead of unicode

TestRail CLI Version

1.4.3

CLI Environment

Windows 10.0.18363.1256, Python 3.9.4

TestRail Version

TestRail v7.8.0 Default (1141)

TestRail Instance Type

Enterprise Cloud

Current behavior

When attempting to import an XML file with unicode characters in it that don't appear in cp1252, some test cases get created with titles that contain them, but then trcli cannot add them to a test run. It shows an error about CP1252.
Apparently it's a known issue in Python, the solution would be here:
https://intellipaat.com/community/19239/change-python-3-7-default-encoding-from-cp1252-to-cp65001-aka-utf-8
It may be that just the windows python defaults to that (unix usually defaults to iso-8859-1 which would make more sense since iso-8859-1 is the first 256 code points in unicode but in 8 bits).

Creating test run. Traceback (most recent call last):
File "C:\PROGRAM Files\Python39\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\PROGRAM Files\Python39\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\PROGRAM Files\Python39\Scripts\trcli.exe_main
.py", line 7, in
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\decorators.py", line 26, in new_func
return f(get_current_context(), *args, **kwargs)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\commands\cmd_parse_junit.py", line 92, in cli
result_uploader.upload_results()
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\api\results_uploader.py", line 109, in upload_results
added_run, error_message = self.api_request_handler.add_run(
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\api\api_request_handler.py", line 382, in add_run
response = self.client.send_post(f"add_run/{project_id}", add_run_data)
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\api\api_client.py", line 82, in send_post
return self.__send_request("POST", uri, payload, files)
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\api\api_client.py", line 149, in __send_request
self.verbose_logging_function(verbose_log_message)
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\cli.py", line 95, in vlog
self.log(msg, *args)
File "C:\PROGRAM Files\Python39\lib\site-packages\trcli\cli.py", line 90, in log
click.echo(msg, file=sys.stdout, nl=new_line)
File "C:\PROGRAM Files\Python39\lib\site-packages\click\utils.py", line 299, in echo
file.write(out) # type: ignore
File "C:\PROGRAM Files\Python39\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u037e' in position 545: character maps to

Desired behavior

Given that TestRail itself uses utf8 and xml can use it too, trcli should use the encoding defined in the xml file to read it (or, if none is defined, attempt to guess between iso-8859-1 and utf8) and use utf8 for the output to testrail.

More Details

Another unrelated small issue, not very important since it can be easily fixed, is that when trcli installs, it accepts an outdated dependency on numpy, then throws an error at runtime. Upgrading numpy fixes it. Maybe add the api-breaking numpy version as a requirement ?

work-around: process the xml file to remove all non-ascii characters and replace them with ascii look-alikes or descriptions. Or adjust the scripts that generate that xml in the first place to not use unicode.

EDIT: replaced the progra-tilde-one with program files, so that the github mark-down editor doesn't mess it up

There is no empty or null check as a result it is throwing error

context = automation_id_field["configs"][0]["context"]

Sample Error message:
File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\commands\cmd_parse_junit.py", line 46, in cli
    result_uploader.upload_results()
  File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\api\results_uploader.py", line 71, in upload_results
    automation_id_error = self.api_request_handler.check_automation_id_field(project_data.project_id)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\mahesh.koppana\AppData\Local\Programs\Python\Python311\Lib\site-packages\trcli\api\api_request_handler.py", line 58, in check_automation_id_field
    context = automation_id_field["configs"][0]["context"]
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range

Milestone ID flag

What would you like the TestRail CLI to be able to do?

I wanna be able to push xml file to a designated milestone id on TestRail

Why is this feature necessary on the TestRail CLI?

Since milestones are a prominent feature of Testrail, being able to manipulate milestone id using trcli would be a good addition

More details

No response

Interested in implementing it yourself?

No

Support for Custom Success and Failure Statuses

What would you like the TestRail CLI to be able to do?

TestRail allows for creating and using custom result statuses (see documentation). The TestRail CLI should be able to support these custom result statuses when reporting successes and failures.

Example:
A TestRail Suite tracks test case results with 4 custom statuses: Manual Passed, Manual Failed, Automation Passed, Automation Failed.

Desired Result: After running tests with Cypress and generating results, the statuses for Passed should map to Automation Pass and for Failed it should map to Automation Failed.

Actual Result:: After running tests with Cypress and generating results, the results are uploaded as the default Passed and Failed statuses. Results must be updated manually if we want them to map to the desired statuses.

Why is this feature necessary on the TestRail CLI?

The CLI cannot be used efficiently for projects making use of custom test result statuses without a feature that supports it.

More details

Simple implementation suggestion: the CLI allows the user to specify an alternative status id for passed and failed.

Interested in implementing it yourself?

Maybe, let's talk!

Refs not updated for existing cases on junitxml record_property invocation

TestRail CLI Version

1.4.2

CLI Environment

Mac OS Ventura 13.1, Python 3.11.1

TestRail Version

6.6.1.1166

TestRail Instance Type

Enterprise Server

Current behavior

In a pytest junitxml generated report, having property testrail_case_field value refs:REF-123 will not update the references of a case if it exists. If the case does not exist, trcli creates the test case and will contain the reference.

Desired behavior

Having property with refs should update existing cases

More Details

I currently have a very basic pytest script that uses --case-matcher property to match case IDs and if a given case exists, having record_property("testrail_case_field", "refs:PRJCT-1234") fails to add the reference to the existing case.

Sample pytest script - name to test_sample.py

def test_sample_existing(record_property):
    record_property("test_id", "C1234")
    record_property("testrail_case_field", "refs:PRJCT-1234")
    assert 5 == 5

def test_sample_not_existing(record_property):
    record_property("testrail_case_field", "refs:PRJCT-1234")
    assert 5 == 5

running with pytest --juinitxml "junit-report.xml" generates something like-

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
   <testsuite name="pytest" errors="0" failures="0" skipped="0" tests="2" time="0.034" timestamp="2023-02-16T10:09:08.765432" hostname="MYCOMPUTER">
      <testcase classname="test_tr" name="test_sample_existing" time="0.001">
         <properties>
            <property name="test_id" value="C1234" />
            <property name="testrail_case_field" value="refs:PRJCT-1234" />
         </properties>
      </testcase>
      <testcase classname="test_tr" name="test_sample_not_existing" time="0.001">
         <properties>
            <property name="testrail_case_field" value="refs:PRJCT-1234" />
         </properties>
      </testcase>
   </testsuite>
</testsuites>

Then invoking trcli with it

trcli -y -h https://mytestrail.instance.com --project "My Project" --username "username" --password "password" parse_junit --case-matcher "property" --title "My Run" -f junit-report.xml

It reports success and when I look at the TestRail site, I see it add a new testcase for test_sample_not_existing with the correct References but when I look at case C1234, the Reference value is still None. Is this expected behavior for cases that exist that you can't update refs through a test run? Thanks!

Field :custom_application_name is a required field.

TestRail CLI Version

1.3.0

CLI Environment

Python 3.10.8

TestRail Version

7.5.5

TestRail Instance Type

Professional Cloud

Current behavior

**** API Call
method: POST
url: https://xxx.testrail.io/index.php?/api/v2/add_case/1089
payload: {'title': 'http_req_duration: p(95)<500', 'custom_automation_id': 'Thresholds.http_req_duration: p(95)<500'}
response status code: 400
response body: {'error': 'Field :custom_application_name is a required field.'}


Error during add_case. Trying to cancel scheduled tasks.

Aborting: add_case. Trying to cancel scheduled tasks.
Adding test cases: 0/1
Field :custom_application_name is a required field.

Desired behavior

Create test case.

More Details

No response

Add possibility to link one automated test to multiple test cases by name or property

What would you like the TestRail CLI to be able to do?

I'd like to be able to add multiple test cases in run result like this:

--case-matcher "property"

        <testcase classname="tests.whatever"
                  name="test_create_whatever"
                  time="31.917">
            <properties>
                <property name="test_id" value="C1"/>
                <property name="test_id" value="C2"/>
                <property name="test_id" value="C3"/>
            </properties>
        </testcase>

OR

--case-matcher "name"

        <testcase classname="tests.whatever"
                  name="C1_C2_C3_test_create_whatever" time="31.917" >
        </testcase>

Why is this feature necessary on the TestRail CLI?

I want it because I have automated tests that cover >1 test case from TestRail as part of one test.

More details

No response

Interested in implementing it yourself?

No

Output machine readable details of the upload

What would you like the TestRail CLI to be able to do?

When using this tool as part of a CI pipeline it would be nice to have some output like JSON with all the ids created or used so they can be used by futures steps in the ci. Currently it requires additional api calls after the run to get the information.

IE:

trcli --output=json ...

{
  "suite_id": 202,
  "run_id": 24,
  "sections_added": 1, 
  "cases_added": 445,
  "runs_added": 823
}

Why is this feature necessary on the TestRail CLI?

The testrail API has some low limits, if we already have the id's as a result of the upload then it can be provided to stdout.

More details

No response

Interested in implementing it yourself?

Maybe, let's talk!

KeyError: 'custom_automation_id' on sending test report

TestRail CLI Version

1.4.3

CLI Environment

Python 3.10.6

TestRail Version

TestRail v7.8.0 Default (1136)

TestRail Instance Type

Professional Cloud

Current behavior

Tried to setup integration of TestRai with Pytest using this manual:
https://support.gurock.com/hc/en-us/articles/7983744604564-Integrating-with-Pytest#01G74YVK29QJ87T0N2PAHCSCW5

However, on send I'm getting error, that custom_automation_id field somewhere in test case is missing:

  File "/Users/test/.virtualenvs/automation/bin/trcli", line 8, in <module>
    sys.exit(cli())
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 92, in cli
    result_uploader.upload_results()
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 71, in upload_results
    missing_test_cases, error_message = self.api_request_handler.check_missing_test_cases_ids(
  File "/Users/test/.virtualenvs/automation/lib/python3.10/site-packages/trcli/api/api_request_handler.py", line 301, in check_missing_test_cases_ids
    aut_case_id = case["custom_automation_id"]
KeyError: 'custom_automation_id'

Report looks like this:

<?xml version="1.0" encoding="utf-8"?>
<testsuites>
    <testsuite name="pytest" errors="0" failures="0" skipped="0" tests="1" time="226.659"
               timestamp="2023-02-23T16:56:28.151984" hostname="test.local">
        <testcase classname="tests.login.test_login" name="test_redirect_to_register_user" time="11.253"/>
    </testsuite>
</testsuites>

I did not find any manual about custom_automation_id field and where it should be setup on this stage. Could someone please help to determine whether this is a bug or misconfigured TestRail?

Desired behavior

No response

More Details

No response

CLI does not provide option for no ssl

I cannot run either of these successfully.

trcli -y -vvv -h $TESTRAIL_URL --project "Incident Intelligence" --username $TESTRAIL_EMAIL --password $TESTRAIL_PASSWORD parse_junit --title "PFT Run" --suite-id "1314" -f ../results.xml

trcli -y -v --config trconfig.yaml parse_junit -f results.xml

I get a very vague error when using verbose.

Error detected while checking a project: 'Upload to TestRail failed due to a network error. Please make sure you have a valid network connection then try again.'

This is poor logging and doesn't help me solve anything. I can only assume this is because of some SSL issue because I can make the /get_projects call in postman as well as using a python client i've built.

Can someone guide me on how i can debug this?

Testcases with same name but different automation_id are duplicated

TestRail CLI Version

1.3.0

CLI Environment

Windows 11, Python 3.10.4

TestRail Version

7.5.5

TestRail Instance Type

Professional Cloud

Current behavior

Testcases with duplicate names (but unique name+classname / automation_id) are causing duplicate testcases to be added.
This behaviour occurs when a new testcase is added. When there are no new testcases to add it doesn't happen.

When this happens the CLI shows this: "Warning: Case duplicates detected in mytests.xml. This will result in improper results setting."

Any occurrences of a testcase name beyond the first are duplicated.

The run will only include results for 1 of each name, regardless of how many occurrences there are.

<testsuites>
	<testsuite name="NewTest">
		<!-- Increment this to trigger bug -->
		<testcase name="Incrementing Test Number 01" classname="NewTest"/>
	</testsuite>
	<testsuite name="Professional">
		<testcase name="Test 1" classname="Professional"/>
		<testcase name="Test 2" classname="Professional"/>
		<testcase name="Test 3" classname="Professional"/>
	</testsuite>
	<testsuite name="Enterprise">
		<!-- These are duplicated everytime 1 or more new tests are added -->
		<testcase name="Test 1" classname="Enterprise"/>
		<testcase name="Test 2" classname="Enterprise"/>
		<testcase name="Test 3" classname="Enterprise"/>
	</testsuite>
	<testsuite name="Basic">
		<!-- These are duplicated everytime 1 or more new tests are added -->
		<testcase name="Test 1" classname="Basic"/>
		<testcase name="Test 2" classname="Basic"/>
		<testcase name="Test 3" classname="Basic"/>
	</testsuite>
</testsuites>

Desired behavior

I would expect that no duplicates are created, and that the run includes all the results.

More Details

No response

not being able to update or delete the `automation_id` custom attribute

TestRail CLI Version

1.3.0

CLI Environment

Python 3.10

TestRail Version

7.0.1.1013

TestRail Instance Type

Enterprise Cloud

Current behavior

As described here https://support.gurock.com/hc/en-us/articles/7146583042068#01G74W5ZPF022D5E3SGYGA0MM9, we set up a custom attribute called automation_id with the type String, however, String has a character limit of 250 characters, hence we wanted to change the type for this attribute to text.
But for some reason TestRail doesn't allow me to update the type for this attribute, nor am I able to delete this attribute to make a new one with type text.
Can you please look into it and see maybe if I'm doing something wrong or if this functionality is not offered by TestRail yet?

Desired behavior

No response

More Details

No response

Add option to disable deletion of test suite/case when upload fails

What would you like the TestRail CLI to be able to do?

I'd like to have an option not to delete create test suites when test run results failed to be uploaded

Why is this feature necessary on the TestRail CLI?

There are times that the account used is an app account with add/delete/edit role. At the same time, test suites are already available and being maintained. With just 1 error during test run upload, all the test suites that already been created will be deleted together with the test cases, section and test runs which is not a good idea specially if we are running 100+ tests. There is no need to delete the test suite just the test run should be enough for this case.

More details

Below is a sample of failed upload since the initial upload for the run-id has more than test cases/results than previous run.

`Checking project. Done.
Adding missing sections to the suite.
Found test cases not matching any TestRail case (count: 27)
Adding missing test cases to the suite.
Adding test cases: 27/27, Done.
Adding results: 0/76
Error during add_results. Trying to cancel scheduled tasks.

Aborting: add_results. Trying to cancel scheduled tasks.
Adding results: 0/76
Field :results contains one or more invalid results (case C497 unknown or not part of the test run)
Deleted created test cases
Deleted created section
Deleted created suite`

Interested in implementing it yourself?

Maybe, let's talk!

KeyError: 'custom_automation_id'

TestRail CLI Version

1.3.0

CLI Environment

3.10.6, MacBookPro

TestRail Version

v7.5.4

TestRail Instance Type

Enterprise Cloud

Current behavior

While trying to upload an auto generated Cypress report the library crashes with 'KeyError: 'custom_automation_id'

Stack:
Traceback (most recent call last): File "/usr/local/bin/trcli", line 8, in <module> sys.exit(cli()) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 84, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/usr/local/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/trcli/commands/cmd_parse_junit.py", line 46, in cli result_uploader.upload_results() File "/usr/local/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 92, in upload_results added_test_cases, result_code = self.add_missing_test_cases( File "/usr/local/lib/python3.10/site-packages/trcli/api/results_uploader.py", line 288, in add_missing_test_cases ) = self.api_request_handler.check_missing_test_cases_ids(project_id) File "/usr/local/lib/python3.10/site-packages/trcli/api/api_request_handler.py", line 296, in check_missing_test_cases_ids aut_case_id = case["custom_automation_id"] KeyError: 'custom_automation_id'

This is the cypress Report I used:
TEST-091622.xml.zip

Desired behavior

I would expect that I get a useful error message if the data is wrongly formatted.

More Details

No response

Steps integration

What would you like the TestRail CLI to be able to do?

I'd like to able to upload steps on my test case.

Why is this feature necessary on the TestRail CLI?

No response

More details

No response

Interested in implementing it yourself?

Yes

automation_id appears to be limited to 250 characters

TestRail CLI Version

1.3.0

CLI Environment

Windows 11 Pro, Mac m1

TestRail Version

7.5.4

TestRail Instance Type

Professional Cloud

Current behavior

Trying to import with long test cases gives the error

Field :custom_automation_id is too long (250 characters at most)

Desired behavior

the import should succeed regardless of automation_id length, as no limitation is mentioned in the documentation.

More Details

I can't find anything in the documentation that mentions this limitation when creating the automation_id field as a string. Is there any workaround to this, we have many test names which go over this limit so it would not be an easy task to reduce below.

When we try this with shorter test cases, the import works without problem.

A possible solution would be to change automation_id field to Text in place of String potentially, though it's not something we've tried, or whether this would be a workaround.

Testcase with trailing space never matched, causing duplicates

TestRail CLI Version

1.3.0

CLI Environment

Windows 11, Python 3.10.4

TestRail Version

7.5.5

TestRail Instance Type

Professional Cloud

Current behavior

When a testcase name has a trailing space the CLI looks for an existing case with the trailing space, then uploads a new case without the trailing space. This repeats every time the CLI is run, resulting in the testcase being repeatedly duplicated.

Desired behavior

I would expect that the trailing space doesn't prevent a match.

More Details

Here's an example jUnit XML file that is never matched by the CLI because of a trailing space in the testcase name:

<testsuites>
  <testsuite name="main">
    <testcase name="foo " classname="bar"/>
  </testsuite>
</testsuites>

This issue is also present for leading spaces in the classname:

<testsuites>
  <testsuite name="main">
    <testcase name="foo" classname=" bar"/>
  </testsuite>
</testsuites>

Request "GET" ask to include header "Content-Type: application/json".

TestRail CLI Version

1.3.1

CLI Environment

Windows 10 Enterprise, python 3.9

TestRail Version

v5.7.1.4028

TestRail Instance Type

NA

Current behavior

I create a config file with my auth data, the host, and all data about the project-suite.
When i try to upload an xml report file to my Testrail test run, i get the follwing result:

Checking project.
Error detected while checking a project: 'Content-Type header missing (use Content-Type: application/json)'

Desired behavior

After trying to upload an xml report file, the trcli should check the data about the project, suite and test cases online and update the resuls in the desired test run.

More Details

Checking the code of api_client.py, i found headers where no added to requests of type "GET". Apparently this cause the error, i just add the headers to this request (as a test) and the upload was successful after that.

Cannot update test runs with --run-id flag

TestRail CLI Version

1.4.3

CLI Environment

Python3.10, Ubuntu 22.04.2 LTS

TestRail Version

TestRail v7.8.0 Default (1141)

TestRail Instance Type

Professional Cloud

Current behavior

Currently, attempting to update test runs with the --run-id flag with trcli returns the following:

Executed: trcli -y -h https://{instance}.io --project "Software Test Automation" --username {username} --password {password} parse_junit --title "{unit} Automated Test Run" --run-id "3075" -f ./reports/*.xml'

TestRail CLI v1.4.3
Copyright 2021 Gurock Software GmbH - www.gurock.com
Parse JUnit Execution Parameters
> Report file: ./reports/junit-report.xml
> Config file: None
> TestRail instance: https://OUR-INSTANCE.testrail.io (user: MY-EMAIL)
> Project: UNIT Software Test Automation
> Run title: Automated Test Run
> Update run: 3075
> Add to milestone: No
> Auto-create entities: True
Parsing JUnit report.
Processed 11 test cases in 1 sections.
Checking project. Done.
Adding missing suites to project Software Test Automation.
Found 11 test cases not matching any TestRail case.
Adding missing sections to the suite.
Adding missing test cases to the suite.
Adding test cases: 11/11, Done.
Updating run: https://OUR-INSTANCE.testrail.io/index.php?/runs/view/3075
Adding results: 0/11
Error during add_results. Trying to cancel scheduled tasks.

Aborting: add_results. Trying to cancel scheduled tasks.
Adding results: 0/11
No attachments found to upload.
Field :results cannot be empty but no valid tests or cases found
Deleted created test cases
Deleted created section
Deleted created suite

The results.xml in question is generated with pytest.
https://pastebin.com/yrnnTiw6

Said results.xml file can be uploaded without issue without the --run-id flag

Desired behavior

Test runs are updated

More Details

No response

Support importing of required fields

Steps to reproduce

  • Create a mandatory custom Field, e.g. a List of "custom_affected_companies" and apply it to a TestCase for the project you wish to import your TestCases to.
  • Set the results.version Field to mandatory
  • Import Testcases

Actual Result

  • error occured while creating a TestCase via import: Field :results.version is a required field.
  • error occured while adding a result via import: Field :custom_affected_companies is a required field.
  • I had to edit the result field and set “required” to false to be able to import.
  • I had to edit the field and set “required” to false to be able to import.

Expected Result

  • it should be possible to provide mandatory informations, per TestCase
  • it should be possible to provide mandatory informations, per Result

Support for template_id from junit XML results

What would you like the TestRail CLI to be able to do?

When using multiple templates, we need a way to specify template_id in the JUnit XML results file under tag, to pass the template_id setting (and others) to pass through to the POST request to add new test case using trcli.

Why is this feature necessary on the TestRail CLI?

This would allow to enable trcli support for the non-default "Test Case" templates as well.

<testsuites name="Mocha Tests">
  <testsuite failures="0" errors="0" skipped="1" tests="1" time="0.05" name="tests.LoginTests">
    <properties><property name="setting1" value="True"/></properties>
    <testcase classname="tests.LoginTests" name="test_case_2" time="650" template_id=2>
    </testcase>
  </testsuite>
</testsuites>

More details

No response

Interested in implementing it yourself?

No

Implement a way to provide step informations via the import file

Steps to reproduce:

  • Import the following report:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="Functional Tests Suite" time="150.939" tests="2" failures="0" errors="0">
   <testsuite name="Functional Tests Suite" tests="2" failures="0" errors="0" time="150.939" skipped="0" timestamp="2022-05-18 14:57:42" hostname="localhost - computername">
      <properties>
         <property name="deviceName" value=""/>
         <property name="devicePlatform" value=""/>
         <property name="logFolder" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737"/>
         <property name="logFiles" value="C:\\Users\\myusername\\Katalon Studio\\Learning KS Web\\Reports\\20220518_145736\\Functional Tests Suite\\20220518_145737\\execution0.log"/>
         <property name="attachments" value=""/>
         <property name="hostName" value="localhost - computername"/>
         <property name="os" value="Windows 10 64bit"/>
         <property name="katalonVersion" value="8.3.5.208"/>
         <property name="browser" value="Chrome 101.0.4951.67"/>
         <property name="hostAddress" value="127.0.0.1"/>
         <property name="sessionId" value="b48814780035cdbfdcb820cc6131f166"/>
         <property name="seleniumVersion" value="3.141.59"/>
         <property name="proxyInformation" value="ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList=&quot;&quot;, isApplyToDesiredCapabilities=true }"/>
         <property name="platform" value="Windows 10"/>
      </properties>
      <testcase name="Test Cases/Add to Cart Test" time="73.239" classname="Test Cases/Add to Cart Test" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:57:43 - [TEST_CASE][PASSED] - Test Cases/Add to Cart Test: Test Cases/Add to Cart Test

2022-05-18 14:57:43 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:57:43 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:57:43 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:57:54 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:57:54 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:58:16 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Home Page/a_Product 2")): Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/a_Product 2' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Product Details Page/button_Add to cart")): Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Product Details Page/button_Add to cart' is clicked on

2022-05-18 14:58:28 - [TEST_STEP][PASSED] - click(findTestObject("Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout")): Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Object: 'Object Repository/Product and Category Pages/Add to Cart Conrirmation Popup/button_Proceed to checkout' is clicked on

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - verifyElementText(findTestObject("Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products"), "1 Product"): Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [MESSAGE][PASSED] - Actual text and expected text of test object 'Object Repository/Checkout Pages/Shopping Cart Summary Page/span_Number of products' are matched.

2022-05-18 14:58:52 - [TEST_STEP][PASSED] - delay(3): Delayed 3 second(s)

2022-05-18 14:58:55 - [MESSAGE][PASSED] - Delayed 3 second(s)

2022-05-18 14:58:55 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 14:58:56 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <testcase name="Test Cases/User Account Tests/Login Tests/Login Manual Mode" time="77.47" classname="Test Cases/User Account Tests/Login Tests/Login Manual Mode" status="PASSED">
         <system-out><![CDATA[2022-05-18 14:58:56 - [TEST_CASE][PASSED] - Test Cases/User Account Tests/Login Tests/Login Manual Mode: Test Cases/User Account Tests/Login Tests/Login Manual Mode

2022-05-18 14:58:56 - [TEST_STEP][PASSED] - openBrowser(""): Browser is opened with url: ''

2022-05-18 14:58:56 - [MESSAGE][INFO] - Starting 'Chrome' driver

2022-05-18 14:58:56 - [MESSAGE][INFO] - Action delay is set to 0 milliseconds

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Browser is opened with url: ''

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - maximizeWindow(): Current window maximized

2022-05-18 14:59:04 - [MESSAGE][PASSED] - Current window maximized

2022-05-18 14:59:04 - [TEST_STEP][PASSED] - navigateToUrl(WebsiteURL): Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [MESSAGE][PASSED] - Navigate to 'http://automationpractice.com' successfully

2022-05-18 14:59:23 - [TEST_STEP][PASSED] - click(findTestObject("Home Page/button_Sign in")): Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [MESSAGE][PASSED] - Object: 'Object Repository/Home Page/button_Sign in' is clicked on

2022-05-18 14:59:41 - [TEST_STEP][PASSED] - setText(findTestObject("User Account Pages/Login Page/Login Section/input_Email address"), "[email protected]"): Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [MESSAGE][PASSED] - Text '[email protected]' is set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Email address'

2022-05-18 14:59:42 - [TEST_STEP][PASSED] - setEncryptedText(findTestObject("User Account Pages/Login Page/Login Section/input_Password"), "2yzypAZhesWDBbg9RlLtEQ=="): Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [MESSAGE][PASSED] - Text ****** has been set on object 'Object Repository/User Account Pages/Login Page/Login Section/input_Password'

2022-05-18 14:59:43 - [TEST_STEP][PASSED] - click(findTestObject("User Account Pages/Login Page/Login Section/button_Sign in")): Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [MESSAGE][PASSED] - Object: 'Object Repository/User Account Pages/Login Page/Login Section/button_Sign in' is clicked on

2022-05-18 14:59:53 - [TEST_STEP][PASSED] - verifyElementVisible(findTestObject("User Account Pages/My Account Page/h1_My account")): Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Object 'Object Repository/User Account Pages/My Account Page/h1_My account' is visible

2022-05-18 15:00:13 - [TEST_STEP][PASSED] - closeBrowser(): Browser is closed

2022-05-18 15:00:13 - [MESSAGE][PASSED] - Browser is closed]]></system-out>
         <system-err><![CDATA[]]></system-err>
      </testcase>
      <system-out><![CDATA[2022-05-18 14:57:42 - [TEST_SUITE][PASSED] - Functional Tests Suite: Test Cases/User Account Tests/Login Tests/Login Manual Mode]]></system-out>
      <system-err><![CDATA[]]></system-err>
   </testsuite>
</testsuites>

Actual Result

  • The imported data doesn't contain any step informations. Neither in the TestCase nor the Result.

Expected Result

  • While importing it should be possible to create step information such as. “Step Description”, “Expected result”, “Actual result”, “Step status” etc.
  • The necessary informations are actually already available as lines within <system-out>:
    • I imagine the import in such a way that per [TEST_STEP] a step entry is generated in TestRail. The step description would be - openBrowser(""):. The expected result description for this step would be e.g. everything following to the end of the line, e.g. Browser is opened with url: '' The actual result per step could be identified by [PASSED].
    • Of course you could also think about formatting the file differently, so that the data is more structured. Here a documentation would be helpful, how to configure the JUnit log formatter if necessary.

Error with parse_junit comand

I have a problem with trcli parse_junit. When I try to send test result I get Error: No such command 'parse_junit'.
I installed trcli using pip. Trcli command show:
TestRail CLI v1.4.3
Copyright 2021 Gurock Software GmbH - www.gurock.com
Supported and loaded modules:
- parse_junit: JUnit XML Files (& Similar)
but when I try trcli parse_junit --help I also get the same error. I try to reinstall trcli, but it not help. I'm using python3.10.10 version.
What could be the problem and how to solve it?

Need a mechanism for leaving comments or messages to tested scenarios that are passed

What would you like the TestRail CLI to be able to do?

I want to be able to send message or comment to the 'Pass' test case.In case of failure we send test case result as fail with message or with reason of failure like that we want to send comment to the test cases which are getting executed successfully.

Why is this feature necessary on the TestRail CLI?

We are using this feature to upload our test cases results which are related to data quality analysis. In these circumstances, the comment section of both successful and unsuccessful test cases must provide the record count.

More details

**Reason: Actual result SQL has an error, please check by running the same query BQ not equal to Expected result 0**

Code above marked in bold is for testcase which is failed like this we want to send message to testcase which is getting pass.

Interested in implementing it yourself?

No

api version not checked for get_projects

In my organization's api response for the get_projects, we do not receive a "projects" field to summarize all projects. It is simply a list of projects. This causes an exception for the list comprehension on line 73 in api_request_handler.py. Is this library only compatible for a specific version?

            available_projects = [
                project
                for project in response.response_text["projects"] <--- this field doesn't exist for us
                if project["name"] == project_name
            ]

Using existing RUN_ID, doesn't update existing run with new test cases

What would you like the TestRail CLI to be able to do?

when providing an existing run id, to update the run with the new test cases created

existing result:
Field :results contains one or more invalid results (case C1234678 unknown or not part of the test run)

Why is this feature necessary on the TestRail CLI?

This only happens when you already have a test run you wish to create new tests and upload results to. If the test run doesn't have the case in the run, the cli fails.

More details

No response

Interested in implementing it yourself?

Maybe, let's talk!

Enhance click.options for host, username, and password leverage envvars. Then add support for .env file.

It's cli hell to have to pass all these values in. Yes, there is a configuration file option but that's too broad.

Please pick a standard for the environment variables, I suggest TESTRAIL_USR, TESTRAIL_PSW, and TESTRAIL_HOST, so that we can have these set automatically without having to pass them in. In addition, have a .env file click option so that we can test these variables without having to set them in our bash profile or explicitly.

Finally, configuration files should be broken into categories.

Config file 1 (new run):
suite_id <- required
milestone_id <- optional if you want that run placed in a milestone
plan_id <- optional if you want that run placed in plan

Config file 2 (existing run):
run_id

SauceLabs integration

What would you like the TestRail CLI to be able to do?

SauceLabs provides the saucectl command line interface, which outputs JUnit reports with sessions information.

Using a new special JUnit parser, the session data can be imported to TestRail, enabling navigation from the test results to the SauceLabs sessions, in order to debug any issues.

Why is this feature necessary on the TestRail CLI?

Enable integration with SauceLabs.

More details

No response

Interested in implementing it yourself?

Yes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.