From 9e3830bfd141d25af4679c8e067a8059e6842d3c Mon Sep 17 00:00:00 2001 From: enismaxim1 <42425794+enismaxim1@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:14:21 -0700 Subject: [PATCH 1/4] Add Playwright signup email test for CI/CD (GitHub Actions, GitLab CI) End-to-end test of a signup verification email: a fresh inbox per test, wait for the email over the Mailsac REST API, confirm with the link and with the 6-digit code. Runs a Mailpit job on every pull request, a Mailsac Email Capture job, and a real-delivery check against a staging app. The existing Mocha example stays at the repository root. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/playwright-signup-ci.yml | 109 +++ README.md | 20 +- playwright-signup-ci/.env.example | 13 + playwright-signup-ci/.gitignore | 4 + playwright-signup-ci/.gitlab-ci.yml | 38 + playwright-signup-ci/README.md | 103 +++ playwright-signup-ci/app/server.js | 85 ++ playwright-signup-ci/package-lock.json | 894 +++++++++++++++++++++ playwright-signup-ci/package.json | 21 + playwright-signup-ci/playwright.config.ts | 16 + playwright-signup-ci/tests/inbox.ts | 113 +++ playwright-signup-ci/tests/signup.spec.ts | 47 ++ 12 files changed, 1461 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/playwright-signup-ci.yml create mode 100644 playwright-signup-ci/.env.example create mode 100644 playwright-signup-ci/.gitignore create mode 100644 playwright-signup-ci/.gitlab-ci.yml create mode 100644 playwright-signup-ci/README.md create mode 100644 playwright-signup-ci/app/server.js create mode 100644 playwright-signup-ci/package-lock.json create mode 100644 playwright-signup-ci/package.json create mode 100644 playwright-signup-ci/playwright.config.ts create mode 100644 playwright-signup-ci/tests/inbox.ts create mode 100644 playwright-signup-ci/tests/signup.spec.ts diff --git a/.github/workflows/playwright-signup-ci.yml b/.github/workflows/playwright-signup-ci.yml new file mode 100644 index 0000000..579598f --- /dev/null +++ b/.github/workflows/playwright-signup-ci.yml @@ -0,0 +1,109 @@ +name: Playwright signup email tests (playwright-signup-ci) + +on: + pull_request: + paths: ["playwright-signup-ci/**", ".github/workflows/playwright-signup-ci.yml"] + push: + branches: [main] + paths: ["playwright-signup-ci/**", ".github/workflows/playwright-signup-ci.yml"] + schedule: + - cron: "17 6 * * *" # daily real-delivery check + workflow_dispatch: + +# The example lives in playwright-signup-ci/; in your own repo, drop working-directory. +defaults: + run: + working-directory: playwright-signup-ci + +jobs: + # 1. Every pull request: a local SMTP catcher. Fast, free, nothing leaves CI. + # Proves the app sends the right email with a working link and code. + mailpit: + runs-on: ubuntu-latest + services: + mailpit: + image: axllent/mailpit:latest + ports: + - 1025:1025 + - 8025:8025 + env: + INBOX: mailpit + SMTP_HOST: localhost + SMTP_PORT: "1025" + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: playwright-signup-ci/package-lock.json + - run: npm ci + - run: npx playwright install --with-deps chromium + - run: npx playwright test + - uses: actions/upload-artifact@v4 + if: failure() + with: + name: playwright-report-mailpit + path: playwright-signup-ci/playwright-report + + # 2. Hosted inboxes with Mailsac Email Capture: the app sends to capture.mailsac.com + # and the test reads the message over the Mailsac API from any runner. + # Needs the repository secret MAILSAC_API_KEY and variable MAILSAC_USERNAME. + mailsac-capture: + runs-on: ubuntu-latest + env: + MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} + MAILSAC_DOMAIN: ${{ vars.MAILSAC_DOMAIN }} + SMTP_HOST: capture.mailsac.com + SMTP_PORT: "5587" + SMTP_USER: ${{ vars.MAILSAC_USERNAME }} + SMTP_PASS: ${{ secrets.MAILSAC_API_KEY }} + steps: + - name: Skip when Mailsac is not configured + id: configured + run: echo "ok=${{ env.MAILSAC_API_KEY != '' }}" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@v4 + if: steps.configured.outputs.ok == 'true' + - uses: actions/setup-node@v4 + if: steps.configured.outputs.ok == 'true' + with: + node-version: 22 + cache: npm + cache-dependency-path: playwright-signup-ci/package-lock.json + - run: npm ci + if: steps.configured.outputs.ok == 'true' + - run: npx playwright install --with-deps chromium + if: steps.configured.outputs.ok == 'true' + - run: npx playwright test + if: steps.configured.outputs.ok == 'true' + + # 3. Real delivery, daily and on main: sign up on your deployed staging app, which sends + # through your real email provider (SES, SendGrid, Postmark...) to a Mailsac inbox. + # Catches expired provider credentials, DNS/SPF/DKIM problems and blocked sending domains. + # Needs MAILSAC_API_KEY and the variable STAGING_URL. A private Mailsac domain + # (MAILSAC_DOMAIN) keeps the mail from real signups out of public inboxes. + real-delivery: + if: github.event_name != 'pull_request' + runs-on: ubuntu-latest + env: + MAILSAC_API_KEY: ${{ secrets.MAILSAC_API_KEY }} + MAILSAC_DOMAIN: ${{ vars.MAILSAC_DOMAIN }} + APP_URL: ${{ vars.STAGING_URL }} + steps: + - name: Skip when staging is not configured + id: configured + run: echo "ok=${{ env.MAILSAC_API_KEY != '' && env.APP_URL != '' }}" >> "$GITHUB_OUTPUT" + - uses: actions/checkout@v4 + if: steps.configured.outputs.ok == 'true' + - uses: actions/setup-node@v4 + if: steps.configured.outputs.ok == 'true' + with: + node-version: 22 + cache: npm + cache-dependency-path: playwright-signup-ci/package-lock.json + - run: npm ci + if: steps.configured.outputs.ok == 'true' + - run: npx playwright install --with-deps chromium + if: steps.configured.outputs.ok == 'true' + - run: npx playwright test + if: steps.configured.outputs.ok == 'true' diff --git a/README.md b/README.md index ddd8694..c9b5815 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,23 @@ -# mailsac-integration-test-examples +# Mailsac email testing examples -This project contains an example Node.js `mocha` integration test suite. +Runnable examples of testing the emails your app sends (signup verification, password reset, +magic links, one-time codes) in integration tests and CI/CD pipelines, using +[Mailsac](https://mailsac.com) test inboxes and its REST API. + +| Example | Stack | What it shows | +|---|---|---| +| [`playwright-signup-ci/`](playwright-signup-ci/) | Playwright, GitHub Actions, GitLab CI | End-to-end signup verification in CI: sign up with a fresh inbox, wait for the email, confirm with the link and the 6-digit code. A local SMTP catcher (Mailpit) on every pull request, Mailsac Email Capture and a real-delivery check against staging. | +| [`test/`](test/) (repository root) | Node.js, Mocha | Check that an email arrived with a specific link, once through the REST API ([`test/test.js`](test/test.js)) and once through the realtime WebSocket API ([`test/websocket.js`](test/websocket.js)). | + +## Mocha example (repository root) In one test, Mailsac's REST API is used to check whether an email was received with a specific URL link in the email body. In the other test, Mailsac's realtime Web Socket API is used for the same purpose. + +## More + +- Email testing API overview: https://mailsac.com/pages/email-testing-api/ +- Cypress plugin: [`@mailsac/cypress`](https://www.npmjs.com/package/@mailsac/cypress) +- Playwright guide: https://blog.mailsac.com/playwright-email-testing/ +- Documentation: https://docs.mailsac.com diff --git a/playwright-signup-ci/.env.example b/playwright-signup-ci/.env.example new file mode 100644 index 0000000..38c0b3b --- /dev/null +++ b/playwright-signup-ci/.env.example @@ -0,0 +1,13 @@ +# Mailsac (free account: https://mailsac.com/register) +MAILSAC_API_KEY= +# Optional: your private Mailsac domain, e.g. test.example.com or yourteam.msdc.co. +# Defaults to public @mailsac.com inboxes (anyone can read them; use made-up data). +MAILSAC_DOMAIN= + +# How the app sends mail. Mailsac Email Capture keeps every message in Mailsac: +SMTP_HOST=capture.mailsac.com +SMTP_PORT=5587 +SMTP_SECURE=false +SMTP_USER=your-mailsac-username +SMTP_PASS= # your Mailsac API key +MAIL_FROM="Example App " diff --git a/playwright-signup-ci/.gitignore b/playwright-signup-ci/.gitignore new file mode 100644 index 0000000..bf771ee --- /dev/null +++ b/playwright-signup-ci/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +test-results/ +playwright-report/ +.env diff --git a/playwright-signup-ci/.gitlab-ci.yml b/playwright-signup-ci/.gitlab-ci.yml new file mode 100644 index 0000000..8a505a8 --- /dev/null +++ b/playwright-signup-ci/.gitlab-ci.yml @@ -0,0 +1,38 @@ +# GitLab CI template for this example. GitLab reads .gitlab-ci.yml from the repository root: +# copy this file there in your own project (paths below assume the example is the project root). +# The same two layers on GitLab CI. Set MAILSAC_API_KEY (masked) and MAILSAC_USERNAME +# as CI/CD variables; STAGING_URL enables the scheduled real-delivery job. +default: + image: mcr.microsoft.com/playwright:v1.63.0-noble + before_script: + - npm ci + +email-tests:mailpit: + services: + - name: axllent/mailpit:latest + alias: mailpit + variables: + INBOX: mailpit + MAILPIT_URL: http://mailpit:8025 + SMTP_HOST: mailpit + SMTP_PORT: "1025" + script: + - npx playwright test + artifacts: + when: on_failure + paths: [playwright-report/] + +email-tests:mailsac-capture: + rules: + - if: $MAILSAC_API_KEY + variables: + SMTP_HOST: capture.mailsac.com + SMTP_PORT: "5587" + script: + - SMTP_USER="$MAILSAC_USERNAME" SMTP_PASS="$MAILSAC_API_KEY" npx playwright test + +email-tests:real-delivery: + rules: + - if: $CI_PIPELINE_SOURCE == "schedule" && $MAILSAC_API_KEY && $STAGING_URL + script: + - APP_URL="$STAGING_URL" npx playwright test diff --git a/playwright-signup-ci/README.md b/playwright-signup-ci/README.md new file mode 100644 index 0000000..9c57393 --- /dev/null +++ b/playwright-signup-ci/README.md @@ -0,0 +1,103 @@ +# Email testing in CI/CD: verify signup emails end to end + +A complete, runnable example of testing a **signup verification email** in a CI/CD pipeline. +A Playwright test signs up with a fresh inbox address, waits for the verification email, +checks its content, then confirms the account with the **link** and with the **6-digit code**. +The same pattern covers password resets, magic links and one-time codes. + +It runs in **GitHub Actions** and **GitLab CI** with two layers: + +| Layer | Runs | What it proves | Inbox | +|---|---|---|---| +| Local SMTP catcher | every pull request | the app sends the right email with a working link and code | [Mailpit](https://mailpit.axllent.org) service container | +| Hosted test inbox | on `main`, nightly, or every PR | the email really arrives through your provider, DNS and sending domain | [Mailsac](https://mailsac.com) REST API | + +The local layer is fast and never leaves CI. The hosted layer catches what a local catcher +can't: expired email-provider credentials, SPF/DKIM or DNS mistakes, a throttled or blocked +sending domain, and templates that only break in production. + +## How it works + +``` +Playwright test ──► your app ──SMTP──► email provider / Mailsac Email Capture / Mailpit + ▲ │ + └──────── Mailsac REST API (or Mailpit API) ◄──┘ +``` + +1. `inbox.newAddress()` creates a unique address per test, e.g. `signup-link-mulu72uk-e3dd48fa@mailsac.com`, + so parallel tests and re-runs never read each other's mail. +2. The test signs up in the browser. +3. `inbox.waitForEmail()` polls `GET /api/addresses/{email}/messages` with the `Mailsac-Key` + header until the message arrives (60 s timeout), then reads it with `GET /api/text/{email}/{messageId}`. +4. The test extracts the verification link and code, completes the flow, and deletes the message. + +The code is in [`tests/inbox.ts`](tests/inbox.ts) (about 100 lines, no SDK needed) and +[`tests/signup.spec.ts`](tests/signup.spec.ts). The app in [`app/server.js`](app/server.js) +stands in for yours. + +## Run it + +```bash +cd playwright-signup-ci +npm ci +npx playwright install chromium +``` + +**With Mailpit (no account needed):** + +```bash +docker run -d -p 1025:1025 -p 8025:8025 axllent/mailpit +INBOX=mailpit SMTP_HOST=localhost SMTP_PORT=1025 npx playwright test +``` + +**With Mailsac:** create a free account at [mailsac.com](https://mailsac.com/register) and an +API key, then send through [Email Capture](https://docs.mailsac.com/en/latest/services/email_capture/email_capture.html), +which keeps every message in Mailsac instead of delivering it: + +```bash +export MAILSAC_API_KEY=... # your API key +export SMTP_HOST=capture.mailsac.com SMTP_PORT=5587 SMTP_USER=your-mailsac-username SMTP_PASS=$MAILSAC_API_KEY +npx playwright test +``` + +**Against your deployed app (real delivery):** point the test at staging, which sends through +your real email provider to a Mailsac inbox: + +```bash +APP_URL=https://staging.example.com MAILSAC_API_KEY=... npx playwright test +``` + +## CI setup + +- **GitHub Actions** ([`.github/workflows/playwright-signup-ci.yml`](../.github/workflows/playwright-signup-ci.yml) in this repository; in your own project, save it as `.github/workflows/email-tests.yml` without the `working-directory` default): + add the repository secret `MAILSAC_API_KEY` and the variables `MAILSAC_USERNAME` + (for Email Capture) and `STAGING_URL` (for the nightly real-delivery job). Jobs without their + settings skip themselves, so the Mailpit job works on a fresh fork. +- **GitLab CI** ([`.gitlab-ci.yml`](.gitlab-ci.yml), copy it to your project root): set `MAILSAC_API_KEY` (masked), + `MAILSAC_USERNAME` and `STAGING_URL` as CI/CD variables; schedule a pipeline for real delivery. + +## Public inboxes vs a private test domain + +Addresses at `@mailsac.com` are free, need no setup and accept mail immediately, but anyone who +guesses the address can read them, so send only made-up data. For real signups on staging or +production, use a private domain: your own subdomain (e.g. `test.example.com`) or a zero-setup +`yourteam.msdc.co` subdomain. Set `MAILSAC_DOMAIN` and nothing else changes. + +## Tips for reliable email tests + +- **One address per test.** Never reuse a shared inbox across tests or runs. +- **Poll with a timeout** instead of sleeping. Most messages arrive in seconds; allow up to a minute for real delivery. +- **Assert on content**, not only arrival: subject, link host, code format, unsubscribe footer. +- **Clean up** messages after each test, and keep real-delivery checks on a schedule rather than every commit. +- **Prefer push for long waits:** Mailsac can also deliver each email to a [webhook or WebSocket](https://docs.mailsac.com). + +## Other frameworks + +- Cypress: [`@mailsac/cypress`](https://www.npmjs.com/package/@mailsac/cypress) +- Playwright guide: [blog.mailsac.com/playwright-email-testing](https://blog.mailsac.com/playwright-email-testing/) +- Email testing API overview: [mailsac.com/pages/email-testing-api](https://mailsac.com/pages/email-testing-api/) +- REST API reference: [mailsac.com/docs/api](https://mailsac.com/docs/api) + +## License + +MIT diff --git a/playwright-signup-ci/app/server.js b/playwright-signup-ci/app/server.js new file mode 100644 index 0000000..5d35eac --- /dev/null +++ b/playwright-signup-ci/app/server.js @@ -0,0 +1,85 @@ +// A deliberately small signup app. It stands in for your application: on signup it +// sends a verification email with a link and a 6-digit code over SMTP. Point SMTP_* at +// your real email provider, at Mailsac Email Capture, or at Mailpit in CI. +const crypto = require('node:crypto'); +const express = require('express'); +const nodemailer = require('nodemailer'); + +const PORT = Number(process.env.PORT || 3000); +const APP_URL = process.env.APP_URL || `http://localhost:${PORT}`; +const MAIL_FROM = process.env.MAIL_FROM || 'Example App '; + +const transport = nodemailer.createTransport({ + host: process.env.SMTP_HOST || 'localhost', + port: Number(process.env.SMTP_PORT || 1025), + // true for port 465 (implicit TLS); false upgrades with STARTTLS when the server offers it + secure: process.env.SMTP_SECURE === 'true', + auth: process.env.SMTP_USER ? { user: process.env.SMTP_USER, pass: process.env.SMTP_PASS } : undefined, +}); + +// In-memory store: token -> { email, code, verified } +const pending = new Map(); + +const app = express(); +app.use(express.urlencoded({ extended: false })); + +const page = (title, body) => `${title} +

