You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP

playwright-mail-reporter

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

playwright-mail-reporter

Mail reporter for Playwright which allows you to send the test results via email.

0.0.9
latest
Version published
Weekly downloads
1.4K
17.67%
Maintainers
1
Weekly downloads
 
Created

Mail Reporter for Playwright

npm version Downloads License

This reporter allows you to send an email with the test results after the test run is finished.

Prerequisites

To use this reporter, you will need to have the SMTP server details to send out the emails. Make sure you have the following details:

  • Host
  • Port
  • Username
  • Password

Installation

Install from npm:

npm install playwright-mail-reporter

Usage

You can configure the reporter by adding it to the playwright.config.js file:

import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: [
    [
      "playwright-mail-reporter",
      {
        host: "<host>",
        port: "<port>",
        secure: "<boolean>", // Optional, defaults to true
        username: "<username>",
        password: "<password>",
        from: "<from>",
        to: "<to>", // Comma separated list of email addresses
        subject: "<subject>",
        apiKey: "<api>",
      },
    ],
  ],
});

Here is an example of how you can configure the reporter with Resend:

import { defineConfig } from "@playwright/test";

export default defineConfig({
  reporter: [
    [
      "playwright-mail-reporter",
      {
        host: "smtp.resend.com",
        port: 465,
        username: "resend",
        password: `<YOUR_API_KEY>`,
        from: "Elio <no-reply@elio.dev>",
        to: "Elio <elio@struyfconsulting.be>",
      },
    ],
  ],
});

More information on how to use reporters can be found in the Playwright documentation.

Configuration

The reporter supports the following configuration options:

OptionDescriptionRequiredDefault
hostThe SMTP server hosttrueundefined
portThe SMTP server porttrueundefined
usernameThe SMTP server usernametrueundefined
passwordThe SMTP server passwordtrueundefined
fromThe email address from which the email will be senttrueundefined
toThe email addresses to which the email will be sent (comma separated)trueundefined
subjectThe subject of the emailfalsePlaywright Test Results
linkToResultsLink to the test resultsfalseundefined
mailOnSuccessSend the email on successfalsetrue
showErrorShow the error details in the emailfalsefalse
quietDo not show any output in the consolefalsefalse

Visitors

FAQs

Package last updated on 08 Jul 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts