0.0.8 • Published 7 months ago

playwright-mail-reporter v0.0.8

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

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>",
        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

0.0.8

7 months ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago