收口 MinerU OCR 任务链与上下文
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user