check-cep-vision

Locate, click, and type into UI elements in Playwright tests using OpenCV template matching.

2|Updated Mar 2, 2026
One-click install
npx skills add https://github.com/lausser/check_cep --skill check-cep-vision-lausser
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: check-cep-vision
Source: https://github.com/lausser/check_cep/tree/main/.agents/skills/check-cep-vision
Command: npx skills add https://github.com/lausser/check_cep --skill check-cep-vision-lausser

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Playwright tests break when pages use dynamically generated CSS classes, canvas/WebGL content, or embedded PDFs with no stable DOM selectors. This Skill provides image-based locators that find elements by their visual appearance using OpenCV template matching, so tests can interact with what the user actually sees. ## Core Features & Use Cases - Image-Based Interaction: Click, type, highlight, and wait for UI elements using PNG template screenshots via functions like clickByImage, typeByImage, waitForImage, and locateByImage. - Region Narrowing & Click Offsets: Restrict searches to named viewport presets or custom rectangles to eliminate ambiguity, and shift click points from label to input field with clickOffset. - Hybrid Vision + DOM Fallback: Use clickByImageOr and typeByImageOr to try vision matching first and fall back to DOM selectors automatically, including on the Lightpanda browser. - Use Case: Migrating a Sakuli/SikuliX image-driven test suite to Playwright, where login forms and buttons are located by cropped screenshots captured inside the container at a fixed 1280x720 baseline. ## Quick Start Write a Playwright test that imports vision from check-cep-vision and clicks a button using a template image saved in the test's assets directory with the region set to main.

Frequently Asked Questions about check-cep-vision

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I click a button by image in Playwright?

Import vision from check-cep-vision and call vision.clickByImage(page, 'assets/submit-btn.png', { region: 'main' }). The library takes a screenshot, runs OpenCV template matching, highlights the match, and clicks its center.

When should I use image-based locators instead of DOM selectors?

Use image-based locators when pages have dynamically generated CSS classes, canvas or WebGL content, or no accessible DOM elements. If a stable selector like data-testid or an ARIA role exists, DOM locators are faster and easier to maintain.

Does check-cep-vision work with the Lightpanda browser?

No, Lightpanda has no rendering pipeline so vision functions throw when BROWSER=lightpanda. Use vision.canScreenshot() to guard calls, or use hybrid functions like clickByImageOr which fall back to DOM selectors automatically.

Why does my image template match fail with not-found?

The most common cause is a baseline mismatch: the template was captured at a different viewport, device scale factor, or outside the container with different font rendering. Re-capture the template inside the container at 1280x720 with DPR 1 and animations disabled.

How do I fix ambiguous image match errors?

Ambiguous means two candidates scored too close together. Narrow the search with a named region preset or custom rectangle so only one instance is in scope, or improve the template crop to include distinguishing context like labels.

How do I type into an input field found by image?

Call vision.typeByImage with a template that includes the label plus input, and set clickOffset to shift the click from the label into the input field. It uses page.keyboard.type() for keystroke simulation; the hybrid typeByImageOr falls back to fill().