2024-06-07 13:35:04 +02:00
|
|
|
import { test, expect } from "@playwright/test";
|
|
|
|
import DashboardPage from "../pages/DashboardPage";
|
2024-07-01 10:28:40 +02:00
|
|
|
import OnboardingPage from "../pages/OnboardingPage";
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
await DashboardPage.init(page);
|
2024-07-01 10:28:40 +02:00
|
|
|
await DashboardPage.mockRPC(
|
|
|
|
page,
|
|
|
|
"get-profile",
|
|
|
|
"logged-in-user/get-profile-logged-in.json",
|
|
|
|
);
|
2024-06-07 13:35:04 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test("User can complete the onboarding", async ({ page }) => {
|
|
|
|
const dashboardPage = new DashboardPage(page);
|
|
|
|
const onboardingPage = new OnboardingPage(page);
|
|
|
|
|
2024-05-28 10:29:52 +02:00
|
|
|
await dashboardPage.goToDashboard();
|
2024-07-01 10:28:40 +02:00
|
|
|
await expect(
|
|
|
|
page.getByRole("heading", { name: "Help us get to know you" }),
|
|
|
|
).toBeVisible();
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
await onboardingPage.fillOnboardingInputsStep1();
|
2024-07-01 10:28:40 +02:00
|
|
|
await expect(
|
|
|
|
page.getByRole("heading", { name: "Which one of these tools do" }),
|
|
|
|
).toBeVisible();
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
await onboardingPage.fillOnboardingInputsStep2();
|
2024-07-01 10:28:40 +02:00
|
|
|
await expect(
|
|
|
|
page.getByRole("heading", { name: "Tell us about your job" }),
|
|
|
|
).toBeVisible();
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
await onboardingPage.fillOnboardingInputsStep3();
|
2024-07-01 10:28:40 +02:00
|
|
|
await expect(
|
|
|
|
page.getByRole("heading", { name: "Where would you like to get" }),
|
|
|
|
).toBeVisible();
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
await onboardingPage.fillOnboardingInputsStep4();
|
2024-07-01 10:28:40 +02:00
|
|
|
await expect(
|
|
|
|
page.getByRole("heading", { name: "How did you hear about Penpot?" }),
|
|
|
|
).toBeVisible();
|
2024-06-07 13:35:04 +02:00
|
|
|
|
|
|
|
await onboardingPage.fillOnboardingInputsStep5();
|
|
|
|
await expect(page.getByRole("button", { name: "Start" })).toBeEnabled();
|
|
|
|
});
|