Enhance runtime click interaction test with viewport setup

This commit is contained in:
2026-04-03 00:47:04 +02:00
parent 8b0dd2951f
commit b9e387464b

View File

@@ -1,5 +1,7 @@
import { expect, test } from "@playwright/test";
import { clickViewport, setViewportCreationPreview } from "./viewport-test-helpers";
test("Interactable click prompt can teleport the player in run mode", async ({ page }) => {
const pageErrors: string[] = [];
const consoleErrors: string[] = [];
@@ -23,9 +25,13 @@ test("Interactable click prompt can teleport the player in run mode", async ({ p
await page.getByTestId("outliner-add-button").click();
await page.getByTestId("add-menu-entities").click();
await page.getByTestId("add-menu-player-start").click();
await setViewportCreationPreview(page, "topLeft", { kind: "entity", entityKind: "playerStart", audioAssetId: null }, { x: 0, y: 0, z: 0 });
await clickViewport(page, "topLeft");
await page.getByTestId("outliner-add-button").click();
await page.getByTestId("add-menu-entities").click();
await page.getByTestId("add-menu-interactable").click();
await setViewportCreationPreview(page, "topLeft", { kind: "entity", entityKind: "interactable", audioAssetId: null }, { x: 0, y: 0, z: 0 });
await clickViewport(page, "topLeft");
await page.getByTestId("interactable-position-y").fill("1");
await page.getByTestId("interactable-position-y").press("Tab");
await page.getByTestId("interactable-position-z").fill("1");
@@ -38,6 +44,8 @@ test("Interactable click prompt can teleport the player in run mode", async ({ p
await page.getByTestId("outliner-add-button").click();
await page.getByTestId("add-menu-entities").click();
await page.getByTestId("add-menu-teleport-target").click();
await setViewportCreationPreview(page, "topLeft", { kind: "entity", entityKind: "teleportTarget", audioAssetId: null }, { x: 0, y: 0, z: 0 });
await clickViewport(page, "topLeft");
await page.getByTestId("teleportTarget-position-x").fill("6");
await page.getByTestId("teleportTarget-position-x").press("Tab");