0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-20 21:52:35 -05:00
penpot/frontend/playwright/ui/specs/workspace.spec.js

41 lines
1.4 KiB
JavaScript
Raw Normal View History

2024-05-07 13:12:58 +02:00
import { test, expect } from "@playwright/test";
import { WorkspacePage } from "../pages/WorkspacePage";
2024-05-07 13:12:58 +02:00
import { presenceFixture } from "../../data/workspace/ws-notifications";
test.beforeEach(async ({ page }) => {
await WorkspacePage.init(page);
2024-05-07 13:12:58 +02:00
});
2024-05-13 12:08:12 +02:00
test.skip("User loads worskpace with empty file", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile(page);
2024-05-07 13:12:58 +02:00
await workspacePage.goToWorkspace();
2024-05-07 13:12:58 +02:00
await expect(workspacePage.pageName).toHaveText("Page 1");
2024-05-07 13:12:58 +02:00
});
2024-05-13 12:08:12 +02:00
test.skip("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 13:12:58 +02:00
await expect(page.getByTestId("active-users-list").getByAltText("Princesa Leia")).toHaveCount(2);
});
2024-05-13 12:08:12 +02:00
test.skip("User draws a rect", async ({ page }) => {
const workspacePage = new WorkspacePage(page);
await workspacePage.setupEmptyFile();
await workspacePage.mockRPC("update-file?id=*", "workspace/update-file-create-rect.json");
await workspacePage.goToWorkspace();
await workspacePage.rectShapeButton.click();
await workspacePage.clickWithDragViewportAt(128, 128, 200, 100);
const shape = await workspacePage.rootShape.locator("rect");
expect(shape).toHaveAttribute("width", "200");
expect(shape).toHaveAttribute("height", "100");
});