waygraph 0.15.15 → 0.15.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +19 -1
  2. package/dist/cli.d.ts +1 -0
  3. package/dist/cli.js +40 -0
  4. package/examples/routed-demo/playwright.config.ts +2 -1
  5. package/examples/saucedemo/.waygraph-auto/179dde38.log +0 -0
  6. package/examples/saucedemo/.waygraph-auto/1a7d471e.log +0 -0
  7. package/examples/saucedemo/.waygraph-auto/1e33a93d.log +0 -0
  8. package/examples/saucedemo/.waygraph-auto/2fbf6b8d.log +0 -0
  9. package/examples/saucedemo/.waygraph-auto/301ff7e3.log +0 -0
  10. package/examples/saucedemo/.waygraph-auto/3178c318.log +0 -0
  11. package/examples/saucedemo/.waygraph-auto/3eb1df41.log +0 -0
  12. package/examples/saucedemo/.waygraph-auto/4d68438c.log +0 -0
  13. package/examples/saucedemo/.waygraph-auto/5030cca5.log +0 -0
  14. package/examples/saucedemo/.waygraph-auto/51a5387a.log +0 -0
  15. package/examples/saucedemo/.waygraph-auto/55df2b0f.log +0 -0
  16. package/examples/saucedemo/.waygraph-auto/5a4374f7.log +0 -0
  17. package/examples/saucedemo/.waygraph-auto/5eafc682.log +0 -0
  18. package/examples/saucedemo/.waygraph-auto/6fc3d553.log +0 -0
  19. package/examples/saucedemo/.waygraph-auto/7531b70f.log +0 -0
  20. package/examples/saucedemo/.waygraph-auto/7774f054.log +0 -0
  21. package/examples/saucedemo/.waygraph-auto/7a08e89a.log +0 -0
  22. package/examples/saucedemo/.waygraph-auto/7d9f231d.log +0 -0
  23. package/examples/saucedemo/.waygraph-auto/8557750f.log +0 -0
  24. package/examples/saucedemo/.waygraph-auto/86a5ff4d.log +0 -0
  25. package/examples/saucedemo/.waygraph-auto/8c5b1caa.log +0 -0
  26. package/examples/saucedemo/.waygraph-auto/9918377b.log +0 -0
  27. package/examples/saucedemo/.waygraph-auto/9c4fd0a0.log +0 -0
  28. package/examples/saucedemo/.waygraph-auto/9cd2da32.log +0 -0
  29. package/examples/saucedemo/.waygraph-auto/a7c3d248.log +0 -0
  30. package/examples/saucedemo/.waygraph-auto/ab26aeb4.log +0 -0
  31. package/examples/saucedemo/.waygraph-auto/b13d08e4.log +0 -0
  32. package/examples/saucedemo/.waygraph-auto/bde6d205.log +0 -0
  33. package/examples/saucedemo/.waygraph-auto/be0bb35f.log +0 -0
  34. package/examples/saucedemo/.waygraph-auto/c10c4038.log +0 -0
  35. package/examples/saucedemo/.waygraph-auto/c23b2654.log +0 -0
  36. package/examples/saucedemo/.waygraph-auto/c8825eda.log +0 -0
  37. package/examples/saucedemo/.waygraph-auto/d440e60f.log +0 -0
  38. package/examples/saucedemo/.waygraph-auto/d52ce64b.log +0 -0
  39. package/examples/saucedemo/.waygraph-auto/d6e0cb19.log +0 -0
  40. package/examples/saucedemo/.waygraph-auto/e62bdb4a.log +0 -0
  41. package/examples/saucedemo/.waygraph-auto/e9b84105.log +0 -0
  42. package/examples/saucedemo/.waygraph-auto/f1949241.log +0 -0
  43. package/examples/saucedemo/package.json +2 -1
  44. package/examples/saucedemo/playwright.config.ts +2 -1
  45. package/package.json +4 -2
  46. package/templates/quickstart/package.json +2 -1
  47. package/templates/quickstart/playwright.config.ts +2 -1
  48. package/templates/scaffold/package.json +2 -1
  49. package/templates/scaffold/playwright.config.ts +2 -1
  50. package/examples/routed-demo/test-results/.last-run.json +0 -4
package/README.md CHANGED
@@ -1039,6 +1039,19 @@ immediately - see "Waygraph Pilot" above for the full picture.
1039
1039
  when no Block covers that action yet, and `auto reload <sessionId>` picks up a Block just
