From 040ebf3ead137c79ef2dc1eed35954f65104a0ef Mon Sep 17 00:00:00 2001 From: Matthew Meszaros Date: Mon, 9 Nov 2026 20:29:28 +0100 Subject: [PATCH] feat: record the warmup filtering proof flow with its tour-finishing fixture and give the Settings > Sending hide-warmup switch an accessible name --- qa/README.md | 14 +++++++ qa/fixtures/warmup-filtering.sql | 7 ++++ qa/flows/warmup-filtering.flow.ts | 48 +++++++++++++++++++++++ web/src/app/app/settings/sending/page.tsx | 1 + 4 files changed, 70 insertions(+) create mode 100644 qa/fixtures/warmup-filtering.sql create mode 100644 qa/flows/warmup-filtering.flow.ts diff --git a/qa/README.md b/qa/README.md index 4e0daaebd..be60c7e05 100644 --- a/qa/README.md +++ b/qa/README.md @@ -336,6 +336,20 @@ QA_WARMUP_PLACEMENT_FIXTURES=1 pnpm proof warmup-placement The placement numbers are fixture data, not a measurement of real delivery. +## Warmup filtering proof fixtures + +`flows/warmup-filtering.flow.ts` is opt-in: apply `fixtures/warmup-filtering.sql` +to this worktree's rich-seed database. It marks the owner's product tour +finished, clears the workspace's `external_warmup` settings and the seeded +`dev.outbound@warmbly.test` filter tag, so the walkthrough starts from the +defaults. It is re-runnable. Clear the stack's private Redis afterwards. + +```bash +docker exec -i warmbly-postgres-1 psql -U warmbly -d warmbly_qa_ < fixtures/warmup-filtering.sql +docker exec wqa--redis redis-cli FLUSHDB +QA_WARMUP_FILTERING_FIXTURES=1 pnpm proof warmup-filtering +``` + ## Regions and timezones proof fixtures `flows/regions-and-timezones.flow.ts` is opt-in: apply `fixtures/regions-and-timezones.sql` diff --git a/qa/fixtures/warmup-filtering.sql b/qa/fixtures/warmup-filtering.sql new file mode 100644 index 000000000..b8e105105 --- /dev/null +++ b/qa/fixtures/warmup-filtering.sql @@ -0,0 +1,7 @@ +-- The product tour would cover the page; the flow records warmup filtering, not the tour. +UPDATE users SET product_tour_completed_at = now() +WHERE id = '11111111-0000-0000-0000-000000000001' AND product_tour_completed_at IS NULL; +-- Start from the defaults so the walkthrough shows both settings turning on. +UPDATE outreach_settings SET settings = settings - 'external_warmup' +WHERE organization_id IN (SELECT organization_id FROM users u JOIN organization_members m ON m.user_id = u.id WHERE u.id = '11111111-0000-0000-0000-000000000001'); +UPDATE email_accounts SET warmup_filter_tag = NULL WHERE email = 'dev.outbound@warmbly.test'; diff --git a/qa/flows/warmup-filtering.flow.ts b/qa/flows/warmup-filtering.flow.ts new file mode 100644 index 000000000..707f2e9d3 --- /dev/null +++ b/qa/flows/warmup-filtering.flow.ts @@ -0,0 +1,48 @@ +import { expect, test } from "../lib/proof.ts"; + +test.skip(process.env.QA_WARMUP_FILTERING_FIXTURES !== "1", "Apply qa/fixtures/warmup-filtering.sql to this stack's rich-seed database, clear its Redis and set QA_WARMUP_FILTERING_FIXTURES=1."); + +test("hide warmup sent by other services from the inbox", async ({ page, proof }) => { + await page.goto("/app/settings/sending"); + const section = page.getByText("Warmup from other services", { exact: true }); + await section.scrollIntoViewIfNeeded(); + const marker = page.getByRole("switch", { name: "Hide warmup from another Warmbly" }); + await expect(marker).toHaveAttribute("aria-checked", "false"); + await proof.chapter("Warmup from other services", "Off by default: nothing is hidden until the workspace asks"); + await proof.shot("external-warmup-off", { caption: "The new section under Settings > Sending, off by default." }); + + await marker.click(); + await expect(marker).toHaveAttribute("aria-checked", "true"); + const field = page.getByPlaceholder("Paste a warmup tag"); + await field.pressSequentially("re", { delay: 60 }); + await expect(page.getByText(/Use at least 4 characters/)).toBeVisible(); + await proof.shot("external-warmup-short-tag", { caption: "A tag too short to be specific is explained before saving." }); + + await field.fill(""); + await field.pressSequentially("wrm-7q2x", { delay: 60 }); + const saved = page.waitForResponse((r) => r.url().includes("/outreach/settings") && r.request().method() !== "GET" && (r.request().postData() ?? "").includes("wrm-7q2x")); + await page.getByRole("button", { name: "Add", exact: true }).click(); + await expect(page.getByRole("button", { name: "Remove wrm-7q2x" })).toBeVisible(); + expect((await saved).ok()).toBe(true); + await proof.shot("external-warmup-on", { caption: "Another Warmbly's warmup and a tool's warmup tag are now kept out of the inbox." }); +}); + +test("turn on a warmup filter tag for one mailbox", async ({ page, proof }) => { + await page.goto("/app/emails"); + await page.getByRole("row", { name: /dev\.outbound@warmbly\.test/ }).getByText("dev.outbound@warmbly.test", { exact: true }).click(); + await page.getByRole("button", { name: "Warmup", exact: true }).click(); + const toggle = page.getByRole("switch", { name: "Add a filter tag to warmup mail this mailbox receives" }); + await toggle.scrollIntoViewIfNeeded(); + await expect(toggle).toHaveAttribute("aria-checked", "false"); + await proof.chapter("Filter tag", "Opt-in, per mailbox: a code on every warmup email it receives"); + await proof.shot("filter-tag-off", { caption: "Off by default, below where warmup mail is filed." }); + + await toggle.click(); + await expect(toggle).toHaveAttribute("aria-checked", "true"); + await expect(page.getByText(/^[a-z2-9]{4}-[a-z2-9]{4}-[a-z2-9]{4}$/)).toBeVisible(); + await expect(page.getByText(/add a rule for mail whose body contains|In Gmail, search for|In Outlook, add a rule/)).toBeVisible(); + await proof.shot("filter-tag-on", { caption: "A random code with copy, a new-code action and filter steps for the mailbox's provider.", ignore: [page.getByText(/^[a-z2-9]{4}-[a-z2-9]{4}-[a-z2-9]{4}$/)] }); + + await toggle.click(); + await expect(toggle).toHaveAttribute("aria-checked", "false"); +}); diff --git a/web/src/app/app/settings/sending/page.tsx b/web/src/app/app/settings/sending/page.tsx index e36f657b4..fa68cbed7 100644 --- a/web/src/app/app/settings/sending/page.tsx +++ b/web/src/app/app/settings/sending/page.tsx @@ -548,6 +548,7 @@ function SendingSettings() { patchExternalWarmup({ hide_warmbly_marked: on })} + label="Hide warmup from another Warmbly" />