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
- Open the command palette (
Ctrl+Shift+PorCmd+Shift+P). - Search for
Preferences: Open Settings (UI). - In the search bar, type
env. - Click on
Edit in settings.json. - Add the following line to your
settings.jsonfile:"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
- Mac/Linux:
export API_KEY=your-mailslurp-api-key - Windows (Command Prompt):
set API_KEY=your-mailslurp-api-key - Windows (PowerShell):
$env:API_KEY="your-mailslurp-api-key"
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',
},
},
});