49 lines
2.5 KiB
TypeScript
49 lines
2.5 KiB
TypeScript
// [66] Präsentationsplan mit einem Klick: Musterhaus komplex → Knopf im Layouts-Panel → Dialog → Blatt mit je
|
|
// einem Viewport für die gewählten Geschosse, alle Ansichten und einen Schnitt; ein Undo-Schritt entfernt es.
|
|
import { blurFocus, discardIfAsked, expect, fileMenu, openTab, startNewProject, test, typeCommand } from "./app";
|
|
|
|
test.use({ viewport: { width: 1600, height: 1000 } });
|
|
|
|
test("Präsentationsplan: Dialog erstellt Blatt mit N Viewports, Undo entfernt es", async ({ page }) => {
|
|
test.setTimeout(120_000);
|
|
await startNewProject(page);
|
|
await fileMenu(page, /Musterhaus \(komplex\)/);
|
|
await discardIfAsked(page);
|
|
await expect(page.locator(".project-name")).toHaveText("Musterhaus komplex", { timeout: 30_000 });
|
|
|
|
// Über die Befehlszeile (Alias) öffnen, Dialog schliessen, dann über den Knopf im Layouts-Panel.
|
|
await typeCommand(page, "praesentationsplan");
|
|
const dialog = page.getByRole("dialog", { name: "Präsentationsplan" });
|
|
await expect(dialog).toBeVisible();
|
|
await dialog.getByRole("button", { name: "Abbrechen" }).click();
|
|
await expect(dialog).toBeHidden();
|
|
await openTab(page, "Mappe");
|
|
await page.locator("[data-testid=presentation-open]").click();
|
|
await expect(dialog).toBeVisible();
|
|
|
|
const floors = dialog.locator("input[data-floor]");
|
|
// [224] Nur vorhandene Ansichten, einzeln wählbar; leere Geschosse sind nicht vorgewählt.
|
|
const elevs = dialog.locator("input[data-testid^=presentation-elevation-]");
|
|
expect(await elevs.count()).toBeGreaterThanOrEqual(1);
|
|
for (let i = 0; i < (await elevs.count()); i++) await elevs.nth(i).check();
|
|
// Erstes Geschoss abwählen (falls vorgewählt), Rest bleibt.
|
|
await floors.first().uncheck();
|
|
expect(await dialog.locator("[data-testid=presentation-section]").inputValue()).not.toBe("");
|
|
let nFloors = 0;
|
|
for (let i = 0; i < (await floors.count()); i++) if (await floors.nth(i).isChecked()) nFloors++;
|
|
const nElev = await elevs.count();
|
|
await dialog.locator("[data-testid=presentation-create]").click();
|
|
await expect(dialog).toBeHidden();
|
|
|
|
// Blatt ist offen: gewählte Grundrisse + Ansichten + 1 Schnitt.
|
|
const vps = page.locator("[data-viewport-id]");
|
|
await expect(vps).toHaveCount(nFloors + nElev + 1, { timeout: 20_000 });
|
|
await page.waitForTimeout(1500);
|
|
const shots = process.env.DOSSIER_SHOTS;
|
|
if (shots) await page.screenshot({ path: `${shots}/presentation-sheet.png` });
|
|
|
|
await blurFocus(page);
|
|
await page.keyboard.press("Control+z");
|
|
await expect(vps).toHaveCount(0, { timeout: 10_000 });
|
|
});
|