1040
1040
  written to disk without restarting the session - see "Blind Pilot" above.
1041
1041
 
1042
+ **`waygraph test [...args]`** is a thin wrapper around the project's own `@playwright/test`
1043
+ suite - it forwards to the local `node_modules/.bin/playwright` (falling back to
1044
+ `npx playwright` if the project hasn't installed it locally yet), so `waygraph test` behaves
1045
+ exactly like `playwright test`, and anything after it (`--grep`, a spec path, `--headed`, …)
1046
+ passes straight through. `waygraph test ui` (or `waygraph test --ui`) launches Playwright's
1047
+ interactive UI Mode the same way. Scaffolded projects (`waygraph init`/`create-waygraph`)
1048
+ wire this up as `npm test` / `npm run test:ui`, and ship `trace: "retain-on-failure"` plus
1049
+ the `html` reporter in `playwright.config.ts`, so a failing `waygraph test` already has a
1050
+ trace waiting - `waygraph test report` opens the HTML report, and
1051
+ `waygraph test show-trace <trace.zip>` opens one trace directly (both forward to Playwright's
1052
+ own `show-report`/`show-trace`, which live outside `playwright test`, so they're handled
1053
+ before the `test` forward rather than passed through it).
1054
+
1042
1055
  Flows are files (0.10.5+):
1043
1056
 
1044
1057
  | Want | Command |
@@ -1078,6 +1091,10 @@ Flows are files (0.10.5+):
1078
1091
  | Coding-agent defs | `waygraph agent-dive --loop claude` |
1079
1092
  | Print packaged skills | `waygraph --skill` / `--skill-pilot` / `--skill-pilot-blind` / `--skill-convention` |
1080
1093
  | One-shot temp-dir demo | `waygraph try demo` / `waygraph try auto` / `waygraph try auto:cli` |
1094
+ | Run the project's `@playwright/test` suite | `waygraph test` |
1095
+ | Same suite, Playwright's interactive UI Mode | `waygraph test ui` (or `--ui`) |
1096
+ | Open the last HTML report | `waygraph test report` |
1097
+ | Open one trace in the trace viewer | `waygraph test show-trace <trace.zip>` |
1081
1098
 
1082
1099
  `--blocks` / positional accepts a Flow export, a `.flow.ts` path, or `"a then b"`.
1083
1100
  `auto <file.flow.ts>` **runs** that flow (same as `run`); bare `auto` still explores.
@@ -1207,7 +1224,8 @@ git clone git@github.com:deviate-dv8/waygraph.git
1207
1224
  cd waygraph
1208
1225
  npm install
1209
1226
  npm run typecheck # waygraph typecheck . (tsc --noEmit + practice warnings)
1210
- npm run test # playwright test
1227
+ npm run test # node --test tests/unit + playwright test
1228
+ npm run test:ui # playwright test --ui
1211
1229
  npm run build # tsc -p tsconfig.build.json, emits dist/
1212
1230
  ```
1213
1231
 
package/dist/cli.d.ts CHANGED
@@ -6,6 +6,7 @@
6
6
  * auto Explore picker; `.flow.ts` / `--blocks From To` = run that path
7
7
  * demo Watch (step overlay); `--blocks` `--data` `--auto-next` `--fast` `--full` `--mini` `--ff-expand` `--ff-disabled`
8
8
  * run Execute; `--blocks` `--data` `--non-headless` `--video`
9
+ * test Runs the project's own @playwright/test suite; `test ui` / `--ui` = UI Mode
9
10
  *
10
11
  * Also: list / nav / validate / check / graph / init / agent-dive / traverse / try
11
12
  * Skills: --skill / --skill-pilot / --skill-pilot-blind / --skill-convention
package/dist/cli.js CHANGED
@@ -6,6 +6,7 @@
6
6
  * auto Explore picker; `.flow.ts` / `--blocks From To` = run that path
7
7
  * demo Watch (step overlay); `--blocks` `--data` `--auto-next` `--fast` `--full` `--mini` `--ff-expand` `--ff-disabled`
8
8
  * run Execute; `--blocks` `--data` `--non-headless` `--video`
9
+ * test Runs the project's own @playwright/test suite; `test ui` / `--ui` = UI Mode
9
10
  *
10
11
  * Also: list / nav / validate / check / graph / init / agent-dive / traverse / try
11
12
  * Skills: --skill / --skill-pilot / --skill-pilot-blind / --skill-convention
@@ -7336,6 +7337,16 @@ Primary (less is more):
7336
7337
  --video-viewport WxH Recording size (default run: 1280x720)
7337
7338
  --ff-expand Same as demo (expand FFCompose inners)
7338
7339
  --ff-disabled Same as demo (dispute: expand FF)
7340
+ waygraph test Runs the project's @playwright/test suite (cwd) -
7341
+ thin wrapper: forwards to the local playwright
7342
+ binary (or npx playwright as a fallback)
7343
+ test ui / test --ui Playwright UI Mode (interactive, watch + trace)
7344
+ test report [dir] Open the last HTML report (playwright show-report)
7345
+ test show-trace <file> Open one trace.zip in the trace viewer
7346
+ <any other args> Forwarded verbatim (--grep, a spec path, --headed, …)
7347
+ Scaffolds ship trace: "retain-on-failure" + the
7348
+ html reporter, so a failed waygraph test already
7349
+ has a trace - test report opens it.
7339
7350
 
7340
7351
  Also:
7341
7352
  waygraph list | nav | validate | check | typecheck | graph | init <name>
@@ -7467,6 +7478,35 @@ async function main() {
7467
7478
  await runChain(proj, spec);
7468
7479
  break;
7469
7480
  }
7481
+ case "test": {
7482
+ const rest = args.slice(1);
7483
+ const proj = process.cwd();
7484
+ const localPlaywrightBin = join(proj, "node_modules", ".bin", "playwright");
7485
+ const runPw = (pwArgs) => existsSync(localPlaywrightBin)
7486
+ ? runInherited(localPlaywrightBin, pwArgs, proj)
7487
+ : runInherited("npx", ["--yes", "playwright", ...pwArgs], proj);
7488
+ // report/show-trace are separate top-level `playwright` commands, not
7489
+ // `playwright test` subcommands - handled before the `test` forward below.
7490
+ if (rest[0] === "report") {
7491
+ process.exitCode = await runPw(["show-report", ...rest.slice(1)]);
7492
+ break;
7493
+ }
7494
+ if (rest[0] === "show-trace") {
7495
+ if (!rest[1]) {
7496
+ console.error("waygraph test show-trace: missing <trace.zip> (or a test-results/ dir)");
7497
+ process.exit(1);
7498
+ }
7499
+ process.exitCode = await runPw(["show-trace", ...rest.slice(1)]);
7500
+ break;
7501
+ }
7502
+ const wantsUi = rest[0] === "ui" || rest.includes("--ui");
7503
+ const forwarded = rest[0] === "ui" ? rest.slice(1) : rest;
7504
+ const pwArgs = wantsUi && !forwarded.includes("--ui")
7505
+ ? ["test", "--ui", ...forwarded]
7506
+ : ["test", ...forwarded];
7507
+ process.exitCode = await runPw(pwArgs);
7508
+ break;
7509
+ }
7470
7510
  case "init": {
7471
7511
  initCommand(args[1] ?? "");
7472
7512
  break;
@@ -8,10 +8,11 @@ export default defineConfig({
8
8
  fullyParallel: false,
9
9
  workers: 1,
10
10
  timeout: 30_000,
11
- reporter: "list",
11
+ reporter: [["list"], ["html", { open: "never" }]],
12
12
  use: {
13
13
  headless: true,
14
14
  baseURL: process.env.WAYGRAPH_BASE_URL || `http://${HOST}:${PORT}`,
15
+ trace: "retain-on-failure",
15
16
  launchOptions: {
16
17
  executablePath: process.env.CHROME_PATH || process.env.CHROMIUM_PATH,
17
18
  args: ["--no-sandbox", "--disable-dev-shm-usage"],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -6,7 +6,8 @@
6
6
  "description": "Full Sauce Demo (saucedemo.com) example - Effect / MemNav / waygraph auto.",
7
7
  "scripts": {
8
8
  "typecheck": "tsc --noEmit",
9
- "test": "playwright test",
9
+ "test": "waygraph test",
10
+ "test:ui": "waygraph test ui",
10
11
  "flows": "waygraph list",
11
12
  "demo": "waygraph demo --blocks \"loginFlow then shopFlow\" --data \"{\\\"saucedemo.credentials\\\":{\\\"username\\\":\\\"standard_user\\\",\\\"password\\\":\\\"secret_sauce\\\"},\\\"saucedemo.selectedItem\\\":{\\\"id\\\":\\\"sauce-labs-backpack\\\",\\\"name\\\":\\\"Sauce Labs Backpack\\\"}}\"",
12
13
  "demo:step": "waygraph demo --blocks \"loginFlow then shopFlow\" --title \"Shop demo\" --data \"{\\\"saucedemo.credentials\\\":{\\\"username\\\":\\\"standard_user\\\",\\\"password\\\":\\\"secret_sauce\\\"},\\\"saucedemo.selectedItem\\\":{\\\"id\\\":\\\"sauce-labs-backpack\\\",\\\"name\\\":\\\"Sauce Labs Backpack\\\"}}\"",
@@ -5,10 +5,11 @@ export default defineConfig({
5
5
  fullyParallel: false,
6
6
  workers: 1,
7
7
  timeout: 30_000,
8
- reporter: "list",
8
+ reporter: [["list"], ["html", { open: "never" }]],
9
9
  use: {
10
10
  headless: true,
11
11
  baseURL: "https://www.saucedemo.com",
12
+ trace: "retain-on-failure",
12
13
  launchOptions: {
13
14
  // Canonical Chromium on this machine is the Flatpak install - never let
14
15
  // Playwright download its own bundled binary. See .agent/manager-agent.md.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waygraph",
3
- "version": "0.15.15",
3
+ "version": "0.15.17",
4
4
  "type": "module",
5
5
  "description": "A typed graph of reusable Blocks for driving a browser through E2E flows.",
6
6
  "license": "MIT",
@@ -36,7 +36,9 @@
36
36
  "scripts": {
37
37
  "build": "tsc -p tsconfig.build.json",
38
38
  "typecheck": "node bin/waygraph typecheck .",
39
- "test": "playwright test",
39
+ "test": "npm run test:unit && playwright test",
40
+ "test:ui": "playwright test --ui",
41
+ "test:unit": "node --import tsx/esm --test tests/unit/*.spec.ts",
40
42
  "docs:preview": "python3 -m http.server 4173 --directory docs",
41
43
  "example:saucedemo:install": "npm --prefix examples/saucedemo install",
42
44
  "example:saucedemo:test": "npm --prefix examples/saucedemo test",
@@ -4,7 +4,8 @@
4
4
  "type": "module",
5
5
  "description": "Self-contained saucedemo quickstart (copied into a temp dir by `waygraph try demo`).",
6
6
  "scripts": {
7
- "test": "playwright test",
7
+ "test": "waygraph test",
8
+ "test:ui": "waygraph test ui",
8
9
  "typecheck": "tsc --noEmit",
9
10
  "check": "waygraph check",
10
11
  "auto": "waygraph auto",
@@ -5,10 +5,11 @@ export default defineConfig({
5
5
  fullyParallel: false,
6
6
  workers: 1,
7
7
  timeout: 30_000,
8
- reporter: "list",
8
+ reporter: [["list"], ["html", { open: "never" }]],
9
9
  use: {
10
10
  headless: true,
11
11
  baseURL: "https://www.saucedemo.com",
12
+ trace: "retain-on-failure",
12
13
  launchOptions: {
13
14
  // Canonical Chromium on this machine is the Flatpak install - never let
14
15
  // Playwright download its own bundled binary. See .agent/manager-agent.md.
@@ -5,7 +5,8 @@
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "typecheck": "waygraph typecheck .",
8
- "test": "playwright test",
8
+ "test": "waygraph test",
9
+ "test:ui": "waygraph test ui",
9
10
  "fixture": "node scripts/fixture-server.mjs",
10
11
  "list": "waygraph list",
11
12
  "check": "waygraph check",
@@ -7,9 +7,10 @@ const FIXTURE_ORIGIN = `http://${FIXTURE_HOST}:${FIXTURE_PORT}`;
7
7
  export default defineConfig({
8
8
  testDir: "./tests",
9
9
  fullyParallel: true,
10
- reporter: "list",
10
+ reporter: [["list"], ["html", { open: "never" }]],
11
11
  use: {
12
12
  baseURL: FIXTURE_ORIGIN,
13
+ trace: "retain-on-failure",
13
14
  launchOptions: {
14
15
  executablePath: process.env.CHROME_PATH || process.env.CHROMIUM_PATH,
15
16
  },
@@ -1,4 +0,0 @@
1
- {
2
- "status": "passed",
3
- "failedTests": []
4
- }