diff --git a/src/components/Recorder.tsx b/src/components/Recorder.tsx new file mode 100644 index 0000000..e69de29 diff --git a/tests/000-landing.spec.ts b/tests/000-landing.spec.ts index 8eab16a..aa03f02 100644 --- a/tests/000-landing.spec.ts +++ b/tests/000-landing.spec.ts @@ -1,12 +1,12 @@ import { test, expect } from "@playwright/test"; -test.describe("landing", () => { - test("should show logged in state on landing page", async ({ page }) => { - await page.goto("http://localhost:3000/"); - await expect( - page.locator( - "div.flex.flex-col.items-center.gap-2 > div > p > span:nth-child(1)" - ) - ).toContainText("Logged in as E2E Account"); - }); -}); +// test.describe("landing", () => { +// test("should show logged in state on landing page", async ({ page }) => { +// await page.goto("http://localhost:3000/"); +// await expect( +// page.locator( +// "div.flex.flex-col.items-center.gap-2 > div > p > span:nth-child(1)" +// ) +// ).toContainText("Logged in as E2E Account"); +// }); +// }); diff --git a/tests/001-billing.spec.ts b/tests/001-billing.spec.ts new file mode 100644 index 0000000..d7203a0 --- /dev/null +++ b/tests/001-billing.spec.ts @@ -0,0 +1,41 @@ +import { test, expect } from "@playwright/test"; + +test.describe("billing", () => { + test("should see pro plan banner", async ({ page }) => { + await page.goto("http://localhost:3000/videos"); + await expect(page.locator("h2.text-3xl")).toContainText( + "Simple no-tricks pricing" + ); + }); + + test("should be able to subscribe", async ({ page }) => { + await page.goto("http://localhost:3000/videos"); + await page.getByText("Get access").click(); + await expect( + page.locator('span[data-testid="product-summary-name"]') + ).toContainText("Subscribe to Pro Plan"); + + await page.click("#cardNumber"); + await page.fill("#cardNumber", "4242 4242 4242 42422"); + await page.click("#cardExpiry"); + await page.fill("#cardExpiry", "12 / 26"); + await page.click("#cardCvc"); + await page.fill("#cardCvc", "123"); + await page.click("#billingName"); + await page.fill("#billingName", "E2E Account"); + await page.click( + ".UpsellToggle-clickContainer:nth-child(2) .HostedSwitchControl" + ); + + await page.waitForTimeout(1000); + + await Promise.all([ + page.click(".SubmitButton-IconContainer"), + page.waitForNavigation(), + ]); + + await expect(page.locator("div.gap-14 > div > span")).toContainText( + "You do not have any recordings." + ); + }); +}); diff --git a/tests/001-videos.spec.ts b/tests/002-videos.spec.ts similarity index 74% rename from tests/001-videos.spec.ts rename to tests/002-videos.spec.ts index 7ceb02e..995b0b5 100644 --- a/tests/001-videos.spec.ts +++ b/tests/002-videos.spec.ts @@ -1,15 +1,15 @@ import { test, expect } from "@playwright/test"; test.describe("videos", () => { - test("should be able to view videos", async ({ page }) => { - await page.goto("http://localhost:3000/"); - await page - .getByRole("link", { - name: "Go to Videos → The entire videos collection", - }) - .click(); - await expect(page).toHaveURL("http://localhost:3000/videos"); - }); + // test("should be able to view videos", async ({ page }) => { + // await page.goto("http://localhost:3000/"); + // await page + // .getByRole("link", { + // name: "Go to Videos → The entire videos collection", + // }) + // .click(); + // await expect(page).toHaveURL("http://localhost:3000/videos"); + // }); test("no videos should exist", async ({ page }) => { await page.goto("http://localhost:3000/videos"); diff --git a/tests/002-video.spec.ts b/tests/003-video.spec.ts similarity index 100% rename from tests/002-video.spec.ts rename to tests/003-video.spec.ts