2024-05-07 06:12:58 -05:00
|
|
|
import { test, expect } from "@playwright/test";
|
2024-05-08 07:22:18 -05:00
|
|
|
import { WorkspacePage } from "../pages/WorkspacePage";
|
2024-05-07 06:12:58 -05:00
|
|
|
import { presenceFixture } from "../../data/workspace/ws-notifications";
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => {
|
2024-05-08 07:22:18 -05:00
|
|
|
await WorkspacePage.init(page);
|
2024-05-07 06:12:58 -05:00
|
|
|
});
|
|
|
|
|
2024-05-08 07:22:18 -05:00
|
|
|
test("User loads worskpace with empty file", async ({ page }) => {
|
|
|
|
const workspacePage = new WorkspacePage(page);
|
|
|
|
await workspacePage.setupEmptyFile(page);
|
2024-05-07 06:12:58 -05:00
|
|
|
|
2024-05-08 07:22:18 -05:00
|
|
|
await workspacePage.goToWorkspace();
|
2024-05-07 06:12:58 -05:00
|
|
|
|
2024-05-08 07:22:18 -05:00
|
|
|
await expect(workspacePage.pageName).toHaveText("Page 1");
|
2024-05-07 06:12:58 -05:00
|
|
|
});
|
|
|
|
|
2024-05-08 07:22:18 -05:00
|
|
|
test("User receives presence notifications updates in the workspace", async ({ page }) => {
|
|
|
|
const workspacePage = new WorkspacePage(page);
|
|
|
|
await workspacePage.setupEmptyFile();
|
|
|
|
|
|
|
|
await workspacePage.goToWorkspace();
|
|
|
|
await workspacePage.sendPresenceMessage(presenceFixture);
|
2024-05-07 06:12:58 -05:00
|
|
|
|
|
|
|
await expect(page.getByTestId("active-users-list").getByAltText("Princesa Leia")).toHaveCount(2);
|
|
|
|
});
|