{"_rev":"4-4d452ae435fe5a9ffb16fa4278cbc74e","time":{"created":"2025-12-16T20:09:46.568Z","modified":"2025-12-16T20:09:47.158Z","1.0.0":"2025-12-16T19:44:02.176Z","1.0.1":"2025-12-16T20:09:46.852Z"},"_id":"@drishtant/netlify-plugin-testrigor","name":"@drishtant/netlify-plugin-testrigor","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.1":{"name":"@drishtant/netlify-plugin-testrigor","version":"1.0.1","description":"Netlify Build Plugin to trigger and monitor TestRigor tests during your build process","main":"index.js","scripts":{"test":"jest","test:watch":"jest --watch","test:coverage":"jest --coverage","lint":"eslint src/ tests/","lint:fix":"eslint src/ tests/ --fix"},"keywords":["netlify","netlify-plugin","testrigor","testing","e2e","ci","cd","automation"],"author":{"name":"Drishtant"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/0Drishtant0/netlify-testrigor.git"},"bugs":{"url":"https://github.com/0Drishtant0/netlify-testrigor/issues"},"homepage":"https://github.com/0Drishtant0/netlify-testrigor#readme","dependencies":{"axios":"^1.6.0"},"devDependencies":{"jest":"^29.7.0","eslint":"^8.56.0"},"engines":{"node":">=14.0.0"},"jest":{"testEnvironment":"node","coverageDirectory":"coverage","collectCoverageFrom":["src/**/*.js"],"testMatch":["**/tests/**/*.test.js"]},"_id":"@drishtant/netlify-plugin-testrigor@1.0.1","gitHead":"baca86a8520b665f6e5729de0565dde15afbe94f","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-5MHBYqw+y0MGlCC+TpsNaM95RirbUy9feZ/ubvLvM4/Dd/qJzaddM7g8Xt67uQLYQU4neRDBQhCCUhG+Ye/Bfw==","shasum":"96d9580dcb5c0390f1e38da4ec655746e0312942","tarball":"https://registry.npmjs.org/@drishtant/netlify-plugin-testrigor/-/netlify-plugin-testrigor-1.0.1.tgz","fileCount":11,"unpackedSize":38196,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDKgRJ3RH8mY/Qj3q4EWLE0V3ZWuW6/7bCLxv56dzGDKwIhAOzofnRITTGo9gh3dviOFjmyCJK3Jb4iXpD+SEZAjtN0"}]},"_npmUser":{"name":"drishtant","email":"drishtantsingh066@gmail.com"},"directories":{},"maintainers":[{"name":"drishtant","email":"drishtantsingh066@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/netlify-plugin-testrigor_1.0.1_1765915786695_0.7426884511185987"},"_hasShrinkwrap":false}},"maintainers":[{"name":"drishtant","email":"drishtantsingh066@gmail.com"}],"description":"Netlify Build Plugin to trigger and monitor TestRigor tests during your build process","homepage":"https://github.com/0Drishtant0/netlify-testrigor#readme","keywords":["netlify","netlify-plugin","testrigor","testing","e2e","ci","cd","automation"],"repository":{"type":"git","url":"git+https://github.com/0Drishtant0/netlify-testrigor.git"},"author":{"name":"Drishtant"},"bugs":{"url":"https://github.com/0Drishtant0/netlify-testrigor/issues"},"license":"MIT","readme":"# Netlify Plugin - TestRigor Integration\r\n\r\n[![npm version](https://badge.fury.io/js/netlify-plugin-testrigor.svg)](https://badge.fury.io/js/netlify-plugin-testrigor)\r\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\r\n\r\nA comprehensive Netlify Build Plugin that integrates TestRigor's automated testing platform into your Netlify deployment pipeline. This plugin triggers and monitors TestRigor test executions, ensuring your deployments are validated before going live.\r\n\r\n##  Features\r\n\r\n- **Automated Test Triggering**: Automatically triggers TestRigor tests after successful builds\r\n- **Real-time Monitoring**: Polls test execution status with configurable intervals\r\n- **Branch/Commit Testing**: Support for testing specific branches and commits\r\n- **Label Filtering**: Run tests based on labels and exclude specific test groups\r\n- **Test Case Selection**: Execute specific test cases by UUID\r\n- **Flexible Configuration**: Wait for results or run tests asynchronously\r\n- **Comprehensive Logging**: Detailed, color-coded console output\r\n- **Error Handling**: Robust error handling with detailed error messages\r\n- **Status Reporting**: Integration with Netlify's deploy summary\r\n\r\n##  Installation\r\n\r\n### Option 1: UI Installation\r\n\r\n1. Go to your site in the Netlify UI\r\n2. Navigate to **Project configuration** → **Build & deploy** → **Build plugins**\r\n3. Search for \"TestRigor\"\r\n4. Click **Enable**\r\n\r\n### Option 2: File-based Installation\r\n\r\n1. Install the plugin as a dev dependency:\r\n\r\n```bash\r\nnpm install --save-dev netlify-plugin-testrigor\r\n```\r\n\r\n2. Add the plugin to your `netlify.toml`:\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n```\r\n\r\n3. Set environment variables in Netlify UI:\r\n   - `TESTRIGOR_AUTH_TOKEN`: Your TestRigor authentication token\r\n   - `TESTRIGOR_TEST_SUITE_ID`: Your TestRigor test suite ID\r\n\r\n### Option 3: Local Plugin\r\n\r\nFor development or custom deployments:\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"./plugins/netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n```\r\n\r\n##  Configuration\r\n\r\n### Required Inputs\r\n\r\n| Input | Description | Example |\r\n|-------|-------------|---------|\r\n| `authenticationToken` | TestRigor authentication token | `\"41a7bc7a-d64a-4d00-8cf8-f73858a20c44\"` |\r\n| `testSuiteId` | TestRigor test suite ID | `\"BnK5D8goWRRQhjiMQ\"` |\r\n\r\n### Optional Inputs\r\n\r\n| Input | Type | Default | Description |\r\n|-------|------|---------|-------------|\r\n| `waitForResults` | boolean | `true` | Wait for test execution to complete |\r\n| `forceCancelPreviousTesting` | boolean | `true` | Cancel any ongoing tests before starting |\r\n| `pollingInterval` | number | `10` | Seconds between status checks |\r\n| `customName` | string | - | Custom name for the test run |\r\n| `storedValues` | string (JSON) | - | Pass variables to tests |\r\n| `branchName` | string | - | Branch name for branch testing |\r\n| `commitHash` | string | - | Commit hash for commit testing |\r\n| `deployUrl` | string | - | URL of deployed site (required for branch/commit testing) |\r\n| `allowKnownIssues` | boolean | `false` | Allow known issues in branch tests |\r\n| `labels` | string | - | Comma-separated labels to include |\r\n| `excludedLabels` | string | - | Comma-separated labels to exclude |\r\n| `testCaseUuids` | string | - | Comma-separated test case UUIDs to execute |\r\n\r\n##  Usage Examples\r\n\r\n### Basic Configuration\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  waitForResults = true\r\n```\r\n\r\n### Branch Testing\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  branchName = \"${BRANCH}\"\r\n  commitHash = \"${COMMIT_REF}\"\r\n  deployUrl = \"${DEPLOY_PRIME_URL}\"\r\n  allowKnownIssues = true\r\n```\r\n\r\n### Label-based Testing\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  labels = \"smoke,critical\"\r\n  excludedLabels = \"slow,experimental\"\r\n```\r\n\r\n### Production-only Testing\r\n\r\n```toml\r\n# Only run tests on production deploys\r\n[[context.production.plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [context.production.plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n```\r\n\r\n### Deploy Preview Testing (No Wait)\r\n\r\n```toml\r\n# Run tests but don't wait for results on Deploy Previews\r\n[[context.deploy-preview.plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [context.deploy-preview.plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  waitForResults = false\r\n```\r\n\r\n### Advanced Configuration with Stored Values\r\n\r\n```toml\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  customName = \"Production Deploy - ${COMMIT_REF}\"\r\n  storedValues = '{\"environment\":\"production\",\"version\":\"${VERSION}\"}'\r\n  pollingInterval = 15\r\n```\r\n\r\n##  Deploy Contexts\r\n\r\nYou can configure the plugin differently for various deploy contexts:\r\n\r\n```toml\r\n# Default configuration for all contexts\r\n[[plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n  [plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n\r\n# Production: Full test suite, wait for results\r\n[[context.production.plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n  [context.production.plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  labels = \"smoke,regression,e2e\"\r\n  waitForResults = true\r\n\r\n# Branch deploys: Smoke tests only\r\n[[context.branch-deploy.plugins]]\r\npackage = \"netlify-plugin-testrigor\"\r\n  [context.branch-deploy.plugins.inputs]\r\n  authenticationToken = \"${TESTRIGOR_AUTH_TOKEN}\"\r\n  testSuiteId = \"${TESTRIGOR_TEST_SUITE_ID}\"\r\n  labels = \"smoke\"\r\n  waitForResults = false\r\n\r\n# Deploy Previews: No tests\r\n# (omit plugin configuration to skip)\r\n```\r\n\r\n\r\n##  Build Output\r\n\r\nThe plugin provides detailed, color-coded output during execution:\r\n\r\n```\r\n==================================================\r\nTestRigor Integration - Starting\r\n==================================================\r\n\r\nℹ Configuration:\r\n  Test Suite ID: BnK5D8goWRRQhjiMQ\r\n  Wait for Results: true\r\n  Polling Interval: 10s\r\n  Branch: feature/new-feature\r\n  Commit: abc123\r\n\r\n→ Building test configuration...\r\n→ Triggering TestRigor test execution...\r\n✓ Test execution triggered successfully!\r\n\r\n==================================================\r\nMonitoring Test Execution\r\n==================================================\r\n\r\nℹ Will check status every 10 seconds\r\n◌ Status: IN PROGRESS (228)\r\n  Tests are still running...\r\n✓ Status: SUCCESS (200)\r\n✓ Tests completed successfully! ✓\r\n\r\n==================================================\r\nTestRigor Plugin - Success\r\n==================================================\r\n```\r\n\r\n##  Testing Locally\r\n\r\nTest your plugin configuration locally using Netlify CLI:\r\n\r\n```bash\r\n# Install Netlify CLI\r\nnpm install -g netlify-cli\r\n\r\n# Run build locally\r\nnetlify build\r\n\r\n# Run build with specific context\r\nnetlify build --context=deploy-preview\r\n```\r\n\r\n\r\n### Running Tests\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Run tests\r\nnpm test\r\n\r\n# Run tests in watch mode\r\nnpm run test:watch\r\n\r\n# Generate coverage report\r\nnpm run test:coverage\r\n```\r\n\r\n### Linting\r\n\r\n```bash\r\n# Run linter\r\nnpm run lint\r\n\r\n# Fix linting issues\r\nnpm run lint:fix\r\n```\r\n\r\n## Troubleshooting\r\n\r\n### Tests not triggering\r\n\r\n1. Verify your `authenticationToken` and `testSuiteId` are correct\r\n2. Check that environment variables are set in Netlify UI\r\n3. Review build logs for error messages\r\n\r\n### Build failing on test failures\r\n\r\nThis is expected behavior when `waitForResults` is `true`. Options:\r\n\r\n1. Fix failing tests in TestRigor\r\n2. Set `waitForResults: false` to run tests asynchronously\r\n3. Use different configurations per deploy context\r\n\r\n### Timeout errors\r\n\r\nIncrease the polling interval or check TestRigor dashboard for test execution status:\r\n\r\n```toml\r\n[plugins.inputs]\r\npollingInterval = 30  # Check every 30 seconds instead of 10\r\n```\r\n\r\n### API errors\r\n\r\n- **401 Unauthorized**: Check your authentication token\r\n- **404 Not Found**: Verify your test suite ID\r\n- **429 Too Many Requests**: Reduce polling frequency\r\n\r\n##  TestRigor API Reference\r\n\r\nFor more information about TestRigor's API:\r\n- [TestRigor API Documentation](https://testrigor.com/command-line/)\r\n- [TestRigor Dashboard](https://app.testrigor.com/)\r\n\r\n\r\n## 📄 License\r\n\r\nMIT License - see LICENSE file for details\r\n\r\n\r\n\r\n---\r\n\r\nMade with ❤️ for automated testing\r\n","readmeFilename":"README.md"}