Registry / testing / cypress-testrail-simple

cypress-testrail-simple

JSON →
library3.3.63jsnpmunverified

cypress-testrail-simple is a Cypress plugin designed for straightforward integration with TestRail, enabling the simple upload of Cypress test results. The current stable version is `3.3.63`, with a frequent release cadence, often issuing bug fixes and dependency updates every few days to weeks, indicating active maintenance. This library distinguishes itself by offering a simple, environment variable-driven configuration for TestRail integration, making it easy to set up for CI/CD pipelines. It provides programmatic hooks for Cypress's `setupNodeEvents` to automatically send test outcomes to a specified TestRail project and suite. Additionally, it offers `npx` commands for managing TestRail runs, such as `testrail-start-run`, which can initiate a new run, optionally filtering by specific test case IDs extracted from Cypress spec files.

npm install cypress-testrail-simple
INSTALL
IMPORT
SIG · CYPRESS-TESTRAIL-S
C
cypress-testrail-simple
testingjavascriptv3.3.63
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
await require('cypress-testrail-simple/src/plugin')(on, config)
import plugin from 'cypress-testrail-simple'
The plugin is imported as a CommonJS module from a specific path and immediately invoked within Cypress's Node `setupNodeEvents` function. It's not a standard default or named ESM import.
testrail-start-run
npx testrail-start-run
import { startRun } from 'cypress-testrail-simple/bin/start-run'
This is a CLI command provided by the package, not a JavaScript function intended for direct import within application code. It's executed via `npx`.

This quickstart demonstrates how to configure `cypress-testrail-simple` in `cypress.config.js` for Cypress v10+ and how to set up the necessary environment variables for TestRail integration.

const { defineConfig } = require('cypress'); module.exports = defineConfig({ e2e: { // Ensure your Cypress tests run in a way that matches TestRail structure // For example, tagging tests with 'Cxxx' for case IDs. setupNodeEvents(on, config) { // This configures the TestRail plugin require('cypress-testrail-simple/src/plugin')(on, config); return config; }, }, // Add environment variables or ensure they are set in your CI environment // For local testing, you might use an 'env' object or a .env file. env: { TESTRAIL_HOST: process.env.TESTRAIL_HOST || 'https://your-instance.testrail.io', TESTRAIL_USERNAME: process.env.TESTRAIL_USERNAME || 'your_username', TESTRAIL_PASSWORD: process.env.TESTRAIL_PASSWORD || 'your_api_key', TESTRAIL_PROJECTID: process.env.TESTRAIL_PROJECTID || '1', TESTRAIL_SUITEID: process.env.TESTRAIL_SUITEID || '' // Optional } }); // Example of how to start a test run before running Cypress (e.g., in CI) // In your CI script, you would typically run: // const runId = require('child_process').execSync('npx testrail-start-run --name "Cypress CI Run"').toString().trim(); // console.log(`Started TestRail run: ${runId}`); // then pass this runId to Cypress if needed, though the plugin often handles associating results.
testrail --version
Debug
Known issues
breakingCypress v10 introduced a new configuration file structure (`cypress.config.js` instead of `cypress/plugins/index.js`). Users migrating older Cypress projects must update their plugin integration accordingly.
fix
For Cypress v10+, integrate the plugin within the `e2e.setupNodeEvents` or `component.setupNodeEvents` function in `cypress.config.js`. For older versions, use `cypress/plugins/index.js`.
affects: >=3.0.0
gotchaThe plugin relies heavily on environment variables (`TESTRAIL_HOST`, `TESTRAIL_USERNAME`, `TESTRAIL_PASSWORD`, `TESTRAIL_PROJECTID`, `TESTRAIL_SUITEID`) for configuration. If these are not correctly set, the plugin will not be able to interact with TestRail.
fix
Ensure all required `TESTRAIL_` environment variables are set in your execution environment (e.g., CI, local shell, or via `cypress.env` in `cypress.config.js`). API keys are preferred over passwords for `TESTRAIL_PASSWORD`.
affects: >=1.0.0
gotchaThe plugin is imported from a specific sub-path (`cypress-testrail-simple/src/plugin`) rather than the package root. Incorrect paths will lead to module not found errors.
fix
Always use `require('cypress-testrail-simple/src/plugin')` as shown in the documentation for integrating the plugin into `setupNodeEvents`.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'cypress-testrail-simple/src/plugin'
The package is not installed, or the import path is incorrect.
fix
Run `npm install -D cypress-testrail-simple` or `yarn add -D cypress-testrail-simple`. Double-check the path in `cypress.config.js` matches `require('cypress-testrail-simple/src/plugin')`.
TestRail API error: Authentication failed, please check your username and password or API key.
Incorrect TestRail credentials (username, password, or API key) provided via environment variables.
fix
Verify `TESTRAIL_USERNAME` and `TESTRAIL_PASSWORD` (or API key) environment variables are correct and have appropriate permissions for the TestRail instance.
TestRail API error: Project ID is invalid.
The `TESTRAIL_PROJECTID` environment variable is set to a non-existent or inaccessible project ID.
fix
Confirm that `TESTRAIL_PROJECTID` matches a valid project ID in your TestRail instance and that the configured user has access to it.
Upgrade
Version history
3.3.63latest on npm
Audit
Dependencies
cypressrequiredThis package is a Cypress plugin and requires Cypress to function.
Agent activity
42 hits · last 30 days
node
38
Amazon
1
OpenAI (training)
1
Resources
cypress-testrail-simple — npm install cypress-testrail-simple · libregistry