From 8e58538d4bff2628399a902e61491bc4e24e73f1 Mon Sep 17 00:00:00 2001 From: Sean Brydon Date: Tue, 19 Sep 2023 15:21:52 +0100 Subject: [PATCH] Self hosted test - for premium username --- apps/web/playwright/signup.e2e.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/web/playwright/signup.e2e.ts b/apps/web/playwright/signup.e2e.ts index cb9988fca5..6069b633ea 100644 --- a/apps/web/playwright/signup.e2e.ts +++ b/apps/web/playwright/signup.e2e.ts @@ -85,16 +85,31 @@ test.describe("Signup Flow Test", async () => { // Check that stripe checkout is present const expectedUrl = "https://checkout.stripe.com"; // Adjust the expected URL - const regexPattern = /^https:\/\/checkout\.stripe\.com\/.*/; - - await page.waitForURL(new RegExp(regexPattern)); + await page.waitForURL((url) => url.pathname.includes(expectedUrl)); const url = page.url(); // Check that the URL matches the expected URL expect(url).toContain(expectedUrl); // TODO: complete the stripe checkout flow }); + test("Premium Username Flow - SelfHosted", async ({ page, users }) => { + // eslint-disable-next-line playwright/no-skipped-test + test.skip(IS_CALCOM, "Only run on Selfhosted Instances"); + + // Signup with premium username name + await page.goto("/signup"); + + // Fill form + await page.locator('input[name="username"]').fill("rick"); + await page.locator('input[name="email"]').fill("rick@example.com"); + await page.locator('input[name="password"]').fill("Password99!"); + + await page.click('button[type="submit"]'); + await page.waitForURL((url) => url.pathname.includes("/auth/verify-email")); + + expect(page.url()).toContain("/auth/verify-email"); + }); test("Signup with valid (non premium) username", async ({ page, users }) => { await page.goto("/signup");