Enhance e2e test for local lights and background by adding viewport interactions
This commit is contained in:
@@ -2,6 +2,8 @@ import path from "node:path";
|
||||
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
import { getViewportCanvas } from "./viewport-test-helpers";
|
||||
|
||||
const panoramaFixturePath = path.resolve(process.cwd(), "fixtures/assets/skybox-panorama.svg");
|
||||
|
||||
test("local lights and background images persist through editor and runner flows", async ({ page }) => {
|
||||
@@ -37,6 +39,9 @@ test("local lights and background images persist through editor and runner flows
|
||||
await page.getByTestId("outliner-add-button").click();
|
||||
await page.getByTestId("add-menu-lights").click();
|
||||
await page.getByTestId("add-menu-point-light").click();
|
||||
const viewportCanvas = getViewportCanvas(page);
|
||||
await viewportCanvas.hover({ position: { x: 172, y: 116 }, force: true });
|
||||
await viewportCanvas.click({ position: { x: 172, y: 116 }, force: true });
|
||||
await expect(page.getByTestId("point-light-distance")).toHaveValue("8");
|
||||
await page.getByTestId("point-light-distance").fill("12");
|
||||
await page.getByTestId("point-light-distance").press("Tab");
|
||||
@@ -44,6 +49,8 @@ test("local lights and background images persist through editor and runner flows
|
||||
await page.getByTestId("outliner-add-button").click();
|
||||
await page.getByTestId("add-menu-lights").click();
|
||||
await page.getByTestId("add-menu-spot-light").click();
|
||||
await viewportCanvas.hover({ position: { x: 240, y: 132 }, force: true });
|
||||
await viewportCanvas.click({ position: { x: 240, y: 132 }, force: true });
|
||||
await expect(page.getByTestId("spot-light-angle")).toHaveValue("35");
|
||||
await page.getByTestId("spot-light-angle").fill("48");
|
||||
await page.getByTestId("spot-light-angle").press("Tab");
|
||||
|
||||
Reference in New Issue
Block a user