Gathering detailed insights and metrics for @paschal_cheps/cypress-ms-teams-reporter
Gathering detailed insights and metrics for @paschal_cheps/cypress-ms-teams-reporter
Gathering detailed insights and metrics for @paschal_cheps/cypress-ms-teams-reporter
Gathering detailed insights and metrics for @paschal_cheps/cypress-ms-teams-reporter
npm install @paschal_cheps/cypress-ms-teams-reporter
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
![]() |
A Cypress reporter that sends test results to Microsoft Teams.
A Microsoft Teams reporter for Cypress test automation that integrates test reports from Mochawesome and sends them as notifications to Teams channels. Supports multiple CI/CD providers like GitHub, Bitbucket, CircleCI, and Jenkins.
✅ CI/CD Integration – Supports GitHub Actions, Bitbucket, CircleCI, Jenkins, or local execution.
✅ Microsoft Teams Webhook Support – Sends test execution reports directly to a Teams channel.
✅ Mochawesome Report Parsing – Extracts data from Cypress test runs.
✅ Screenshots & Videos Attachments – Includes media from test failures.
✅ Custom Messages – Add custom text and metadata (Module Name, Team Name, etc.).
✅ Only Failed Tests Mode – Send notifications only if tests fail.
✅ Detailed Logging – Enable verbose output for debugging.
1npm install -g @paschal_cheps/cypress-ms-teams-reporter
or as a dev dependency:
1npm install --save-dev @paschal_cheps/cypress-ms-teams-reporter
yarn
1yarn add -D @paschal_cheps/cypress-ms-teams-reporter
To send reports to Microsoft Teams, you need a webhook URL:
Create a .env
file in your project root:
1TEAMS_WEBHOOK_URL=https://your-teams-webhook-url 2GITHUB_TOKEN=your-github-token # Only required for GitHub CI 3BITBUCKET_WORKSPACE=your-bitbucket-workspace # Required for Bitbucket CI 4BITBUCKET_REPO_SLUG=your-bitbucket-repo-slug # Required for Bitbucket CI 5BITBUCKET_BUILD_NUMBER=your-bitbucket-build-number # Required for Bitbucket CI 6CIRCLE_PROJECT_USERNAME=your-circleci-project-username # Required for CircleCI 7CIRCLE_PROJECT_REPONAME=your-circleci-project-reponame # Required for CircleCI 8CIRCLE_BUILD_NUM=your-circleci-build-number # Required for CircleCI 9CIRCLE_WORKFLOW_ID=your-circleci-workflow-id # Required for CircleCI 10CIRCLE_PROJECT_ID=your-circleci-project-id # Required for CircleCI
1npx cypress-ms-teams-reporter --ci-provider=github
.env
file1dotenv -c npx cypress-ms-teams-reporter --ci-provider=github
1npx cypress-ms-teams-reporter --custom-url="[https://example.com/report.html](https://example.com/report.html)"
1npx cypress-ms-teams-reporter --only-failed
1// teamsReport.config.js 2const dotenv = require("dotenv"); 3dotenv.config(); 4 5// Validate required environment variables 6if (!process.env.TEAMS_WEBHOOK_URL) { 7 throw new Error("TEAMS_WEBHOOK_URL is not defined in the .env file."); 8} 9 10// List of allowed CI providers 11const allowedCiProviders = [ 12 "github", 13 "bitbucket", 14 "circleci", 15 "jenkins", 16 "local", 17 "none", 18]; 19 20module.exports = { 21 // Teams Webhook URL for sending test reports 22 teamsWebhookUrl: 23 process.env.TEAMS_WEBHOOK_URL || "https://default-webhook-url", 24 25 // Directory and filename for the test report 26 reportPath: `${process.env.REPORT_DIR || "cypress/reports"}/${ 27 process.env.REPORT_FILENAME || "index.json" 28 }`, 29 30 // Title of the report in Microsoft Teams 31 reportTitle: "Cypress E2E Tests", 32 33 // CI provider (e.g., github, bitbucket, local) 34 ciProvider: (() => { 35 const provider = process.env.CI_PROVIDER || "local"; 36 if (!allowedCiProviders.includes(provider)) { 37 throw new Error( 38 `Invalid CI provider: ${provider}. Allowed values: ${allowedCiProviders.join( 39 ", " 40 )}` 41 ); 42 } 43 return provider; 44 })(), 45 46 // URL to access the test report 47 reportUrl: process.env.REPORT_URL || "https://default-report-url", 48};
Option | Description | Default |
---|---|---|
--ci-provider <type> | Select CI provider (github , bitbucket , circleci , jenkins , local ) | github |
--custom-url <url> | Provide a custom test report URL | "" |
--report-dir <path> | Path to the Mochawesome report directory | mochareports |
--screenshot-dir <path> | Cypress screenshot directory | cypress/screenshots |
--video-dir <path> | Cypress video directory | cypress/videos |
--verbose | Enable detailed logging | false |
--only-failed | Send notifications only for failed tests | false |
--custom-text <text> | Add extra text to the Teams message | "" |
--module-name <type> | Name of the module under test | "" |
--team-name <type> | Name of the team receiving the test report | "" |
--config-file <path> | Path to the configuration file for the Teams reporter | teamsReport.config.js |
Add this step to your workflow:
1- name: Send Cypress Report to Teams 2 run: | 3 npm install 4 dotenv -c npx cypress-ms-teams-reporter --ci-provider=github 5 env: 6 TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }} 7 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1export TEAMS_WEBHOOK_URL="https://your-teams-webhook-url" 2npx cypress-ms-teams-reporter --ci-provider=jenkins
1script: 2 - pipe: atlassian/dotenv:1.3.0 3 variables: 4 DOTENV_PATH: ".env" 5 - npx cypress-ms-teams-reporter --ci-provider=bitbucket
Note: Ensure you have set the BITBUCKET_WORKSPACE
, BITBUCKET_REPO_SLUG
, and BITBUCKET_BUILD_NUMBER
environment variables in your Bitbucket Pipeline settings or in your .env
file. You can use the atlassian/dotenv
pipe to load environment variables from a .env
file.
1jobs: 2 build: 3 steps: 4 - run: 5 name: Send Cypress Report to Teams 6 command: | 7 npm install 8 npm install dotenv -g 9 dotenv -e .env -- npx cypress-ms-teams-reporter --ci-provider=circleci 10 environment: 11 TEAMS_WEBHOOK_URL: $TEAMS_WEBHOOK_URL 12 CIRCLE_PROJECT_USERNAME: $CIRCLE_PROJECT_USERNAME 13 CIRCLE_PROJECT_REPONAME: $CIRCLE_PROJECT_REPONAME 14 CIRCLE_BUILD_NUM: $CIRCLE_BUILD_NUM 15 CIRCLE_WORKFLOW_ID: $CIRCLE_WORKFLOW_ID 16 CIRCLE_PROJECT_ID: $CIRCLE_PROJECT_ID
Note: Ensure you have set the TEAMS_WEBHOOK_URL
, CIRCLE_PROJECT_USERNAME
, CIRCLE_PROJECT_REPONAME
, CIRCLE_BUILD_NUM
, CIRCLE_WORKFLOW_ID
, and CIRCLE_PROJECT_ID
environment variables in your CircleCI project settings or in your .env
file.
✅ Passed: 80%
🟢
❌ Failed: 15%
🔴
⚠️ Pending: 5%
⚠️
📊 Pie Chart: 🟢🟢🟢🟢🟢🟢🟢🟢🔴🔴⚠️
MIT License - @paschal_cheps
🚀 Happy Testing! 🎯
No vulnerabilities found.
No security vulnerabilities found.