feat: polish workspace transfers and verify Craft server file workflows

This commit is contained in:
SantaSpeen committed 2026-10-24 02:01:28 +03:00
1 parent 7fd7ae6733
commit c209f1effc
49 files changed
+1459 -670

No files matched your search

+6 -46
View File
@@ -124,29 +124,8 @@ const { chromium } = require(process.env.PLAYWRIGHT_MODULE || "playwright");
await route.fulfill({ response });
});
await page.goto(base + "/settings/profile");
await page.getByLabel("3D preview quality").selectOption("half");
await page.getByLabel("Voxel memory limit").selectOption("512");
await page.getByLabel("Initial opacity").fill("50");
await Promise.all([
page.waitForResponse(
(r) => r.url().endsWith("/api/users/1") && r.status() === 200
),
page.getByRole("button", { name: "Save", exact: true }).click(),
]);
await page.reload();
await page.getByLabel("3D preview quality").waitFor();
if (
(await page.getByLabel("3D preview quality").inputValue()) !== "half" ||
(await page.getByLabel("Voxel memory limit").inputValue()) !== "512"
)
throw new Error("3D profile settings were not restored");
await page.getByLabel("3D preview quality").selectOption("auto");
await Promise.all([
page.waitForResponse(
(r) => r.url().endsWith("/api/users/1") && r.status() === 200
),
page.getByRole("button", { name: "Save", exact: true }).click(),
]);
if (await page.getByLabel("3D preview quality").count())
throw new Error("Disabled 3D settings are still visible");
await page.goto(base + "/files/series/scan_1.dcm");
await page.waitForFunction(
() =>
@@ -155,32 +134,13 @@ const { chromium } = require(process.env.PLAYWRIGHT_MODULE || "playwright");
null,
{ timeout: 20000 }
);
await page
.getByRole("button", { name: "Open as 3D (3)", exact: true })
.click();
await page
.locator(".dicom-volume-stage canvas")
.waitFor({ timeout: 20000 });
if (
(await page.locator('.dicom-volume input[type="range"]').inputValue()) !==
"0.5"
(await page.locator(".dicom-volume-stage").count()) ||
(await page.getByRole("button", { name: /Open as 3D/ }).count())
)
throw new Error("Viewer ignored profile opacity");
for (const label of ["Axial", "Sagittal", "Coronal", "3D"]) {
await page.getByRole("button", { name: label, exact: true }).click();
await page.waitForTimeout(150);
}
await page.getByRole("button", { name: "Back to 2D", exact: true }).click();
await page.waitForFunction(
() =>
!document.querySelector(".dicom-volume-stage") &&
document.querySelector(".dicom-viewer .document-stage canvas")
?.width === 2
);
throw new Error("3D must remain disabled");
if (errors.length) throw new Error(errors.join("\n"));
console.log(
"DICOM preview in embedded server: 2D, series offer, 3D, MPR and return to 2D passed"
);
console.log("DICOM preview: 2D passed; 3D is disabled");
} finally {
await browser.close();
server.close();