fix: QA sweep — 7 bugs fixed, 17 test corrections

Code fixes:
- Sidebar state bleed: reset file store on HomePage mount
- restore-photo: raise error instead of silently skipping colorize
  when DDColor model missing
- PaddleOCR OOM: cap input images to 2048px before OCR inference
- Torch CPU optimization: use --index-url .../whl/cpu on CPU nodes

Test fixes:
- upscale: add exact:true to scale factor button locators
- smart-crop: add exact:true to "Pad to square" locator
- colorize: use regex for model button names (Best/Balanced/Fast)
- enhance-faces: use .first() for ambiguous percentage display
- passport-photo: fix DPI locator, .or() compound, generate fallback
- people: update maxUsers assertions for unlimited (0) default
- automate: "Save Pipeline" → "Save" matching actual button text
- tools.test: add resize to Sharp mock chain for OCR tests
This commit is contained in:
SnapOtter
2026-04-25 07:23:58 +08:00
parent bd84728588
commit bf0307d87d
12 changed files with 47 additions and 50 deletions
+5 -5
View File
@@ -109,11 +109,11 @@ test.describe("Automate Page", () => {
test("has Save Pipeline button (disabled when no steps)", async ({ loggedInPage: page }) => {
await gotoAutomate(page);
// Save Pipeline button is only rendered when steps > 0, so it should not exist yet
await expect(page.getByRole("button", { name: "Save Pipeline" })).not.toBeVisible();
await expect(page.getByRole("button", { name: "Save" })).not.toBeVisible();
// Add a step so the button appears
await addToolStep(page, "Resize", 1);
await expect(page.getByRole("button", { name: "Save Pipeline" })).toBeVisible();
await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
});
// --- Add Step ---
@@ -174,14 +174,14 @@ test.describe("Automate Page", () => {
await gotoAutomate(page);
await addToolStep(page, "Resize", 1);
await expect(page.getByRole("button", { name: "Save Pipeline" })).toBeVisible();
await expect(page.getByRole("button", { name: "Save" })).toBeVisible();
});
test("clicking Save Pipeline shows name input form", async ({ loggedInPage: page }) => {
await gotoAutomate(page);
await addToolStep(page, "Resize", 1);
await page.getByRole("button", { name: "Save Pipeline" }).click();
await page.getByRole("button", { name: "Save" }).click();
await expect(page.getByPlaceholder("Pipeline name")).toBeVisible();
});
@@ -210,7 +210,7 @@ test.describe("Automate Page", () => {
await addToolStep(page, "Compress", 2);
const uniqueName = `E2E Pipeline ${Date.now()}`;
await page.getByRole("button", { name: "Save Pipeline" }).click();
await page.getByRole("button", { name: "Save" }).click();
await page.getByPlaceholder("Pipeline name").fill(uniqueName);
await page.getByRole("button", { name: "Save", exact: true }).click();