-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into fix/no_live_openai
- Loading branch information
Showing
18 changed files
with
788 additions
and
694 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
import { TEST_BASE_URL } from "../config/config"; | ||
import { prepareUser } from "../helpers/auth"; | ||
import { bypassVercelProtection } from "../helpers/vercel"; | ||
|
||
test("Landing on the site when not onboarded", async ({ page }) => { | ||
await test.step("Setup", async () => { | ||
await bypassVercelProtection(page); | ||
await prepareUser(page, "needs-onboarding"); | ||
await page.goto(`${TEST_BASE_URL}/aila`); | ||
|
||
await page.waitForURL(`${TEST_BASE_URL}/onboarding`); | ||
await expect( | ||
page.getByText("This product is experimental and uses AI"), | ||
).toBeVisible(); | ||
}); | ||
|
||
await test.step("Toggle terms", async () => { | ||
const termsHeading = page.getByRole("heading", { | ||
name: "Terms and Conditions", | ||
exact: true, | ||
}); | ||
await expect(termsHeading).not.toBeVisible(); | ||
|
||
await page.getByText("See terms").click(); | ||
await expect(termsHeading).toBeVisible(); | ||
await page.getByText("See terms").click(); | ||
await expect(termsHeading).not.toBeVisible(); | ||
}); | ||
|
||
await test.step("Submit", async () => { | ||
await page.getByText("I understand").click(); | ||
|
||
await page.waitForURL(`${TEST_BASE_URL}/?reason=onboarded`); | ||
}); | ||
}); | ||
|
||
test("Onboarded without a demo status", async ({ page }) => { | ||
await test.step("Setup", async () => { | ||
await bypassVercelProtection(page); | ||
await prepareUser(page, "needs-demo-status"); | ||
await page.goto(`${TEST_BASE_URL}/aila`); | ||
|
||
await page.waitForURL(`${TEST_BASE_URL}/onboarding`); | ||
await expect(page.getByText("Preparing your account")).toBeVisible(); | ||
}); | ||
|
||
await test.step("Redirect", async () => { | ||
await page.waitForURL(`${TEST_BASE_URL}/?reason=metadata-upgraded`); | ||
}); | ||
}); | ||
|
||
test("Loading onboarding when already onboarded", async ({ page }) => { | ||
await test.step("Setup", async () => { | ||
await bypassVercelProtection(page); | ||
await prepareUser(page, "typical"); | ||
await page.goto(`${TEST_BASE_URL}/onboarding`); | ||
}); | ||
|
||
await test.step("Redirect", async () => { | ||
await page.waitForURL(`${TEST_BASE_URL}/`); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.