本文へ移動
cccskills
無料GitHub で公開

e2e-ocr

E2E OCR assertions with Tesseract.js for canvas-only UI such as PDF pages in Cypress page objects. Use when asserting canvas-only E2E text with OCR.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnutスター 50(GitHub 50 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.6 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

E2E OCR Rules

Use this skill when asserting text that is not in the DOM, such as PDF content drawn only to <canvas>. Keep OCR in test infrastructure, not product code.

Tesseract Setup

  • Use tesseract.js, a root devDependency, for canvas-only assertions via cy.task.
  • Register a Node task in e2e_test/config/common.ts.
  • The task should call tesseract.js createWorker and recognize on image bytes, such as base64 PNG without the data:image/png;base64, prefix.
  • Example task name: ocrCanvasImage.

Language Data

  • Commit e2e_test/tesseract/eng.traineddata uncompressed.
  • Pass langPath and cachePath to that directory when creating the worker.
  • This prevents Tesseract from writing eng.traineddata to the repo root. Root-level traineddata files are gitignored as a fallback.

Page Object Pattern

  • Wait until the canvas has real ink before OCR. Sampling getImageData for dark pixels is better than checking only non-zero alpha, because an empty white fill can still have alpha.
  • Export with toDataURL("image/png").
  • Strip the data URL prefix.
  • Use cy.task(..., { timeout: ... }) for slow OCR.
  • Assert the returned string contains the expected substring with a clear message.
  • Reference: e2e_test/start/pageObjects/bookReadingPage.ts, from expectPdfBeginningVisible through expectCurrentPage(1).expectVisibleOCRContains.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

backend

無料

Backend Java — Spring Boot controllers/services, JUnit controller tests, MakeMe. Read this first for any backend work. Use when working on the Java Spring backend.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

Backend Java production code, Spring Boot controllers/services/repositories, controller return values, imports, schema ERD pointer. Use when editing backend production Java.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

Backend Java tests, controller-level stable-boundary tests, JUnit, @Nested, MakeMe builders, @Transactional, parameterized tests. Use when writing or changing backend JUnit tests.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

cli

無料

related to donut CLI. Use when working on donut-cli.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

Set up and run the Donut dev environment on Cursor Cloud VM (no Nix). Use when working on Cloud VM, running tests on Cloud VM, or encountering command errors related to missing nix. Triggers on: cloud VM, cloud agent, no nix available, /workspace path.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

Regenerate docs/database-erd.md from MySQL information_schema (Mermaid ERD: foreign keys and key columns). Use after Flyway schema changes, new migrations, or when the diagram is stale. Triggers on: database ERD, database-erd.md, export_database_erd, schema diagram, ER diagram after migration.

日本語の概要は準備中です。原文の説明を表示しています。

nerds-odd-e/doughnut502026年10月26日 更新

nerds-odd-e のスキルをすべて見る

このスキルの問題を報告する