♻️ Replace Mailcatcher with Mailpit for local email testing

This commit is contained in:
Alejandra
2026-08-11 21:28:55 +02:00
parent b55b3122ab
commit 0eff31727b
9 changed files with 82 additions and 89 deletions
+5 -9
View File
@@ -1,5 +1,5 @@
import { expect, test } from "@playwright/test"
import { findLastEmail } from "./utils/mailcatcher"
import { emailUrl, findLastEmail } from "./utils/mailpit"
import { randomEmail, randomPassword } from "./utils/random"
import { logInUser, signUpNewUser } from "./utils/user"
@@ -46,13 +46,11 @@ test("User can reset password successfully using the link", async ({
const emailData = await findLastEmail({
request,
filter: (e) => e.recipients.includes(`<${email}>`),
query: `to:${email}`,
timeout: 5000,
})
await page.goto(
`${process.env.MAILCATCHER_HOST}/messages/${emailData.id}.html`,
)
await page.goto(emailUrl(emailData))
const selector = 'a[href*="/reset-password?token="]'
@@ -99,13 +97,11 @@ test("Weak new password validation", async ({ page, request }) => {
const emailData = await findLastEmail({
request,
filter: (e) => e.recipients.includes(`<${email}>`),
query: `to:${email}`,
timeout: 5000,
})
await page.goto(
`${process.env.MAILCATCHER_HOST}/messages/${emailData.id}.html`,
)
await page.goto(emailUrl(emailData))
const selector = 'a[href*="/reset-password?token="]'
const url = await page.getAttribute(selector, "href")