Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Playwright E2E setup (#3574)

Kiran Kd691fdaa531d
diff --git a/.github/workflows/playwright.yaml b/.github/workflows/playwright.yaml
new file mode 100644
index 0000000000..b1881f70e7
--- /dev/null
+++ b/.github/workflows/playwright.yaml
@@ -0,0 +1,152 @@
+name: Playwright E2E Tests
+
+on:
+ pull_request:
+ branches: [main]
+ paths:
+ - "apps/web/**"
+ - "packages/**"
+ - ".github/workflows/playwright.yaml"
+
+concurrency:
+ group: e2e-${{ github.head_ref }}
+ cancel-in-progress: true
+
+jobs:
+ e2e:
+ permissions:
+ contents: read
+ timeout-minutes: 20
+ runs-on: ubuntu-latest
+
+ env:
+ CI: "true"
+ NODE_OPTIONS: "--max-old-space-size=8192"
+ DATABASE_URL: "mysql://root:@localhost:3306/planetscale"
+ PLANETSCALE_DATABASE_URL: "http://root:unused@localhost:3900/planetscale"
+
+ NEXTAUTH_SECRET: "e2e-test-secret-at-least-32-chars-long"
+ NEXTAUTH_URL: "http://partners.localhost:8888"
+
+ NEXT_PUBLIC_APP_NAME: "Dub"
+ NEXT_PUBLIC_APP_DOMAIN: "dub.co"
+ NEXT_PUBLIC_APP_SHORT_DOMAIN: "dub.sh"
+
+ E2E_PARTNER_EMAIL: "[email protected]"
+ E2E_PARTNER_PASSWORD: "password"
+
+ TINYBIRD_API_KEY: "xx"
+ TINYBIRD_API_URL: "xx"
+
+ UPSTASH_REDIS_REST_URL: "https://sensible-camel-xxxx.upstash.io"
+ UPSTASH_REDIS_REST_TOKEN: "xx"
+ UPSTASH_VECTOR_REST_URL: "https://sensible-camel-xxxx.upstash.io"
+ UPSTASH_VECTOR_REST_TOKEN: "xx"
+ QSTASH_TOKEN: "xx"
+ QSTASH_CURRENT_SIGNING_KEY: "xx"
+ QSTASH_NEXT_SIGNING_KEY: "xx"
+
+ AXIOM_TOKEN: ""
+ AXIOM_DATASET: ""
+
+ RESEND_API_KEY: "xx"
+
+ EMBEDDING_SYNC_SECRET: "xx"
+ ANTHROPIC_API_KEY: "xx"
+
+ STRIPE_SECRET_KEY: "xx"
+ STRIPE_WEBHOOK_SECRET: "xx"
+ STRIPE_CONNECT_WEBHOOK_SECRET: "xx"
+ STRIPE_APP_WEBHOOK_SECRET_TEST: "xx"
+ STRIPE_APP_SECRET_KEY_TEST: "xx"
+ STRIPE_CONNECT_V2_WEBHOOK_SECRET: "xx"
+ STRIPE_APP_SECRET_KEY_SANDBOX: "xx"
+
+ services:
+ mysql:
+ image: mysql:8.0
+ env:
+ MYSQL_DATABASE: planetscale
+ MYSQL_ROOT_HOST: "%"
+ MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
+ options: >-
+ --health-cmd="mysqladmin ping -h 127.0.0.1"
+ --health-interval=10s
+ --health-timeout=5s
+ --health-retries=5
+ ports:
+ - 3306:3306
+
+ steps:
+ - name: Check out code
+ uses: actions/checkout@v4
+
+ - name: Start PlanetScale simulator
+ run: |
+ docker run -d --name ps-http-sim \
+ --network host \
+ ghcr.io/mattrobenolt/ps-http-sim:latest \
+ -listen-addr=0.0.0.0 \
+ -listen-port=3900 \
+ -mysql-dbname=planetscale \
+ -mysql-no-pass \
+ -mysql-addr=127.0.0.1
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v3
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20
+ cache: "pnpm"
+
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Cache Playwright browsers
+ id: playwright-cache
+ uses: actions/cache@v4
+ with:
+ path: ~/.cache/ms-playwright
+ key: playwright-${{ runner.os }}-${{ hashFiles('apps/web/package.json') }}
+
+ - name: Install Playwright Chromium
+ if: steps.playwright-cache.outputs.cache-hit != 'true'
+ run: pnpm --filter web exec playwright install chromium
+
+ - name: Generate Prisma client
+ working-directory: apps/web
+ run: pnpm prisma:generate
+
+ - name: Push database schema
+ working-directory: apps/web
+ run: pnpm prisma:push
+
+ - name: Seed test data
+ working-directory: apps/web
+ run: pnpm tsx playwright/seed.ts
+
+ # - name: Cache Next.js build
+ # uses: actions/cache@v4
+ # with:
+ # path: apps/web/.next/cache
+ # key: nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ hashFiles('apps/web/**/*.ts', 'apps/web/**/*.tsx') }}
+ # restore-keys: |
+ # nextjs-${{ runner.os }}-${{ hashFiles('pnpm-lock.yaml') }}-
+ # nextjs-${{ runner.os }}-
+
+ # - name: Cache Turbo
+ # uses: actions/cache@v4
+ # with:
+ # path: .turbo
+ # key: turbo-${{ runner.os }}-${{ github.sha }}
+ # restore-keys: |
+ # turbo-${{ runner.os }}-
+
+ - name: Build application
+ run: pnpm turbo build --filter=web
+
+ - name: Run Playwright tests
+ working-directory: apps/web
+ run: pnpm test:e2e
diff --git a/.gitignore b/.gitignore
index a232796ce0..8046f4e436 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,4 +44,10 @@ packages/stripe-app/.build/*
.vscode
*.csv
*.ndjson
-.vitest
\ No newline at end of file
+.vitest
+
+# playwright
+playwright-report/
+**/playwright/.auth/
+test-results/
+blob-report/
\ No newline at end of file
diff --git a/apps/web/.env.example b/apps/web/.env.example
index a87a0d2bd3..e8637eea91 100644
--- a/apps/web/.env.example
+++ b/apps/web/.env.example
@@ -187,4 +187,9 @@ SINGULAR_WEBHOOK_TOKEN=
# Hubspot
HUBSPOT_CLIENT_ID=
-HUBSPOT_CLIENT_SECRET=
\ No newline at end of file
+HUBSPOT_CLIENT_SECRET=
+
+# E2E Playwright Tests
+PLAYWRIGHT_BASE_URL=http://partners.localhost:8888
+E2E_PARTNER_EMAIL=
+E2E_PARTNER_PASSWORD=
\ No newline at end of file
diff --git a/apps/web/global-setup.ts b/apps/web/global-setup.ts
new file mode 100644
index 0000000000..3d051cc003
--- /dev/null
+++ b/apps/web/global-setup.ts
@@ -0,0 +1,7 @@
+import "dotenv-flow/config";
+
+import type { FullConfig } from "@playwright/test";
+
+async function globalSetup(_config: FullConfig) {}
+
+export default globalSetup;
diff --git a/apps/web/lib/actions/check-account-exists.ts b/apps/web/lib/actions/check-account-exists.ts
index b097ad57a6..bca10da47d 100644
--- a/apps/web/lib/actions/check-account-exists.ts
+++ b/apps/web/lib/actions/check-account-exists.ts
@@ -4,6 +4,7 @@ import { getIP } from "@/lib/api/utils/get-ip";
import { ratelimit } from "@/lib/upstash";
import { prisma } from "@dub/prisma";
import * as z from "zod/v4";
+import { skipAuthThrottling } from "../api/environment";
import { isSamlEnforcedForEmailDomain } from "../api/workspaces/is-saml-enforced-for-email-domain";
import { emailSchema } from "../zod/schemas/auth";
import { throwIfAuthenticated } from "./auth/throw-if-authenticated";
@@ -20,12 +21,14 @@ export const checkAccountExistsAction = actionClient
.action(async ({ parsedInput }) => {
const { email } = parsedInput;
- const { success } = await ratelimit(8, "1 m").limit(
- `account-exists:${await getIP()}`,
- );
+ if (!skipAuthThrottling) {
+ const { success } = await ratelimit(8, "1 m").limit(
+ `account-exists:${await getIP()}`,
+ );
- if (!success) {
- throw new Error("Too many requests. Please try again later.");
+ if (!success) {
+ throw new Error("Too many requests. Please try again later.");
+ }
}
const [user, isSamlEnforced] = await Promise.all([
diff --git a/apps/web/lib/api/environment.ts b/apps/web/lib/api/environment.ts
new file mode 100644
index 0000000000..495778b738
--- /dev/null
+++ b/apps/web/lib/api/environment.ts
@@ -0,0 +1,5 @@
+export const isProduction = process.env.NODE_ENV === "production";
+export const isLocalDev = process.env.NODE_ENV === "development";
+export const isCI = process.env.CI === "true";
+
+export const skipAuthThrottling = isCI || isLocalDev;
diff --git a/apps/web/lib/auth/options.ts b/apps/web/lib/auth/options.ts
index f1a45ea06c..7eeeed7243 100644
--- a/apps/web/lib/auth/options.ts
+++ b/apps/web/lib/auth/options.ts
@@ -18,6 +18,7 @@ import EmailProvider from "next-auth/providers/email";
import GithubProvider from "next-auth/providers/github";
import GoogleProvider from "next-auth/providers/google";
import { createId } from "../api/create-id";
+import { isProduction, skipAuthThrottling } from "../api/environment";
import { isSamlEnforcedForEmailDomain } from "../api/workspaces/is-saml-enforced-for-email-domain";
import { qstash } from "../cron";
import { completeProgramApplications } from "../partners/complete-program-applications";
@@ -52,16 +53,16 @@ export const authOptions: NextAuthOptions = {
providers: [
EmailProvider({
sendVerificationRequest({ identifier, url }) {
- if (process.env.NODE_ENV === "development") {
+ if (!isProduction) {
console.log(`Login link: ${url}`);
return;
- } else {
- sendEmail({
- to: identifier,
- subject: `Your ${process.env.NEXT_PUBLIC_APP_NAME} Login Link`,
- react: LoginLink({ url, email: identifier }),
- });
}
+
+ sendEmail({
+ to: identifier,
+ subject: `Your ${process.env.NEXT_PUBLIC_APP_NAME} Login Link`,
+ react: LoginLink({ url, email: identifier }),
+ });
},
}),
GoogleProvider({
@@ -222,12 +223,14 @@ export const authOptions: NextAuthOptions = {
throw new Error("no-credentials");
}
- const { success } = await ratelimit(5, "1 m").limit(
- `login-attempts:${email}`,
- );
+ if (!skipAuthThrottling) {
+ const { success } = await ratelimit(5, "1 m").limit(
+ `login-attempts:${email}`,
+ );
- if (!success) {
- throw new Error("too-many-login-attempts");
+ if (!success) {
+ throw new Error("too-many-login-attempts");
+ }
}
// SSO enforcement check
diff --git a/apps/web/package.json b/apps/web/package.json
index 19f0a10355..d095a54c62 100644
--- a/apps/web/package.json
+++ b/apps/web/package.json
@@ -9,6 +9,9 @@
"start": "next start",
"script": "tsx ./scripts/run.ts",
"test": "pnpm prisma:generate && vitest -no-file-parallelism --bail=1",
+ "test:e2e": "playwright test",
+ "test:e2e:ui": "playwright test --ui",
+ "test:e2e:headed": "playwright test --headed",
"generate-openapi": "tsx ./scripts/generate-openapi.ts",
"prisma:generate": "dotenv-flow -e .env -- pnpm --filter=@dub/prisma generate",
"prisma:push": "dotenv-flow -e .env -- pnpm --filter=@dub/prisma push",
@@ -159,6 +162,7 @@
"typescript": "^5.4.4",
"vite": "7.2.2",
"vite-tsconfig-paths": "5.1.4",
+ "@playwright/test": "^1.52.0",
"vitest": "4.0.8"
},
"browser": {
diff --git a/apps/web/playwright.config.ts b/apps/web/playwright.config.ts
new file mode 100644
index 0000000000..54b006a21e
--- /dev/null
+++ b/apps/web/playwright.config.ts
@@ -0,0 +1,41 @@
+import { defineConfig, devices } from "@playwright/test";
+
+export default defineConfig({
+ globalSetup: require.resolve("./global-setup"),
+ testDir: "./playwright",
+ fullyParallel: false,
+ forbidOnly: !!process.env.CI,
+ retries: 1,
+ workers: process.env.CI ? 1 : undefined,
+ reporter: process.env.CI
+ ? [["list"], ["html", { outputFolder: "playwright-report" }]]
+ : [["html", { open: "always" }]],
+ expect: {
+ timeout: 30000,
+ },
+ use: {
+ baseURL:
+ process.env.PLAYWRIGHT_BASE_URL || "http://partners.localhost:8888",
+ trace: "on-first-retry",
+ screenshot: "only-on-failure",
+ },
+ projects: [
+ { name: "setup", testMatch: /auth\.setup\.ts/ },
+ {
+ name: "chromium",
+ use: {
+ ...devices["Desktop Chrome"],
+ storageState: "playwright/.auth/partner.json",
+ },
+ dependencies: ["setup"],
+ },
+ ],
+ webServer: process.env.CI
+ ? {
+ command: "pnpm start -p 8888",
+ port: 8888,
+ reuseExistingServer: true,
+ timeout: 120_000,
+ }
+ : undefined,
+});
diff --git a/apps/web/playwright/README.md b/apps/web/playwright/README.md
new file mode 100644
index 0000000000..a4cd33b155
--- /dev/null
+++ b/apps/web/playwright/README.md
@@ -0,0 +1,37 @@
+# E2E Tests (Playwright)
+
+## Prerequisites
+
+1. Install Chromium (one-time):
+
+ ```sh
+ pnpm --filter web exec playwright install chromium
+ ```
+
+2. Set environment variables in `apps/web/.env`:
+
+ ```sh
+ # Required for credential-based tests
+ E2E_PARTNER_PASSWORD=your-test-password
+
+ # Optional — defaults to http://partners.localhost:8888
+ PLAYWRIGHT_BASE_URL=http://partners.localhost:8888
+ ```
+
+ The test user must exist in your local database with a password and ideally a partner profile. Partner onboarding tests use the same credentials; the onboarding flow will create or update the partner record (no separate onboarding-only user required).
+
+## Running tests
+
+Make sure the dev server is running first (`pnpm dev`), then:
+
+```sh
+# Headless (default)
+pnpm --filter web test:e2e
+
+# With browser visible
+pnpm --filter web test:e2e:headed
+
+# Interactive UI mode
+pnpm --filter web test:e2e:ui
+```
diff --git a/apps/web/playwright/auth.setup.ts b/apps/web/playwright/auth.setup.ts
new file mode 100644
index 0000000000..dc5229e92e
--- /dev/null
+++ b/apps/web/playwright/auth.setup.ts
@@ -0,0 +1,17 @@
+import { expect, test as setup } from "@playwright/test";
+import { env } from "./env";
+
+const authFile = "playwright/.auth/partner.json";
+
+setup("authenticate as partner", async ({ page }) => {
+ await page.goto("/login");
+ await page.locator('input[name="email"]').fill(env.E2E_PARTNER_EMAIL);
+ await page.getByRole("button", { name: "Log in with email" }).click();
+ await expect(page.locator('input[type="password"]')).toBeVisible();
+ await page.locator('input[type="password"]').fill(env.E2E_PARTNER_PASSWORD);
+ await page.getByRole("button", { name: "Log in with password" }).click();
+ await page.waitForURL((url) =>
+ /^\/(programs|onboarding)/.test(new URL(url).pathname),
+ );
+ await page.context().storageState({ path: authFile });
+});
diff --git a/apps/web/playwright/env.ts b/apps/web/playwright/env.ts
new file mode 100644
index 0000000000..a36dde8950
--- /dev/null
+++ b/apps/web/playwright/env.ts
@@ -0,0 +1,12 @@
+/// <reference types="node" />
+
+import * as z from "zod/v4";
+
+const envSchema = z.object({
+ E2E_PARTNER_EMAIL: z.email(),
+ E2E_PARTNER_PASSWORD: z.string().min(1),
+});
+
+const env = envSchema.parse(process.env);
+
+export { env };
diff --git a/apps/web/playwright/partner-login.spec.ts b/apps/web/playwright/partner-login.spec.ts
new file mode 100644
index 0000000000..6178e08ea1
--- /dev/null
+++ b/apps/web/playwright/partner-login.spec.ts
@@ -0,0 +1,77 @@
+import { expect, test } from "@playwright/test";
+import { env } from "./env";
+
+test.use({
+ storageState: {
+ cookies: [],
+ origins: [],
+ },
+});
+
+test.describe("Partner Login", () => {
+ test("login page renders correctly", async ({ page }) => {
+ await page.goto("/login");
+
+ await expect(
+ page.getByRole("heading", {
+ name: "Log in to your Dub Partner account",
+ }),
+ ).toBeVisible();
+
+ await expect(page.locator('input[name="email"]')).toBeVisible();
+
+ await expect(
+ page.getByRole("button", {
+ name: "Log in with email",
+ }),
+ ).toBeVisible();
+ });
+
+ test("shows error for invalid email", async ({ page }) => {
+ await page.goto("/login");
+
+ await page.locator('input[name="email"]').fill("[email protected]");
+ await page.getByRole("button", { name: "Log in with email" }).click();
+
+ await expect(
+ page.getByText("No account found with that email address."),
+ ).toBeVisible();
+ });
+
+ test("login with email and password", async ({ page }) => {
+ await page.goto("/login");
+
+ // Enter email and submit to trigger account check
+ await page.locator('input[name="email"]').fill(env.E2E_PARTNER_EMAIL);
+ await page.getByRole("button", { name: "Log in with email" }).click();
+
+ // Wait for password field to appear
+ await expect(page.locator('input[type="password"]')).toBeVisible();
+
+ // Enter password and submit
+ await page.locator('input[type="password"]').fill(env.E2E_PARTNER_PASSWORD);
+ await page.getByRole("button", { name: "Log in with password" }).click();
+
+ // Verify redirect to authenticated area
+ await page.waitForURL((url) =>
+ /^\/(programs|onboarding)/.test(new URL(url).pathname),
+ );
+ await expect(page).not.toHaveURL(/\/login/);
+ });
+
+ test("shows error for wrong password", async ({ page }) => {
+ await page.goto("/login");
+
+ await page.locator('input[name="email"]').fill(env.E2E_PARTNER_EMAIL);
+ await page.getByRole("button", { name: "Log in with email" }).click();
+
+ await expect(page.locator('input[type="password"]')).toBeVisible();
+
+ await page.locator('input[type="password"]').fill("wrongpassword123");
+ await page.getByRole("button", { name: "Log in with password" }).click();
+
+ await expect(
+ page.getByText("Email or password is incorrect."),
+ ).toBeVisible();
+ });
+});
diff --git a/apps/web/playwright/partner-onboarding.spec.ts b/apps/web/playwright/partner-onboarding.spec.ts
new file mode 100644
index 0000000000..cb28d237d9
--- /dev/null
+++ b/apps/web/playwright/partner-onboarding.spec.ts
@@ -0,0 +1,123 @@
+import { expect, test } from "@playwright/test";
+
+test.describe("Partner onboarding (unauthenticated)", () => {
+ test.use({ storageState: { cookies: [], origins: [] } });
+
+ test("unauthenticated redirect to login", async ({ page }) => {
+ await page.goto("/onboarding");
+ await expect(page).toHaveURL(/\/login/);
+ });
+});
+
+test.describe("Partner onboarding", () => {
+ test("onboarding page renders", async ({ page }) => {
+ await page.goto("/onboarding");
+
+ await expect(
+ page.getByRole("heading", { name: "Create your partner profile" }),
+ ).toBeVisible();
+ await expect(page.locator('input[name="name"]')).toBeVisible();
+ await expect(page.getByText("Profile image")).toBeVisible();
+ await expect(page.getByLabel("Country")).toBeVisible();
+ await expect(
+ page.getByLabel(/Description/, { exact: false }),
+ ).toBeVisible();
+ await expect(page.getByText("Profile Type")).toBeVisible();
+ await expect(page.getByRole("button", { name: "Continue" })).toBeVisible();
+ });
+
+ test("profile submit redirects to platforms", async ({ page }) => {
+ await page.goto("/onboarding");
+
+ const nameInput = page.locator('input[name="name"]');
+ const countryField = page.getByLabel("Country");
+ const searchCountriesInput = page.getByPlaceholder("Search countries...");
+ const continueButton = page.getByRole("button", { name: "Continue" });
+ const acknowledgeButton = page.getByRole("button", {
+ name: "I acknowledge",
+ });
+
+ await nameInput.fill("E2E Onboarding Test");
+ await countryField.click();
+
+ if (
+ await acknowledgeButton.isVisible({ timeout: 2000 }).catch(() => false)
+ ) {
+ await acknowledgeButton.click();
+ }
+
+ await expect(searchCountriesInput).toBeVisible({
+ timeout: 5000,
+ });
+ await searchCountriesInput.fill("United States");
+ await page.getByText("United States", { exact: true }).first().click();
+
+ await continueButton.click();
+
+ await page.waitForURL(/\/onboarding\/platforms/);
+ await expect(
+ page.getByRole("heading", {
+ name: "Your social and web platforms",
+ }),
+ ).toBeVisible();
+ });
+
+ test("platforms step skip link goes to payouts or programs", async ({
+ page,
+ }) => {
+ await page.goto("/onboarding");
+
+ const nameInput = page.locator('input[name="name"]');
+ const countryField = page.getByLabel("Country");
+ const searchCountriesInput = page.getByPlaceholder("Search countries...");
+ const continueButton = page.getByRole("button", { name: "Continue" });
+ const skipLink = page.getByRole("link", {
+ name: "I'll complete this later",
+ });
+ const acknowledgeButton = page.getByRole("button", {
+ name: "I acknowledge",
+ });
+
+ await nameInput.fill("E2E Onboarding Test");
+ await countryField.click();
+
+ if (
+ await acknowledgeButton.isVisible({ timeout: 2000 }).catch(() => false)
+ ) {
+ await acknowledgeButton.click();
+ }
+
+ await expect(searchCountriesInput).toBeVisible({
+ timeout: 5000,
+ });
+ await searchCountriesInput.fill("United States");
+ await page.getByText("United States", { exact: true }).first().click();
+ await continueButton.click();
+ await page.waitForURL(/\/onboarding\/platforms/);
+
+ await skipLink.click();
+
+ await expect(page).toHaveURL(/\/(onboarding\/payouts|programs)/);
+ if (page.url().includes("/onboarding/payouts")) {
+ await expect(
+ page.getByRole("heading", { name: "Connect payouts" }),
+ ).toBeVisible();
+ }
+ });
+
+ test("payouts step skip link goes to programs", async ({ page }) => {
+ await page.goto("/onboarding/payouts");
+
+ await page.waitForURL(/\/(onboarding\/payouts|programs)/);
+
+ if (page.url().includes("/programs")) {
+ return;
+ }
+
+ const skipLink = page.getByRole("link", {
+ name: "I'll complete this later",
+ });
+ await skipLink.click();
+ await expect(page).toHaveURL(/\/programs/);
+ });
+});
diff --git a/apps/web/playwright/seed.ts b/apps/web/playwright/seed.ts
new file mode 100644
index 0000000000..aaa09229c5
--- /dev/null
+++ b/apps/web/playwright/seed.ts
@@ -0,0 +1,68 @@
+import "dotenv-flow/config";
+
+import { PrismaClient } from "@prisma/client";
+import { hashSync } from "bcryptjs";
+
+const prisma = new PrismaClient();
+
+const E2E_PARTNER = {
+ name: "Partner 1",
+ email: "[email protected]",
+ password: "password",
+};
+
+async function main() {
+ const passwordHash = hashSync(E2E_PARTNER.password, 10);
+
+ const user = await prisma.user.upsert({
+ where: {
+ email: E2E_PARTNER.email,
+ },
+ update: {},
+ create: {
+ email: E2E_PARTNER.email,
+ name: E2E_PARTNER.name,
+ emailVerified: new Date(),
+ passwordHash,
+ },
+ });
+
+ const partner = await prisma.partner.upsert({
+ where: {
+ email: E2E_PARTNER.email,
+ },
+ update: {},
+ create: {
+ name: E2E_PARTNER.name,
+ email: E2E_PARTNER.email,
+ country: "US",
+ users: {
+ create: {
+ userId: user.id,
+ role: "owner",
+ },
+ },
+ },
+ });
+
+ await prisma.user.update({
+ where: {
+ id: user.id,
+ },
+ data: {
+ defaultPartnerId: partner.id,
+ },
+ });
+
+ console.log("Seeded test partner:", {
+ userId: user.id,
+ partnerId: partner.id,
+ });
+}
+
+main()
+ .catch((e) => {
+ console.error(e);
+ process.exit(1);
+ })
+ .finally(() => prisma.$disconnect());
diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json
index 4c7a360836..8d9d479a08 100644
--- a/apps/web/tsconfig.json
+++ b/apps/web/tsconfig.json
@@ -38,5 +38,5 @@
"../../packages/blocks/src/event-list.tsx",
"../../packages/ui/src/hooks/use-pagination.ts"
],
- "exclude": ["node_modules"]
+ "exclude": ["node_modules", "playwright"]
}
diff --git a/package.json b/package.json
index be78aebc28..78b89077fd 100644
--- a/package.json
+++ b/package.json
@@ -32,5 +32,5 @@
"resolutions": {
"chrono-node": "2.7.5"
},
- "packageManager": "[email protected]"
+ "packageManager": "[email protected]"
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f8850d217b..5e951d0511 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -52,7 +52,7 @@ importers:
version: 0.1.5(@axiomhq/[email protected])
'@axiomhq/nextjs':
specifier: ^0.1.6
'@better-fetch/fetch':
specifier: ^1.1.21
version: 1.1.21
@@ -94,7 +94,7 @@ importers:
version: 1.29.1
'@next-auth/prisma-adapter':
specifier: ^1.0.7
'@number-flow/react':
specifier: ^0.4.1
@@ -244,7 +244,7 @@ importers:
version: 6.6.2
geist:
specifier: ^1.3.1
he:
specifier: ^1.2.0
version: 1.2.0
@@ -292,16 +292,16 @@ importers:
version: 5.0.1
next:
specifier: 15.5.8
next-auth:
specifier: 4.24.11
next-plausible:
specifier: ^3.12.0
next-safe-action:
specifier: ^8.0.11
node-html-parser:
specifier: ^6.1.4
version: 6.1.4
@@ -396,6 +396,9 @@ importers:
specifier: 5.4.6
version: 5.4.6([email protected])
devDependencies:
+ '@playwright/test':
+ specifier: ^1.52.0
+ version: 1.58.2
'@types/he':
specifier: ^1.2.3
version: 1.2.3
@@ -574,7 +577,7 @@ importers:
devDependencies:
'@react-email/preview-server':
specifier: 5.2.8
'@types/nodemailer':
specifier: ~6.4.17
version: 6.4.17
@@ -654,7 +657,7 @@ importers:
dependencies:
'@hubspot/cli':
specifier: ^7.6.2
devDependencies:
'@types/node':
specifier: 18.11.9
@@ -937,7 +940,7 @@ importers:
version: 10.4.16([email protected])
next:
specifier: 15.5.8
postcss:
specifier: ^8.4.31
version: 8.4.31
@@ -1001,7 +1004,7 @@ importers:
version: 19.1.15
next:
specifier: 15.5.8
react:
specifier: ^19.1.3
version: 19.1.3
@@ -3437,6 +3440,11 @@ packages:
resolution: {integrity: sha512-Tv4jcFUFAFjOWrGSio49H6R2ijALv0ZzVBfJKIdm+kl9X046Fh4LLawrF9OMsglVbK6ukqMJsUCeucGAFTBcMA==}
engines: {node: '>=16'}
+ '@playwright/[email protected]':
+ resolution: {integrity: sha512-akea+6bHYBBfA9uQqSYmlJXn61cTa+jbO87xVLCWbTqbWadRVmhxlXATaOjOgcBaWU4ePo0wB41KMFv3o35IXA==}
+ engines: {node: '>=18'}
+ hasBin: true
+
resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==}
engines: {node: '>=12.22.0'}
@@ -8461,6 +8469,11 @@ packages:
resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==}
+ resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==}
+ engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
+ os: [darwin]
+
resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==}
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
@@ -10892,6 +10905,16 @@ packages:
resolution: {integrity: sha512-SIqCzDRg0s9npO5XQ3tNZioRY1uK06lA41ynBC1YmFTmnY6FjUjVt6s4LoADmwoig1qqD0oK8h1p/8mlMx8Oig==}
+ resolution: {integrity: sha512-yZkEtftgwS8CsfYo7nm0KE8jsvm6i/PTgVtB8DL726wNf6H2IMsDuxCpJj59KDaxCtSnrWan2AeDqM7JBaultg==}
+ engines: {node: '>=18'}
+ hasBin: true
+
+ resolution: {integrity: sha512-vA30H8Nvkq/cPBnNw4Q8TWz1EJyqgpuinBcHET0YVJVFldr8JDNiU9LaWAE1KqSkRYazuaBhTpB5ZzShOezQ6A==}
+ engines: {node: '>=18'}
+ hasBin: true
+
resolution: {integrity: sha512-OBatVyC/N7SCW/FaDHrSd+vn0o5cS855TOmYi4OkdWUMSJCET/xip//ch8xGUvtr3i44X9LVyWwQlRMTN3pwSA==}
engines: {node: '>=10'}
@@ -14201,10 +14224,10 @@ snapshots:
optionalDependencies:
'@axiomhq/js': 1.3.1
dependencies:
'@axiomhq/logging': 0.1.5(@axiomhq/[email protected])
dependencies:
@@ -14533,9 +14556,9 @@ snapshots:
'@babel/core': 7.24.5
'@babel/helper-plugin-utils': 7.25.9
dependencies:
- '@babel/core': 7.24.5
+ '@babel/core': 7.28.4
'@babel/helper-plugin-utils': 7.27.1
optional: true
@@ -15365,7 +15388,7 @@ snapshots:
- encoding
- supports-color
dependencies:
'@hubspot/local-dev-lib': 3.19.1
'@hubspot/project-parsing-lib': 0.8.6(@hubspot/[email protected])
@@ -15396,7 +15419,7 @@ snapshots:
yargs: 17.7.2
yargs-parser: 21.1.1
optionalDependencies:
'@modelcontextprotocol/sdk': 1.13.3
transitivePeerDependencies:
- '@babel/core'
@@ -15434,7 +15457,7 @@ snapshots:
react-dom: 18.3.1([email protected])
optional: true
dependencies:
'@babel/code-frame': 7.26.2
'@babel/parser': 7.26.2
@@ -15461,7 +15484,7 @@ snapshots:
'@vitejs/plugin-react': 4.7.0([email protected](@types/[email protected])([email protected]))
ansi-to-html: 0.7.2
babel-plugin-macros: 3.1.0
chalk: 5.4.1
class-variance-authority: 0.7.0
cli-progress: 3.12.0
@@ -15480,7 +15503,7 @@ snapshots:
react-dom: 18.3.1([email protected])
request: 2.88.2
storybook: 8.6.14([email protected])
tailwind-merge: 2.6.0
tailwindcss-animate: 1.0.7
typescript: 4.7.4
@@ -16228,10 +16251,10 @@ snapshots:
dependencies:
sparse-bitfield: 3.0.3
dependencies:
'@next/[email protected]': {}
@@ -16512,6 +16535,10 @@ snapshots:
'@planetscale/[email protected]': {}
+ '@playwright/[email protected]':
+ dependencies:
+ playwright: 1.58.2
+
'@pnpm/[email protected]': {}
@@ -17709,10 +17736,10 @@ snapshots:
marked: 15.0.12
react: 19.1.3
dependencies:
esbuild: 0.25.10
transitivePeerDependencies:
- '@babel/core'
- '@opentelemetry/api'
@@ -20499,11 +20526,11 @@ snapshots:
resolve: 1.22.6
optional: true
dependencies:
'@babel/helper-annotate-as-pure': 7.27.3
'@babel/helper-module-imports': 7.25.9
- '@babel/plugin-syntax-jsx': 7.27.1(@babel/[email protected])
+ '@babel/plugin-syntax-jsx': 7.27.1(@babel/[email protected])
lodash: 4.17.21
picomatch: 2.3.1
@@ -22750,6 +22777,9 @@ snapshots:
+ optional: true
+
optional: true
@@ -22796,9 +22826,9 @@ snapshots:
- encoding
- supports-color
dependencies:
dependencies:
@@ -25246,13 +25276,13 @@ snapshots:
dependencies:
'@babel/runtime': 7.23.9
'@panva/hkdf': 1.2.1
cookie: 0.7.2
jose: 4.15.9
oauth: 0.9.15
openid-client: 5.7.1
preact: 10.24.3
@@ -25263,19 +25293,19 @@ snapshots:
optionalDependencies:
nodemailer: 6.9.3
dependencies:
react: 19.1.3
react-dom: 19.1.3([email protected])
dependencies:
react: 19.1.3
react-dom: 19.1.3([email protected])
dependencies:
'@next/env': 15.5.8
'@swc/helpers': 0.5.15
@@ -25294,12 +25324,13 @@ snapshots:
'@next/swc-win32-arm64-msvc': 15.5.7
'@next/swc-win32-x64-msvc': 15.5.7
'@opentelemetry/api': 1.9.0
+ '@playwright/test': 1.58.2
sharp: 0.34.4
transitivePeerDependencies:
- '@babel/core'
- babel-plugin-macros
dependencies:
'@next/env': 16.1.6
'@swc/helpers': 0.5.15
@@ -25319,6 +25350,7 @@ snapshots:
'@next/swc-win32-arm64-msvc': 16.1.6
'@next/swc-win32-x64-msvc': 16.1.6
'@opentelemetry/api': 1.9.0
+ '@playwright/test': 1.58.2
sharp: 0.34.4
transitivePeerDependencies:
- '@babel/core'
@@ -25824,6 +25856,14 @@ snapshots:
exsolve: 1.0.8
pathe: 2.0.3
+
+ dependencies:
+ playwright-core: 1.58.2
+ optionalDependencies:
+ fsevents: 2.3.2
+
dependencies:
'@babel/runtime': 7.23.9
@@ -27577,12 +27617,12 @@ snapshots:
tslib: 2.6.2
optional: true
dependencies:
client-only: 0.0.1
react: 18.3.1
optionalDependencies:
- '@babel/core': 7.24.5
+ '@babel/core': 7.28.4
babel-plugin-macros: 3.1.0
optional: true