testrix-cli
v1.0.9
Published
CLI tool to parse and publish test reports from JUnit, HTML, and Excel formats.
Downloads
347
Readme
Testrix CLI
Testrix CLI is a command-line tool designed to parse test reports (JUnit, XML, HTML, Excel) and publish the results to a specified server API. This allows for centralized tracking, analytics, and dashboards for your CI/CD pipelines and local environments.
📦 Features
- ✅ Parses
JUnit,.xml,.html, and.xls/.xlsxtest reports - 📁 Extracts test case results including status, duration, and error details
- 📊 Aggregates summary statistics (total, passed, failed, skipped)
- 🌐 Publishes results to a configurable server API endpoint
- 🧪 Designed for integration with CI tools like GitLab CI, GitHub Actions, Jenkins, etc.
🚀 Installation
To install Testrix CLI, run the following command:
npm install -g testrix-cli🛠️ Usage
Create a configuration file: Create a
config.jsonfile in your project root, or a specified path. You can use thesrc/config.json.templateas a starting point.{ "serverApiUrl": "http://localhost:4000/api/submit-test-reports", "userId": "YOUR_USER_ID", "projectId": "YOUR_PROJECT_ID", "apiKey": "YOUR_API_KEY", "projectName": "Your Project Name", "projectDescription": "Optional: A description for your project.", "reportsDir": "./test-reports", "name": "Optional: Test Run Name (defaults to module name from test suite if omitted)", "environment": "Optional: Environment (e.g., development, staging, production)", "branch": "Optional: Git Branch Name", "commit": "Optional: Git Commit Hash" }serverApiUrl: The URL of your server's API endpoint where test reports will be sent as a JSON payload (e.g.,http://your-server.com/api/submit-test-reports).userId: A unique identifier for the user initiating the test run. This will be sent to your server.projectId: The UUID of your project (required by backend).apiKey: API key for authentication (required by backend).projectName: The name of the project associated with the test run (optional, for display only).reportsDir: The local directory where your test report files are located. This should be an absolute path or a path relative to where you execute thetestrixcommand. Ensure the CLI has read access to this directory.name: Optional. If omitted, the run name will default to the module name from the test suite (e.g.,api/payroll/allowances.spec.js).
Run Testrix CLI: Execute the
testrixcommand, optionally providing the path to your config file.testrix [path/to/your/config.json]If no path is provided,
testrixwill look forconfig.jsonin the current working directory.
Project Structure
.github/
cli.js
package.json
package-lock.json
README.md
src/
├── config.json.template
├── parsers.js
└── publisher.jsNote: Testrix CLI no longer manages a local SQLite database directly. It sends data to your configured server API, which is responsible for database storage.
