2024-05-08 17:30:47 +02:00
|
|
|
import { test, expect } from "@playwright/test";
|
|
|
|
import DashboardPage from "../pages/DashboardPage";
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
|
|
await DashboardPage.init(page);
|
2024-06-25 14:43:40 +02:00
|
|
|
await DashboardPage.mockRPC(page, "get-profile", "logged-in-user/get-profile-logged-in-no-onboarding.json");
|
2024-05-08 17:30:47 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test("Dashboad page has title ", async ({ page }) => {
|
|
|
|
const dashboardPage = new DashboardPage(page);
|
|
|
|
|
2024-05-28 10:29:52 +02:00
|
|
|
await dashboardPage.goToDashboard();
|
2024-05-08 17:30:47 +02:00
|
|
|
|
|
|
|
await expect(dashboardPage.page).toHaveURL(/dashboard/);
|
2024-06-25 14:43:40 +02:00
|
|
|
await expect(dashboardPage.projectsHeading).toBeVisible();
|
2024-05-08 17:30:47 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test("User can create a new project", async ({ page }) => {
|
|
|
|
const dashboardPage = new DashboardPage(page);
|
|
|
|
await dashboardPage.setupNewProject();
|
|
|
|
|
2024-05-28 10:29:52 +02:00
|
|
|
await dashboardPage.goToDashboard();
|
2024-06-25 14:43:40 +02:00
|
|
|
await dashboardPage.addProjectButton.click();
|
2024-05-08 17:30:47 +02:00
|
|
|
|
|
|
|
await expect(dashboardPage.projectName).toBeVisible();
|
|
|
|
});
|
|
|
|
|
|
|
|
test("User goes to draft page", async ({ page }) => {
|
|
|
|
const dashboardPage = new DashboardPage(page);
|
|
|
|
await dashboardPage.setupDraftsEmpty();
|
|
|
|
|
2024-05-28 10:29:52 +02:00
|
|
|
await dashboardPage.goToDashboard();
|
2024-06-25 14:43:40 +02:00
|
|
|
await dashboardPage.draftsLink.click();
|
2024-05-08 17:30:47 +02:00
|
|
|
|
2024-06-25 14:43:40 +02:00
|
|
|
await expect(dashboardPage.draftsTitle).toBeVisible();
|
2024-05-08 17:30:47 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
test("User loads the draft page", async ({ page }) => {
|
|
|
|
const dashboardPage = new DashboardPage(page);
|
|
|
|
await dashboardPage.setupDrafts();
|
|
|
|
|
|
|
|
await dashboardPage.goToDrafts();
|
|
|
|
|
|
|
|
await expect(dashboardPage.draftsFile).toBeVisible();
|
|
|
|
});
|