${title}

${body}
`; +const escape = (s) => String(s).replace(/[&<>"']/g, (c) => `&#${c.charCodeAt(0)};`); + +app.get('/', (req, res) => { + res.send(page('Create an account', ` +
+ + +
`)); +}); + +app.post('/signup', async (req, res, next) => { + try { + const email = String(req.body.email || '').trim(); + const token = crypto.randomBytes(16).toString('hex'); + const code = String(crypto.randomInt(0, 1_000_000)).padStart(6, '0'); + pending.set(token, { email, code, verified: false }); + + const link = `${APP_URL}/verify?token=${token}`; + await transport.sendMail({ + from: MAIL_FROM, + to: email, + subject: 'Confirm your email address', + text: `Welcome!\n\nConfirm your email address: ${link}\n\nOr enter this code: ${code}\n`, + html: `

Welcome!

Confirm your email address

+

Or enter this code: ${code}

`, + }); + + res.send(page('Check your email', ` +

We sent a confirmation link and code to ${escape(email)}.

+
+ + + +
`)); + } catch (err) { + next(err); + } +}); + +const verified = (res, email) => res.send(page('Email verified', `

Your email ${escape(email)} is verified.

`)); + +app.get('/verify', (req, res) => { + const entry = pending.get(String(req.query.token || '')); + if (!entry) return res.status(400).send(page('Invalid link', '

This link is invalid or expired.

')); + entry.verified = true; + verified(res, entry.email); +}); + +app.post('/verify-code', (req, res) => { + const entry = pending.get(String(req.body.token || '')); + if (!entry || entry.code !== String(req.body.code || '').trim()) { + return res.status(400).send(page('Invalid code', '

That code is not correct.

')); + } + entry.verified = true; + verified(res, entry.email); +}); + +app.listen(PORT, () => console.log(`Example app listening on ${APP_URL}`)); diff --git a/playwright-signup-ci/package-lock.json b/playwright-signup-ci/package-lock.json new file mode 100644 index 0000000..2c46803 --- /dev/null +++ b/playwright-signup-ci/package-lock.json @@ -0,0 +1,894 @@ +{ + "name": "email-testing-ci-example", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "email-testing-ci-example", + "version": "1.0.0", + "license": "MIT", + "dependencies": { + "express": "^4.21.2", + "nodemailer": "^6.10.1" + }, + "devDependencies": { + "@playwright/test": "1.63.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@playwright/test": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.63.0.tgz", + "integrity": "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright": "1.63.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/body-parser": { + "version": "1.20.8", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.8.tgz", + "integrity": "sha512-JNcyFQ64OiijEkPzUBTCe+hyPXUD/3LEldGQ6iF5LR1w00mx9o7xtDWHXBY2iItjdCFGoilOLNQbH943ut7pHA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "~1.2.0", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "on-finished": "~2.4.1", + "qs": "~6.16.0", + "raw-body": "~2.5.3", + "type-is": "~1.6.18", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/express": { + "version": "4.22.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.22.3.tgz", + "integrity": "sha512-Bdcs4+3qlpVlx2NRn6fgX2Ue2/gGRaPeawebgclM0ERSCqDpA+owF1fdPwjJUTAJWMTuAaxjDf+hzb0/4eKvvw==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "~1.20.5", + "content-disposition": "~0.5.4", + "content-type": "~1.0.4", + "cookie": "~0.7.1", + "cookie-signature": "~1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "~1.3.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.0", + "merge-descriptors": "1.0.3", + "methods": "~1.1.2", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "~0.1.13", + "proxy-addr": "~2.0.7", + "qs": "~6.16.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "~0.19.0", + "serve-static": "~1.16.2", + "setprototypeof": "1.2.0", + "statuses": "~2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/finalhandler": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.2.tgz", + "integrity": "sha512-aA4RyPcd3badbdABGDuTXCMTtOneUCAYH/gxoYRTZlIJdF0YPWuGqiAsIrhNnnqdXGswYk6dGujem4w80UJFhg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "on-finished": "~2.4.1", + "parseurl": "~1.3.3", + "statuses": "~2.0.2", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.3.tgz", + "integrity": "sha512-gaNvAS7TZ897/rVaZ0nMtAyxNyi/pdbjbAwUpFQpN70GqnVfOiXpeUUMKRBmzXaSQ8DdTX4/0ms62r2K+hE6mQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/nodemailer": { + "version": "6.10.1", + "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-6.10.1.tgz", + "integrity": "sha512-Z+iLaBGVaSjbIzQ4pX6XV41HrooLsQ10ZWPUehGmuantvzWoDVBnmsdUcOIDM1t+yPor5pDhVlDESgOMEGxhHA==", + "license": "MIT-0", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.13.tgz", + "integrity": "sha512-A/AGNMFN3c8bOlvV9RreMdrv7jsmF9XIfDeCd87+I8RNg6s78BhJxMu69NEMHBSJFxKidViTEdruRwEk/WIKqA==", + "license": "MIT" + }, + "node_modules/playwright": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.63.0.tgz", + "integrity": "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "playwright-core": "1.63.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/playwright-core": { + "version": "1.63.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.63.0.tgz", + "integrity": "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz", + "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/qs": { + "version": "6.16.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz", + "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==", + "license": "BSD-3-Clause", + "dependencies": { + "es-define-property": "^1.0.1", + "side-channel": "^1.1.1" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.3.tgz", + "integrity": "sha512-s4VSOf6yN0rvbRZGxs8Om5CWj6seneMwK3oDb4lWDH0UPhWcxwOWw5+qk24bxq87szX1ydrwylIOp2uG1ojUpA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.4.24", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.19.2.tgz", + "integrity": "sha512-VMbMxbDeehAxpOtWJXlcUS5E8iXh6QmN+BkRX1GARS3wRaXEEgzCcB10gTQazO42tpNIya8xIyNx8fll1OFPrg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "~0.5.2", + "http-errors": "~2.0.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.4.1", + "range-parser": "~1.2.1", + "statuses": "~2.0.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/serve-static": { + "version": "1.16.3", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.16.3.tgz", + "integrity": "sha512-x0RTqQel6g5SY7Lg6ZreMmsOzncHFU7nhnRWkKgWuMTu5NN0DR5oruckMqRvacAN9d5w6ARnRBXl9xhDCgfMeA==", + "license": "MIT", + "dependencies": { + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "~0.19.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", + "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4", + "side-channel-list": "^1.0.1", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz", + "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + } + } +} diff --git a/playwright-signup-ci/package.json b/playwright-signup-ci/package.json new file mode 100644 index 0000000..30238cc --- /dev/null +++ b/playwright-signup-ci/package.json @@ -0,0 +1,21 @@ +{ + "name": "email-testing-ci-example", + "version": "1.0.0", + "private": true, + "description": "End-to-end test of a signup verification email in CI/CD with Mailsac and Playwright", + "license": "MIT", + "scripts": { + "start": "node app/server.js", + "test": "playwright test" + }, + "dependencies": { + "express": "^4.21.2", + "nodemailer": "^6.10.1" + }, + "devDependencies": { + "@playwright/test": "1.63.0" + }, + "engines": { + "node": ">=20" + } +} diff --git a/playwright-signup-ci/playwright.config.ts b/playwright-signup-ci/playwright.config.ts new file mode 100644 index 0000000..ed508b8 --- /dev/null +++ b/playwright-signup-ci/playwright.config.ts @@ -0,0 +1,16 @@ +import { defineConfig } from '@playwright/test'; + +const PORT = Number(process.env.PORT || 3000); + +export default defineConfig({ + testDir: './tests', + timeout: 90_000, + retries: process.env.CI ? 1 : 0, + reporter: process.env.CI ? [['list'], ['html', { open: 'never' }]] : 'list', + use: { baseURL: process.env.APP_URL || `http://localhost:${PORT}` }, + // Starts the example app. In your project, point baseURL at your own app or staging URL + // and remove webServer if the app is already running. + webServer: process.env.APP_URL + ? undefined + : { command: 'node app/server.js', url: `http://localhost:${PORT}`, reuseExistingServer: !process.env.CI }, +}); diff --git a/playwright-signup-ci/tests/inbox.ts b/playwright-signup-ci/tests/inbox.ts new file mode 100644 index 0000000..6a2cd7f --- /dev/null +++ b/playwright-signup-ci/tests/inbox.ts @@ -0,0 +1,113 @@ +// Test inboxes for CI. Each test gets a fresh address, waits for the email to arrive, +// and reads it. Two backends share one interface: +// - Mailsac (default): real inboxes you read over the Mailsac REST API. Works with +// Mailsac Email Capture and with real delivery through your email provider. +// - Mailpit: a local SMTP catcher for fast per-pull-request runs (INBOX=mailpit). +import { randomBytes } from 'node:crypto'; + +export type ReceivedEmail = { + id: string; + subject: string; + text: string; + links: string[]; +}; + +export interface TestInbox { + /** A new, unique address for one test. */ + newAddress(prefix?: string): string; + /** Poll until an email for `address` arrives (optionally matching the subject). */ + waitForEmail(address: string, opts?: { subject?: string | RegExp; timeoutMs?: number }): Promise; + /** Remove the message after the test, so private inboxes stay tidy. */ + cleanup(address: string, id: string): Promise; +} + +const unique = (prefix: string) => + `${prefix}-${Date.now().toString(36)}-${randomBytes(4).toString('hex')}`.toLowerCase(); + +const matches = (subject: string, want?: string | RegExp) => + !want || (typeof want === 'string' ? subject.includes(want) : want.test(subject)); + +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + +const extractLinks = (text: string) => [...text.matchAll(/https?:\/\/[^\s"'<>]+/g)].map((m) => m[0]); + +/** Mailsac: https://docs.mailsac.com — authenticate with the Mailsac-Key header. */ +export class MailsacInbox implements TestInbox { + private readonly base = process.env.MAILSAC_API_URL || 'https://mailsac.com/api'; + + constructor( + private readonly apiKey = process.env.MAILSAC_API_KEY, + // Use your own private domain (MAILSAC_DOMAIN=test.example.com) to keep test mail private; + // @mailsac.com inboxes are public, so only send made-up data to them. + private readonly domain = process.env.MAILSAC_DOMAIN || 'mailsac.com', + ) { + if (!this.apiKey) throw new Error('Set MAILSAC_API_KEY (free at https://mailsac.com/register)'); + } + + newAddress(prefix = 'signup') { + return `${unique(prefix)}@${this.domain}`; + } + + private async api(path: string, init: RequestInit = {}) { + const res = await fetch(`${this.base}${path}`, { + ...init, + headers: { 'Mailsac-Key': this.apiKey!, ...(init.headers || {}) }, + }); + if (!res.ok) throw new Error(`Mailsac API ${init.method || 'GET'} ${path}: ${res.status} ${await res.text()}`); + return res; + } + + async waitForEmail(address: string, { subject, timeoutMs = 60_000 }: { subject?: string | RegExp; timeoutMs?: number } = {}) { + const inbox = encodeURIComponent(address); + const deadline = Date.now() + timeoutMs; + while (Date.now() < deadline) { + const messages: Array<{ _id: string; subject: string; links?: string[] }> = + await (await this.api(`/addresses/${inbox}/messages`)).json(); + const message = messages.find((m) => matches(m.subject || '', subject)); + if (message) { + const text = await (await this.api(`/text/${inbox}/${encodeURIComponent(message._id)}`)).text(); + return { id: message._id, subject: message.subject, text, links: message.links?.length ? message.links : extractLinks(text) }; + } + await sleep(2_000); + } + throw new Error(`No email for ${address} within ${timeoutMs / 1000}s`); + } + + async cleanup(address: string, id: string) { + await this.api(`/addresses/${encodeURIComponent(address)}/messages/${encodeURIComponent(id)}`, { method: 'DELETE' }); + } +} + +/** Mailpit: https://mailpit.axllent.org — local SMTP on 1025, API on 8025. */ +export class MailpitInbox implements TestInbox { + constructor(private readonly base = process.env.MAILPIT_URL || 'http://localhost:8025') {} + + newAddress(prefix = 'signup') { + return `${unique(prefix)}@example.test`; + } + + async waitForEmail(address: string, { subject, timeoutMs = 30_000 }: { subject?: string | RegExp; timeoutMs?: number } = {}) { + const deadline = Date.now() + timeoutMs; + while (Date.now() < deadline) { + const res = await fetch(`${this.base}/api/v1/search?query=${encodeURIComponent(`to:"${address}"`)}`); + const { messages = [] } = (await res.json()) as { messages?: Array<{ ID: string; Subject: string }> }; + const message = messages.find((m) => matches(m.Subject || '', subject)); + if (message) { + const full = (await (await fetch(`${this.base}/api/v1/message/${message.ID}`)).json()) as { Text: string; Subject: string }; + return { id: message.ID, subject: full.Subject, text: full.Text, links: extractLinks(full.Text) }; + } + await sleep(500); + } + throw new Error(`No email for ${address} within ${timeoutMs / 1000}s`); + } + + async cleanup(_address: string, id: string) { + await fetch(`${this.base}/api/v1/messages`, { + method: 'DELETE', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ IDs: [id] }), + }); + } +} + +export const testInbox = (): TestInbox => (process.env.INBOX === 'mailpit' ? new MailpitInbox() : new MailsacInbox()); diff --git a/playwright-signup-ci/tests/signup.spec.ts b/playwright-signup-ci/tests/signup.spec.ts new file mode 100644 index 0000000..ab3c2fe --- /dev/null +++ b/playwright-signup-ci/tests/signup.spec.ts @@ -0,0 +1,47 @@ +// End-to-end signup verification: sign up with a fresh address, wait for the +// verification email, then confirm the account with the link and with the code. +import { test, expect } from '@playwright/test'; +import { testInbox } from './inbox'; + +const inbox = testInbox(); + +test.describe('signup verification email', () => { + test('arrives and its link verifies the account', async ({ page }) => { + const address = inbox.newAddress('signup-link'); + + await page.goto('/'); + await page.getByLabel('Email').fill(address); + await page.getByRole('button', { name: 'Sign up' }).click(); + await expect(page.getByRole('heading', { name: 'Check your email' })).toBeVisible(); + + const email = await inbox.waitForEmail(address, { subject: 'Confirm your email address' }); + // assert on content, not only on arrival + expect(email.text).toContain('Confirm your email address'); + const link = email.links.find((l) => l.includes('/verify?token=')); + expect(link, 'verification link in the email').toBeTruthy(); + + await page.goto(link!); + await expect(page.getByRole('heading', { name: 'Email verified' })).toBeVisible(); + await expect(page.getByText(address)).toBeVisible(); + + await inbox.cleanup(address, email.id); + }); + + test('arrives with a 6-digit code that verifies the account', async ({ page }) => { + const address = inbox.newAddress('signup-code'); + + await page.goto('/'); + await page.getByLabel('Email').fill(address); + await page.getByRole('button', { name: 'Sign up' }).click(); + + const email = await inbox.waitForEmail(address, { subject: 'Confirm your email address' }); + const code = email.text.match(/\b(\d{6})\b/)?.[1]; + expect(code, '6-digit code in the email').toMatch(/^\d{6}$/); + + await page.getByLabel('6-digit code').fill(code!); + await page.getByRole('button', { name: 'Verify' }).click(); + await expect(page.getByRole('heading', { name: 'Email verified' })).toBeVisible(); + + await inbox.cleanup(address, email.id); + }); +}); From 3bfa4112618b88e3e4751fb127829af8de0486e2 Mon Sep 17 00:00:00 2001 From: enismaxim1 <42425794+enismaxim1@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:15:43 -0700 Subject: [PATCH 2/4] Run the configuration checks before checkout from the workspace root Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/playwright-signup-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/playwright-signup-ci.yml b/.github/workflows/playwright-signup-ci.yml index 579598f..f99ba00 100644 --- a/.github/workflows/playwright-signup-ci.yml +++ b/.github/workflows/playwright-signup-ci.yml @@ -61,6 +61,7 @@ jobs: steps: - name: Skip when Mailsac is not configured id: configured + working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true' @@ -92,6 +93,7 @@ jobs: steps: - name: Skip when staging is not configured id: configured + working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' && env.APP_URL != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true' From f90b345698e4c04d6e93aa8ff2662a2a045fddf0 Mon Sep 17 00:00:00 2001 From: enismaxim1 <42425794+enismaxim1@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:16:52 -0700 Subject: [PATCH 3/4] Run the configuration checks before checkout from the workspace root Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/playwright-signup-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/playwright-signup-ci.yml b/.github/workflows/playwright-signup-ci.yml index f99ba00..eae59d9 100644 --- a/.github/workflows/playwright-signup-ci.yml +++ b/.github/workflows/playwright-signup-ci.yml @@ -62,6 +62,7 @@ jobs: - name: Skip when Mailsac is not configured id: configured working-directory: . # runs before checkout, when the example folder does not exist yet + working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true' @@ -94,6 +95,7 @@ jobs: - name: Skip when staging is not configured id: configured working-directory: . # runs before checkout, when the example folder does not exist yet + working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' && env.APP_URL != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true' From 5c577cc7d2d4e77c71e0750ce0cd804ba48f3157 Mon Sep 17 00:00:00 2001 From: enismaxim1 <42425794+enismaxim1@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:17:38 -0700 Subject: [PATCH 4/4] Remove duplicated working-directory keys Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/playwright-signup-ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/playwright-signup-ci.yml b/.github/workflows/playwright-signup-ci.yml index eae59d9..f99ba00 100644 --- a/.github/workflows/playwright-signup-ci.yml +++ b/.github/workflows/playwright-signup-ci.yml @@ -62,7 +62,6 @@ jobs: - name: Skip when Mailsac is not configured id: configured working-directory: . # runs before checkout, when the example folder does not exist yet - working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true' @@ -95,7 +94,6 @@ jobs: - name: Skip when staging is not configured id: configured working-directory: . # runs before checkout, when the example folder does not exist yet - working-directory: . # runs before checkout, when the example folder does not exist yet run: echo "ok=${{ env.MAILSAC_API_KEY != '' && env.APP_URL != '' }}" >> "$GITHUB_OUTPUT" - uses: actions/checkout@v4 if: steps.configured.outputs.ok == 'true'