Semantic browser decisions, native Playwright actions. Jevwright is an experimental TypeScript/JavaScript library that adds page.jev to an existing Playwright page. Use it for browser tests, data entry, extraction, administrative workflows, and other website automation.
Jev chooses among observed elements and actions you expose. Playwright executes the operations. Your application supplies input values, owns the browser session, and verifies the outcome. The original Playwright page, locators, methods, and events remain available.
import { withJev } from 'jevwright'; // rawPage is your existing Playwright Page, already on the application's search view. const page = withJev(rawPage); const search = await page.jev.find('The order search field', { roles: ['searchbox', 'textbox'], }); await search.fill('SO-1001'); await search.press('Enter');
| Guide | What you will learn |
|---|---|
| Getting started | Install into another project, configure TypeSafe, and run a complete first script |
| Building browser workflows | Find controls, supply inputs, register actions, handle popups/downloads, and verify completion |
| API reference | Every public method, option, default, result, action type, and error code |
| Testing and evaluation | Add Jev to Playwright Test, write UAT assertions, and interpret gym results |
| Docker setup and teardown | Start both gyms, run isolated tests, export reports, and remove test resources |
| Releasing and distribution | Configure npm trusted publishing and release tested npm archives and container images through GitHub |
| Troubleshooting | Diagnose setup, selection, timing, transport, and incomplete workflows |
Requires Node.js 22+ and Chromium. The declared Playwright range is >=1.63.0 <2; this checkout was tested with 1.64.1. This package has not been published to npm.
npm ci npx playwright install chromium export TYPESAFE_API_KEY="your-typesafe-api-key" npm run example
The example creates a local page and asks live Jev to navigate to its pricing view, with deterministic completion verification. To consume the library elsewhere, run npm pack here, then install the generated archive in that project:
npm install /absolute/path/to/jevwright-0.3.0.tgz [email protected] npx playwright install chromium
The archive includes the library, TypeScript declarations, these guides, and runnable examples. See setup and configuration for the full walkthrough. An OpenRouter key is not a direct substitute for a TypeSafe key in the current implementation.
| API | Use it for |
|---|---|
withJev(page, options?) |
Add .jev to the same page object |
new Jev(page, options?) |
Create a separate companion without modifying the page |
jev.find(description, options?) |
Resolve a semantic target to a native Playwright locator |
jev.walk(goal, options?) |
Execute a bounded sequence of clicks and caller-defined actions |
jev.observe(options?) |
Inspect accessible context and control state without a model call |
jev.check(statement, options?) |
Obtain a probabilistic page judgment |
jev.settle(options?) |
Wait for bounded semantic quiet or explicit readiness |
jev.actions.register(definition) |
Offer typed fill/select/upload/drag/download/popup and other operations |
find selects; you perform the locator operation. walk acts; you define its allowed abilities and success condition. Use a deterministic verify callback when a walk must establish a concrete outcome. check returns a probability, not a test assertion. Native page.check(selector) still checks a checkbox.
For a workflow with several possible routes:
const result = await page.jev.walk('Open the order history', { maxSteps: 6, signal: AbortSignal.timeout(30_000), verify: p => p.getByRole('heading', { name: 'Order history', exact: true }).isVisible(), }); if (result.status !== 'done') { throw new Error(`Navigation ended with ${result.status}`); }
Jevwright provides the browser interaction layer. Scheduling, queues, credentials, application rules, and end-to-end job orchestration belong to your application. Desktop automation, a general API automation engine, autonomous UAT generation, and a browser/tab manager are not implemented.
Observation supports accessible controls, visible frames, and open shadow DOM. Canvas-only targets and closed shadow roots need caller-defined actions. Keep semantic operations sequential on each page, use selected locators promptly, and reacquire them after node replacement or navigation. Accessibility reference APIs are version-sensitive; validate Playwright upgrades.
Model calls send goals and page observations to the configured TypeSafe client. There is no general-purpose redaction. Input values can stay in your code but may appear in subsequent page observations after entry. See data flow for the precise boundary.
npm run example # Live goal-directed navigation on a local fixture npm run example:form # Live semantic selection and exact result assertion npm run example:uat # Live Jev interactions inside Playwright Test npm test # Build and deterministic browser adapter tests; no API key npm run check # Adapter, component gym, and native business UAT; no API key
The navigation example, form example, and acceptance test are self-contained; they require no running application server.
The repository also contains two evaluation environments, separate from the reusable library:
| Environment | Purpose | Start |
|---|---|---|
| Procedural component gym | Seeded, leveled component/navigation challenges across 22 families | npm run gym — port 4317 |
| Atlas Operations business gym | Working orders/inventory application with requirements-linked UAT assertions | npm run business-gym — port 4318 |
Neither gym ships as part of the adapter package. See testing and evaluation for commands, reports, measured results, and the difference between fixture solvability, live model performance, and business correctness. The business suite executes authored tests; it does not claim Jev independently generated them.
From a repository checkout, Docker provides a clean environment without installing browsers or npm dependencies on the host:
npm run docker:up # Start both interactive gyms and wait for readiness npm run docker:down # Stop them and delete their data volumes npm run docker:test # Run isolated tests, export reports, and always tear down
Test reports default to the system temporary directory, outside the source tree. See Docker setup for individual suites, live Jev runs, custom ports, and CI.
Jevwright is an independent prototype, not an official TypeSafe or Playwright integration.