收口 MinerU OCR 任务链与上下文

This commit is contained in:
lix-2026
2026-06-01 10:30:42 +08:00
parent 1481de2018
commit 610b23d3a5
13 changed files with 710 additions and 55 deletions
@@ -134,6 +134,17 @@ async function main() {
await page.waitForFunction(() => document.querySelector('[data-mnote-local-ocr-status="done"]'), null, {
timeout: UI_TIMEOUT_MS,
});
await page.getByTestId("mnote-local-ocr-task-toggle").waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page.getByTestId("mnote-local-ocr-task-toggle").click({ timeout: UI_TIMEOUT_MS });
await page.getByTestId("mnote-local-ocr-task-drawer").waitFor({ state: "visible", timeout: UI_TIMEOUT_MS });
await page.waitForFunction(
(sourcePath) => {
const row = document.querySelector(`[data-mnote-local-ocr-task-row="${CSS.escape(sourcePath)}"]`);
return row && row.getAttribute("data-mnote-local-ocr-task-status") === "done";
},
sourceRootRelativePath,
{ timeout: UI_TIMEOUT_MS },
);
const uiOcrPath = await page.locator('[data-mnote-local-ocr-path]').first().getAttribute("data-mnote-local-ocr-path");
assert(uiOcrPath && uiOcrPath.endsWith(".ocr.md"), `UI OCR path invalid: ${uiOcrPath}`);
screenshots.ocrToolbar = path.join(OUTPUT_DIR, "02-ocr-toolbar.png");