{"id":27072521,"url":"https://github.com/zealous-tech/testrail-reporter","last_synced_at":"2026-02-28T13:33:29.534Z","repository":{"id":218867046,"uuid":"745516596","full_name":"zealous-tech/testrail-reporter","owner":"zealous-tech","description":"TestRail Reporter for all popular JavaScript (JS) and TypeScript (TS) based testing frameworks, enabling easy submission of test results to TestRail.","archived":false,"fork":false,"pushed_at":"2025-09-10T10:44:51.000Z","size":23049,"stargazers_count":13,"open_issues_count":1,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-09-10T11:49:15.719Z","etag":null,"topics":["automation","jest","playwright","qa","reporter","reporting","testing","testrail","vitest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zealous-tech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-19T14:03:44.000Z","updated_at":"2025-08-15T00:57:22.000Z","dependencies_parsed_at":"2025-01-15T13:28:14.416Z","dependency_job_id":"a70e0cd4-df07-481f-8f04-90b41467870b","html_url":"https://github.com/zealous-tech/testrail-reporter","commit_stats":{"total_commits":3,"total_committers":3,"mean_commits":1.0,"dds":0.6666666666666667,"last_synced_commit":"62f50e3a28f9cd53878ee0f186818003c8675df4"},"previous_names":["zealous-tech/testrail-reporter"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/zealous-tech/testrail-reporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zealous-tech%2Ftestrail-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zealous-tech%2Ftestrail-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zealous-tech%2Ftestrail-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zealous-tech%2Ftestrail-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zealous-tech","download_url":"https://codeload.github.com/zealous-tech/testrail-reporter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zealous-tech%2Ftestrail-reporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29935368,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:16:57.922Z","status":"ssl_error","status_checked_at":"2026-02-28T13:11:15.149Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","jest","playwright","qa","reporter","reporting","testing","testrail","vitest"],"created_at":"2025-04-05T23:18:12.777Z","updated_at":"2026-02-28T13:33:29.515Z","avatar_url":"https://github.com/zealous-tech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Version](https://img.shields.io/badge/version-1.0.0-green)](https://semver.org)\n[![Licence](https://img.shields.io/badge/Licence-MIT-green)](https://github.com/zealous-tech/testrail-reporter/blob/main/LICENSE)\n[![Node](https://img.shields.io/badge/node-\u003e=10.0.0-coral)](https://github.com/zealous-tech/testrail-reporter/blob/main/package.json)\n[![TestRail API](https://img.shields.io/badge/TestRail%20API-v2-teal)](https://support.testrail.com/hc/en-us)\n[![Vitest](https://img.shields.io/badge/Vitest-1.2.2-darkgreen)](https://vitest.dev/)\n[![Playwright](https://img.shields.io/badge/Playwright-1.41.2-blue)](https://playwright.dev/)\n[![JavaScript](https://img.shields.io/badge/JavaScript-ES6-yellow)](https://www.javascript.com/)\n\n\n# TestRail Reporter for all popular JS | TS based testing frameworks\n\n\n**The TestRail reporter package currently supports [Vitest](https://vitest.dev/), [Playwright](https://playwright.dev/) test frameworks. The support for [Jest](https://jestjs.io/) and other runners currently in the development process.**\n\nThe package allows you to synchronize auto test results with associated [TestRail](https://www.testrail.com/) tests through simple configuration.\n\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [TestRail Configuration](#testrail-configuration)\n- [Usage](#usage)\n- [Reporter Workflow](#reporter-workflow)\n- [Comparison with TestRail CLI](#comparison-with-testrail-cli)\n- [Self testing](#self-testing)\n- [License](#license)\n\n\n## Features\n\nThe reporter supports the following features\n\n- Supports Vitest, Playwright testing frameworks.\n- Associate Vitest, Playwright tests with TestRail tests.\n- Generate a run in TestRail using specified test cases or all available test cases. Alternatively, the reporter can connect to and utilize an already created test run (manually initiated through the TestRail graphical user interface).\n- Update the test run results in TestRail either after running all test cases or simultaneously.\n- You have an option to update the test results of the same test run which executed several times, by saving all history data. Or you can create a new test run for every execution.\n- If a test case fails, you can observe an error message in the comment field of the TestRail test result.\n- Supports screenshots and videos attachment to the test results for Playwright.\n\n## Installation\n\nTo install [testrail-reporter](https://www.npmjs.com/package/@zealteam/testrail-reporter?activeTab=readme), use the following command:\n\n```code\n npm install @zealteam/testrail-reporter\n```\n\n## TestRail Configuration\n\nYou should Enable API and Enable session authentication for API from testrail settings(It can be enabled in the administration area in TestRail under Administration \u003e Site Settings \u003e API.)\n\nAlso make sure that your TestRail project uses multiple test suites to manage cases. As of now we support only projects which uses suites.\n\nCreate a `testrail.config.js` file in your project's root directory. Enter the following credentials in the file:\n\n```javascript\nmodule.exports = {\n    base_url: \"https://example.testrail.io\",\n    user: \"username\",\n    pass: \"password\",\n    project_id: 1,\n    suite_id: 1,\n    create_missing_cases: true,\n    testRailUpdateInterval: 0,\n    updateResultAfterEachCase: true,\n    use_existing_run: {\n        id: 0,\n    },\n    create_new_run: {\n        include_all: false,\n        run_name: \"Test Run\",\n        milestone_id: 0\n    },\n    status: {\n        passed: 1,\n        failed: 5,\n        untested: 3,\n        skipped: 6\n    }\n};\n```\n### Options\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003eClick to see all options\u003c/b\u003e\u003c/summary\u003e\n\n- **`base_url`**\n\n    - Replace \"https://example.testrail.io\" with the actual base URL of your TestRail instance.\n\n- **`user`**\n\n    - Replace \"username\" with the actual username of your TestRail account.\n\n- **`pass`**\n\n    - Replace \"password\" with the actual password of your TestRail account.\n\n- **`project_id and suite_id`**\n\n    - Replace the values of project_id's and suite_id's with the corresponding values specific to your project..\n\n- **`create_missing_cases`** - Default is `false`\n\n    - If set to true, the reporter will collect test cases without TestRail case IDs in test title and create them in TestRail under given project and suite.\n        - After missing cases are created, the reporter will create/update `testrail_created_cases.json` file in the root directory of your project.\n            This file will contain the mapping of the test case title, TestRail case ID, section ID and suite ID.\n        - If the test case has a title that matches an existing test case in TestRail, the reporter will warn you about the existing case and will skip creating a new one.\n\n- **`testRailUpdateInterval`** - Default is `0` (seconds).\n\n    - When set to 0, the test results will be updated in TestRail after all tests have been executed.\n    - If set to another value (e.g., 10), the test results will be updated in TestRail every 10 seconds.\n    - If set to a value greater than 59, it will be rounded to minutes, and the results will be updated in TestRail every specified minute.\n\n- **`updateResultAfterEachCase`** - Default is `true`.  Please note that this configuration is only compatible with Playwright.\n\n    - If set to `true` the test results will be updated in TestRail after each test have been executed and `testRailUpdateInterval` config will be ignored.\n    - If set to `false` the test results will be updated in TestRail based on the `testRailUpdateInterval` value. \n\n- **`use_existing_run`**\n\n    - **`id`** - Default is `0`.\n\n        - You have the option to supply an existing test run `id` from your TestRail. When an `id` is provided, your results will be stored in the designated test run, and the reporter will ignore the configurations within the `create_new_run` settings. The same test run will be updated on subsequent runs, and historical data will be maintained within that run.\n\nNOTE: The configs under `create_new_run` will be used if `id` is `0`.\n\n- **`create_new_run`**\n\n    - **`run_name`**\n\n        - If you want to create a new run in TestRail, you can provide a value for `run_name` or the reporter will use the default `Test Run` value. The run name will be composed of the following combination: `'\u003crun_name\u003e \u003ccurrent_date\u003e` (e.g., `Test Run 22.1.2024`).\n\n    - **`include_all`** - Default is `false`\n\n        - When set to false, the newly created TestRail's test run will only include the test cases that are scheduled to execute from Vitest.\n        - When set to true, the newly created TestRail's test run will include all test cases within the specified test suite from TestRail.\n\n    - **`milestone_id`** Default is `0`\n\n        - If you have a milestone in your TestRail, you can set the `milestone_id`. The configuration will be ignored if the value is 0.\n\n- **`status`**\n\n    - The `status` configuration in the provided module is a set of status mappings used to interpret and communicate the test results to TestRail. You should configure your case statuses from TestRail(Administration \u003e Customizations \u003e RESULT STATUSES) and set to provided configuration\n\n```javascript\nstatus: {\n    passed: 1,\n    failed: 5,\n    untested: 3,\n    skipped: 6\n}\n```\n\u003c/details\u003e\n\n---\n\nHere is a quick GIF demonstrating how to configure your project.\n\n![alt text](https://zealous-tech.github.io/testrail-reporter/reporter_installation_and_configuration.gif)\n\n## Usage\n\nTo generate a report with [Vitest](https://vitest.dev/) or [Playwright](https://playwright.dev/) and upload it to [TestRail](https://www.testrail.com/), follow these steps:\n\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003eClick to see Playwright usage\u003c/b\u003e\u003c/summary\u003e\n\n##### Add reporter to the config file\nOpen your config file (e.g., `playwright.config.js` or `playwright.config.ts`)\nand add `'@zealteam/testrail-reporter'` into the `reporters` array.\n\n```javascript\nexport default defineConfig({\n\n...\n\n    reporter: [['list'], ['@zealteam/testrail-reporter']],\n\n...\n\n});\n```\n\n\n##### Update test case with TestRail ID\nWrite your tests using Playwright, ensuring that each test has appropriate assertions and result statuses.\nYou should include the TestRail test case IDs in the test names to link it to corresponding case. For example:\n\n```javascript\ntest(\"@C123 has title\", async ({ page }) =\u003e {\n    // Test logic here\n});\n```\n\nIn above example @C123 represents the TestRail test ID.\nReplace '@C123' with the actual test ID from TestRail.\n\n\n\u003e **WARNING:**\n\u003e If your test cases are already created in TestRail and has a test step,\n\u003e you should write your test cases in a way that the test steps are executed in the same order as in TestRail.\n\nTest case example with test steps\n```javascript\ntest(\"@C123 has title\", async ({ page }) =\u003e {\n    await test.step(\"Step 1\", async () =\u003e {\n        // test step logic here\n    });\n    await test.step(\"Step 2\", async () =\u003e {\n        // test step logic here\n    });\n});\n```\n\n##### Schreenshots and Videos\nNo extra configuration is needed in the testrail.config.js file. Instead,\n you can use Playwright configurations to generate screenshots and videos.\n\nFor instance, if you want to capture a screenshot when a test fails,\nyou should include the following configuration in your config file (e.g., `playwright.config.js` or `playwright.config.ts`):\n\n```javascript\nexport default defineConfig({\n\n...\n\n    use: {\n        screenshot: 'only-on-failure',\n        video: 'retain-on-failure',\n    },\n\n...\n\n});\n```\nGenerated screenshots will be available in testrail run tests' attachments.\n\n\n##### Run your tests\n\n```code\nnpx playwright test\n```\n\n\u003e **INFO:**\n\u003e\n\u003e The TestRail reporter will collect the test results,\n\u003e and will automatically update the test results in TestRail Test Run.\n\u003e\n\u003e TestRail Run url will be printed in the console after the test execution.\n\n\n\u003c/details\u003e\n\n---\n\n\u003cdetails\u003e\n    \u003csummary\u003e\u003cb\u003eClick to see Vitest usage\u003c/b\u003e\u003c/summary\u003e\n\n##### Add reporter to the config file\nOpen your config file (e.g., `vitest.config.js` or `vitest.config.ts`) and add `'@zealteam/testrail-reporter'` into the `reporters` array.\n\n```javascript\nteardownTimeout: 200000,\nreporters: ['default', '@zealteam/testrail-reporter'],\n```\n\n\u003e **WARNING:**\n\u003e\n\u003e It is advisable to include the `teardownTimeout` in any of these configurations since the reporter may run after the tests have completed, and setting it to a large number is recommended.\n\u003e\n\u003e **You must include the `default` runner or your tests won't run properly.**\n\u003e\n\n\n##### Update test case with TestRail ID\nWrite your tests using Vitest, ensuring that each test has appropriate assertions and result statuses.\nYou should include the TestRail test case IDs in the test names to link it to corresponding case. For example:\n\n```javascript\nit('@C123 adds 1 + 2 to equal 3', async () =\u003e {\n    expect(1 + 2).toBe(3);\n});\n```\n\nIn above example @C123 represents the TestRail test ID.\nReplace '@C123' with the actual test ID from TestRail.\n\n\n\u003e **WARNING:**\n\u003e **Test steps are not supported in Vitest.**\n\n\n##### Schreenshots\nNeed to have configured provider to capture screenshots for failed test cases.\n\nFor instance, if you want to capture a screenshot when a test fails,\nyou should include the following configuration in your config file (e.g., `vitest.config.js` or `vite.config.js`):\n\n```javascript\nexport default defineConfig({\n\n...\n\n    test: {\n        environment: 'jsdom',\n        browser: {\n            enabled: true,\n            // browser name is required\n            name: '\u003cbrowser\u003e', // chromium, firefox, webkit\n            provider: 'playwright', // or 'webdriverio'\n            screenshotFailures: true,\n            // screenshots will be saved in this directory\n            screenshotDirectory: '\u003cpath\u003e',\n        },\n    },\n\n...\n\n});\n```\n\nNOTE: regardless your provider choice, you should install the corresponding provider package.\n\nFor more details about the provider installation visit \u003ca href=\"https://vitest.dev/guide/browser/#provider-installation\" target=\"_blank\"\u003eVitest documentation\u003c/a\u003e.\n\nVitest provider configuration is available in \u003ca href=\"https://vitest.dev/guide/browser/#provider-configuration\" target=\"_blank\"\u003eVitest documentation\u003c/a\u003e.\n\nGenerated screenshots will be available in testrail run tests' attachments.\n\n\n\n##### Run your tests\n\n```code\nnpx vitest test\n```\n\nor\n\n```code\nnpm run test:unit\n```\nby default above command comes with the following script configuration in the package.json file,\n```code\n\"scripts\": {\n...\n\"test:unit\": \"vitest\"\n...\n},\n```\n\n\u003e **WARNING:**\n\u003e Don't use this one\n\n```code\nvitest run\n```\n\n\u003e **CAUTION**\n\u003e \n\u003e If your project is based on vite/vue, you should replace the value of `type` key from `module` to `commonjs` in the `package.json` file.\n\n```code\n...\n\"type\": \"commonjs\",\n...\n``````\n\n\n\u003e **INFO:**\n\u003e\n\u003e The TestRail reporter will collect the test results,\n\u003e and will automatically update the test results in TestRail Test Run.\n\u003e\n\u003e TestRail Run url will be printed in the console after the test execution.\n\n\u003c/details\u003e\n\n---\n\n\n## Reporter Workflow\n\n![alt text](https://zealous-tech.github.io/testrail-reporter/workflow.png)\n\n\n## Comparison with TestRail CLI\n\n\nDifferences between testrail-reporter and TestRail CLI (The TestRail CLI is a command-line interface tool developed by the TestRail team, allowing users to upload test automation results from any JUnit-style XML file to TestRail.)\n\n| Feature                                                | testrail-reporter                   | TestRail CLI  |\n|--------------------------------------------------------|-------------------------------------|---------------|\n| Simultaneously Result Updates                          | Supported                           | Not supported |\n| Specify an Interval to Periodically Update Results     | Supported                           | Not supported |\n| Custom Status Support (xfail, fixed)                   | Support is Currently in Development | Not supported |\n| Updating Results After Running All Test Cases          | Supported                           | Supported     |\n| Storing Step Results                                   | Supported                           | Supported     |\n| Adding Comment to the Results                          | Supported                           | Supported     |\n| Creating New Run                                       | Supported                           | Supported     |\n| Updating Existing Run                                  | Supported                           | Supported     |\n| Attaching Screenshots or Logs                          | Supported                           | Supported     |\n| Adding New Case to Test Suite                          | Supported                           | Supported     |\n| Adding New Case to Existing Test Run                   | Support is Currently in Development | Supported     |\n\n## Self testing\n\nTo test the reporter, you can use the following steps:\n\n1. clone the repository\n2. run `npm install` to install the dependencies\n3. navigate to the `frameworks` folder\n4. choose the framework you want to test with\n\n##### Playwright testing\n\n1. navigate to the `playwright` folder\n2. run `npm install` to install the dependencies\n3. set your testrail configurations in the `testrail.config.js` file\n4. update the `playwright.config.ts` file if needed\n5. set log level in src/logger.js file to `debug` for more detailed logs\n6. run `npx playwright test` to run the tests\n\n##### Vitest testing\n\n1. navigate to the `vitest` folder\n2. run `npm install` to install the dependencies\n3. set your testrail configurations in the `testrail.config.js` file\n4. update the `vitest.config.ts` file if needed\n5. set log level in src/logger.js file to `debug` for more detailed logs\n6. run the tests using the appropriate script from the `package.json` file. For example `npm run e2eSmokeTests` or add your custom command\n\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](https://github.com/zealous-tech/testrail-reporter/blob/main/LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzealous-tech%2Ftestrail-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzealous-tech%2Ftestrail-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzealous-tech%2Ftestrail-reporter/lists"}