Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ yarn-error.log*

# local env files
.env
.env.jev

# vercel
.vercel
Expand All @@ -47,6 +48,7 @@ node_modules/
/test-results/
/playwright-report/
/blob-report/
/benchmark-results/
/playwright/.cache/
.playwright-mcp/

Expand Down
5 changes: 5 additions & 0 deletions endform.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineEndformConfig } from "endform";

export default defineEndformConfig({
environmentVariables: ["E2E_JEV_.*"],
});
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"format:check": "oxfmt --check",
"format:fix": "oxfmt --write",
"lint": "oxlint",
"mcp-user": "tsx mcp-user.ts"
"mcp-user": "tsx mcp-user.ts",
"jev:test": "bun scripts/jev-loop.ts",
"jev:viewer": "bun scripts/jev/viewer.ts",
"jev:benchmark": "bun scripts/jev-benchmark.ts --mode clean --repeat 10",
"jev:benchmark:faults": "bun scripts/jev-benchmark.ts --mode faults"
},
"dependencies": {
"@libsql/client": "^0.18.0",
Expand Down
39 changes: 39 additions & 0 deletions scripts/jev-benchmark.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { expect, test } from "bun:test";
import { actionCode, candidates } from "./jev-benchmark";

test("builds bounded actions from an accessibility observation", () => {
const actions = candidates(
{
url: "https://example.test/dashboard",
title: "Settings",
snapshot:
'- link "General" [ref=e1]\n- textbox "Name" [ref=e2]\n- radio "Member" [ref=e3]\n- button "Save" [disabled] [ref=e4]',
invitationId: "42",
},
["John Doe"],
);
expect(actions.map((action) => action.kind)).toEqual([
"click",
"fill",
"check",
"goto",
"goto",
"wait",
"stop",
]);
});

test("keeps action arguments literal", () => {
const value = "x\n${process.exit()}";
expect(actionCode({ id: "x", kind: "goto", value, description: "go" })).toBe(
`await page.goto(${JSON.stringify(value)});`,
);
expect(() =>
actionCode({
id: "x",
kind: "click",
ref: 'e1"); throw 1',
description: "bad",
}),
).toThrow();
});
Loading
Loading