import { test, expect } from "@playwright/test"; import { runSteps } from "passmark"; test("Upload image and verify de-identification runs", async ({ page }) => { test.setTimeout(180_000); await runSteps({ page, userFlow: "Load Aegis app", steps: [ { description: "Navigate to the Aegis app URL" }, { description: "Wait for page to load", waitUntil: "The page shows text about Medical Image and has a large blue button", }, ], assertions: [{ assertion: "You can see an image upload area on the page" }], test, expect, }); // Native Playwright for file upload (Gradio's hidden input) const fileInput = page.locator('input[type="file"]'); await fileInput.setInputFiles("tests/fixtures/sample_medical_image.png"); await page.waitForTimeout(2000); await runSteps({ page, userFlow: "Run de-identification", steps: [ { description: "Click the large blue button below the image upload area", waitUntil: "A report appears with words like REDACTED or PRESERVED", }, ], assertions: [ { assertion: "You can see text mentioning 'Total text regions detected'" }, { assertion: "You can see an output image on the right side of the page" }, ], test, expect, }); }); __ __