Update box brush authoring tests and add helper function
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { clickViewport, getEditorStoreSnapshot } from "./viewport-test-helpers";
|
||||
import { beginBoxCreation, clickViewport, getEditorStoreSnapshot } from "./viewport-test-helpers";
|
||||
|
||||
test("user can create a box brush and keep it through a draft reload", async ({ page }) => {
|
||||
const pageErrors: string[] = [];
|
||||
@@ -22,7 +22,7 @@ test("user can create a box brush and keep it through a draft reload", async ({
|
||||
}, "webeditor3d.scene-document-draft");
|
||||
await page.reload();
|
||||
|
||||
await page.getByRole("button", { name: "Box Create" }).click();
|
||||
await beginBoxCreation(page);
|
||||
const creationSnapshot = await getEditorStoreSnapshot(page);
|
||||
expect(creationSnapshot).toMatchObject({
|
||||
toolMode: "create",
|
||||
@@ -48,7 +48,7 @@ test("user can create a box brush and keep it through a draft reload", async ({
|
||||
}
|
||||
});
|
||||
|
||||
await page.getByRole("button", { name: "Box Create" }).click();
|
||||
await beginBoxCreation(page);
|
||||
await clickViewport(page);
|
||||
const committedSnapshot = await getEditorStoreSnapshot(page);
|
||||
expect(committedSnapshot).toMatchObject({
|
||||
@@ -91,9 +91,9 @@ test("switching selection while a transform input is active does not overwrite t
|
||||
}, "webeditor3d.scene-document-draft");
|
||||
await page.reload();
|
||||
|
||||
await page.getByRole("button", { name: "Box Create" }).click();
|
||||
await beginBoxCreation(page);
|
||||
await clickViewport(page);
|
||||
await page.getByRole("button", { name: "Box Create" }).click();
|
||||
await beginBoxCreation(page);
|
||||
await clickViewport(page);
|
||||
|
||||
const outlinerButtons = page.getByTestId("outliner-brush-list").getByRole("button");
|
||||
|
||||
@@ -105,6 +105,11 @@ export async function clearViewportCreationPreview(page: Page) {
|
||||
});
|
||||
}
|
||||
|
||||
export async function beginBoxCreation(page: Page) {
|
||||
await page.getByTestId("outliner-add-button").click();
|
||||
await page.getByTestId("add-menu-box").click();
|
||||
}
|
||||
|
||||
export async function clickViewport(page: Page, panelId: string = DEFAULT_VIEWPORT_PANEL_ID) {
|
||||
const viewportPanel = getViewportPanel(page, panelId);
|
||||
await viewportPanel.click({ position: { x: 16, y: 16 }, force: true });
|
||||
|
||||
Reference in New Issue
Block a user