View on GitHub

examples

Email testing and SMS verification examples using MailSlurp and a wide range of frameworks.

Playwright low-code example

Test user sign-up and email verification flow using the low-code MailSlurp test interface.

Setup

Set the API_KEY environment variable to your MailSlurp API KEY value.

Setting the API_KEY Environment Variable

Visual Studio Code

  1. Open the command palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Search for Preferences: Open Settings (UI).
  3. In the search bar, type env.
  4. Click on Edit in settings.json.
  5. Add the following line to your settings.json file:
     "terminal.integrated.env.osx": {
         "API_KEY": "your-mailslurp-api-key"
     },
     "terminal.integrated.env.linux": {
         "API_KEY": "your-mailslurp-api-key"
     },
     "terminal.integrated.env.windows": {
         "API_KEY": "your-mailslurp-api-key"
     }
    

Terminal

Playwright Configuration

Add the following to your playwright.config.ts or playwright.config.js:

// playwright.config.ts or playwright.config.js
import { defineConfig } from '@playwright/test';

export default defineConfig({
  use: {
    env: {
      API_KEY: process.env.API_KEY || 'your-mailslurp-api-key',
    },
  },
});