0.1.9 • Published 10 months ago

testrail-vitest-reporter v0.1.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

testrail-vitest-reporter

Version

TestRail Reporter is a package that allows you to easily generate reports for your tests using Vitest and integrate them with TestRail, a popular test management system. With this package, you can streamline your testing process by automatically synchronizing your test results with TestRail, providing valuable insights and analytics for your test executions.

Features

  • Seamlessly integrate Vitest with TestRail to create comprehensive test reports.
  • Simple and intuitive API for easy integration into your test automation workflow.

Installation

To install Testrail-vitest-reporter, use the following command:

 npm install -D @dexcare/testrail-vitest-reporter 

Usage

To generate a report with Vitest and upload it to TestRail, follow these steps:

  1. Configure Vitest by adding the TestRail reporter as a reporter in your Vitest config file. Open your Vitest config file (e.g., vitest.config.js) and add the following line to the reporters array:
reporters: ['@dexcare/testrail-vitest-reporter'],
  1. Create a testrail.config.js file in your project's root directory. Enter the following credentials in the file:
module.exports = {
    'baseUrl': 'https://dexcare.testrail.io',
    'user': '<your-testrail-username>',
    'pass': '<your-testrail-password>',
    'project_id': 22,
    'suite_mode': 3,
    'API_KEY': '<your-testrail-api-key>',
    'regex': /[@C][?\d]{3,6}/gm
}

Replace your-testrail-username, your-testrail-password, and your-testrail-api-key with your actual TestRail credentials and API key.

  1. Write your tests using Vitest, ensuring that each test has appropriate assertions and result statuses. You can include the TestRail test IDs in the test names or descriptions. For example:
it('@C123 Should perform a specific task', () => {
  // Test logic here
});

In the example above, @C123 represents the TestRail test ID. Replace C123 with the actual test ID from TestRail.

  1. Run your tests with Vitest as you normally would. The TestRail reporter will collect the test results.

  2. After running your tests, the TestRail reporter will automatically upload the test results to your TestRail project based on the provided configuration.

0.1.9

10 months ago

0.1.8

10 months ago