waygraph 0.15.53 → 0.15.54
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.
- package/dist/analysis/graph.d.ts +3 -0
- package/dist/auto-session/helpers.d.ts +10 -0
- package/dist/blocks-select.d.ts +3 -0
- package/dist/blocks-select.js +2 -0
- package/dist/config.d.ts +2 -0
- package/dist/core/blocks/api.d.ts +1 -0
- package/dist/core/blocks/method.d.ts +2 -0
- package/dist/core/blocks/method.js +1 -0
- package/dist/core/blocks/nav.d.ts +1 -0
- package/dist/core/blocks/page.d.ts +1 -0
- package/dist/core/branch-regression.d.ts +1 -0
- package/dist/core/compose.d.ts +1 -0
- package/dist/core/flow.d.ts +1 -0
- package/dist/core/map-builder.d.ts +8 -1
- package/dist/core/map-builder.js +1 -1
- package/dist/core/run-graph.d.ts +2 -0
- package/dist/core/run-graph.js +1 -0
- package/dist/errors.d.ts +1 -0
- package/dist/extensions.d.ts +1 -0
- package/dist/extensions.js +1 -0
- package/dist/highlights/demo-pace.d.ts +4 -0
- package/dist/highlights/demo-pace.js +4 -0
- package/dist/highlights/device.d.ts +2 -0
- package/dist/highlights/device.js +2 -0
- package/dist/highlights/types.d.ts +6 -0
- package/dist/session/auto-explore-run.js +6 -0
- package/dist/session/overlay-beacon.d.ts +7 -0
- package/dist/session/overlay-beacon.js +5 -0
- package/dist/session/pilot.d.ts +1 -0
- package/dist/traverse/coverage.d.ts +4 -0
- package/dist/traverse/coverage.js +3 -0
- package/dist/traverse/lease.d.ts +1 -0
- package/dist/traverse/lease.js +1 -0
- package/dist/traverse/run.d.ts +3 -0
- package/examples/routed-demo/src/flows/routed-demo-map.flow.ts +1 -1
- package/examples/routed-demo/src/flows/routed-demo.flow.ts +2 -2
- package/examples/saucedemo/README.md +11 -12
- package/examples/saucedemo/config/waygraph.config.ts +17 -0
- package/examples/saucedemo/docs/CONVENTION.md +1 -2
- package/examples/saucedemo/docs/HELPERS.md +1 -1
- package/examples/saucedemo/package-lock.json +10 -3
- package/examples/saucedemo/package.json +12 -29
- package/examples/saucedemo/src/blocks/saucedemo-web/cart/nav-cart.block.ts +0 -49
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +22 -25
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +0 -6
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +38 -96
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +1 -26
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +1 -45
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +14 -77
- package/examples/saucedemo/src/flows/api-demo.flow.ts +17 -11
- package/examples/saucedemo/src/flows/cart-bulk.flow.ts +19 -14
- package/examples/saucedemo/src/flows/cart-continue.flow.ts +10 -8
- package/examples/saucedemo/src/flows/cart-mem.flow.ts +7 -7
- package/examples/saucedemo/src/flows/catalog-logout.flow.ts +13 -8
- package/examples/saucedemo/src/flows/checkout-then-browse-again.flow.ts +26 -48
- package/examples/saucedemo/src/flows/checkout.flow.ts +70 -86
- package/examples/saucedemo/src/flows/device-showcase.flow.ts +24 -25
- package/examples/saucedemo/src/flows/login.flow.ts +11 -18
- package/examples/saucedemo/src/flows/mem-stub-demo.flow.ts +9 -20
- package/examples/saucedemo/src/flows/shop.flow.ts +15 -20
- package/examples/saucedemo/src/flows/smoke.flow.ts +12 -27
- package/examples/saucedemo/src/flows/stub-on-error.flow.ts +24 -43
- package/examples/saucedemo/src/flows/viewer-blocked.flow.ts +26 -34
- package/examples/saucedemo/src/states/checkout.mem-stubs.ts +11 -0
- package/examples/saucedemo/src/stubs/device-showcase.ts +193 -0
- package/examples/saucedemo/src/stubs/login.ts +37 -0
- package/examples/saucedemo/tests/chain-flow-episodes.spec.ts +7 -9
- package/examples/saucedemo/tests/submit-login-branch.spec.ts +18 -5
- package/package.json +3 -2
- package/templates/quickstart/README.md +4 -7
- package/templates/quickstart/config/waygraph.config.ts +17 -0
- package/templates/quickstart/docs/CONVENTION.md +1 -2
- package/templates/quickstart/docs/HELPERS.md +1 -1
- package/templates/quickstart/package.json +14 -14
- package/templates/quickstart/src/blocks/SITE-MAP.md +14 -3
- package/templates/quickstart/src/blocks/saucedemo-web/cart/nav-cart.block.ts +0 -49
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +22 -25
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/inventory.page.block.ts +0 -6
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +38 -96
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-password.method.block.ts +1 -26
- package/templates/quickstart/src/blocks/saucedemo-web/methods/fill-username.method.block.ts +1 -45
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +14 -77
- package/templates/quickstart/src/flows/api-demo.flow.ts +43 -0
- package/templates/quickstart/src/flows/cart-bulk.flow.ts +19 -14
- package/templates/quickstart/src/flows/cart-continue.flow.ts +10 -8
- package/templates/quickstart/src/flows/cart-mem.flow.ts +7 -7
- package/templates/quickstart/src/flows/catalog-logout.flow.ts +13 -8
- package/templates/quickstart/src/flows/checkout-then-browse-again.flow.ts +26 -48
- package/templates/quickstart/src/flows/checkout.flow.ts +70 -63
- package/templates/quickstart/src/flows/device-showcase.flow.ts +24 -25
- package/templates/quickstart/src/flows/login.flow.ts +11 -18
- package/templates/quickstart/src/flows/mem-stub-demo.flow.ts +12 -0
- package/templates/quickstart/src/flows/shop.flow.ts +15 -20
- package/templates/quickstart/src/flows/smoke.flow.ts +12 -27
- package/templates/quickstart/src/flows/stub-on-error.flow.ts +31 -0
- package/templates/quickstart/src/flows/viewer-blocked.flow.ts +26 -34
- package/templates/quickstart/src/states/checkout.mem-stubs.ts +11 -0
- package/templates/quickstart/src/stubs/device-showcase.ts +193 -0
- package/templates/quickstart/src/stubs/login.ts +37 -0
- package/templates/quickstart/tests/chain-flow.spec.ts +7 -10
- package/templates/skills/waygraph-convention.skill.md +1 -1
- package/examples/saucedemo/playwright.config.ts +0 -19
- package/examples/saucedemo/scripts/drive-auto-cli.mjs +0 -93
- package/examples/saucedemo/scripts/prove-add-to-cart-menu.mjs +0 -126
- package/examples/saucedemo/scripts/prove-auto-graph.mjs +0 -92
- package/examples/saucedemo/scripts/prove-wrong-login-runtime.mjs +0 -63
- package/templates/quickstart/playwright.config.ts +0 -14
- package/templates/quickstart/scripts/drive-auto-cli.mjs +0 -93
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "@playwright/test";
|
|
2
|
-
|
|
3
|
-
export default defineConfig({
|
|
4
|
-
testDir: "./tests",
|
|
5
|
-
fullyParallel: false,
|
|
6
|
-
workers: 1,
|
|
7
|
-
timeout: 30_000,
|
|
8
|
-
reporter: [["list"], ["html", { open: "never" }]],
|
|
9
|
-
use: {
|
|
10
|
-
headless: true,
|
|
11
|
-
baseURL: "https://www.saucedemo.com",
|
|
12
|
-
trace: "retain-on-failure",
|
|
13
|
-
},
|
|
14
|
-
});
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Drive `waygraph auto --cli` through login -> add-all -> remove-all -> quit.
|
|
4
|
-
* Waits for each Choose: prompt so picks are not sent early.
|
|
5
|
-
*
|
|
6
|
-
* Usage (from examples/saucedemo):
|
|
7
|
-
* node scripts/drive-auto-cli.mjs
|
|
8
|
-
*/
|
|
9
|
-
import { spawn } from "node:child_process";
|
|
10
|
-
import { createInterface } from "node:readline";
|
|
11
|
-
import { fileURLToPath } from "node:url";
|
|
12
|
-
import { dirname, join } from "node:path";
|
|
13
|
-
|
|
14
|
-
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
15
|
-
const waygraphBin = join(root, "../../bin/waygraph");
|
|
16
|
-
const DATA =
|
|
17
|
-
process.env.WAYGRAPH_DATA ??
|
|
18
|
-
'{"saucedemo.credentials":{"username":"standard_user","password":"secret_sauce"}}';
|
|
19
|
-
|
|
20
|
-
function pickByLabel(menuText, label) {
|
|
21
|
-
const re = new RegExp(`\\[(\\d+)\\]\\s+${label.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`);
|
|
22
|
-
const m = menuText.match(re);
|
|
23
|
-
if (!m) throw new Error(`menu missing "${label}"\n${menuText}`);
|
|
24
|
-
return m[1];
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
async function main() {
|
|
28
|
-
const child = spawn(waygraphBin, ["auto", "--cli", "--data", DATA, "."], {
|
|
29
|
-
cwd: root,
|
|
30
|
-
stdio: ["pipe", "pipe", "pipe"],
|
|
31
|
-
env: process.env,
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
let buf = "";
|
|
35
|
-
const dump = (chunk, stream) => {
|
|
36
|
-
const s = chunk.toString();
|
|
37
|
-
buf += s;
|
|
38
|
-
process[stream].write(s);
|
|
39
|
-
};
|
|
40
|
-
child.stdout.on("data", (c) => dump(c, "stdout"));
|
|
41
|
-
child.stderr.on("data", (c) => dump(c, "stderr"));
|
|
42
|
-
|
|
43
|
-
const waitChoose = () =>
|
|
44
|
-
new Promise((resolve, reject) => {
|
|
45
|
-
const start = Date.now();
|
|
46
|
-
const tick = () => {
|
|
47
|
-
if (buf.includes("Choose:")) {
|
|
48
|
-
const i = buf.lastIndexOf("Choose:");
|
|
49
|
-
const slice = buf.slice(Math.max(0, i - 4000), i + 8);
|
|
50
|
-
resolve(slice);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (Date.now() - start > 120_000) {
|
|
54
|
-
reject(new Error(`timeout waiting for Choose:\n${buf.slice(-2000)}`));
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
setTimeout(tick, 100);
|
|
58
|
-
};
|
|
59
|
-
tick();
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
const send = (line) => {
|
|
63
|
-
console.error(`\n>> pick ${line.trim()}`);
|
|
64
|
-
buf = buf.replace(/Choose:/g, "Choose(done):");
|
|
65
|
-
child.stdin.write(line);
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
let menu = await waitChoose();
|
|
70
|
-
send("1\n"); // submit-login
|
|
71
|
-
menu = await waitChoose();
|
|
72
|
-
if (!/LoggedIn|Add all to cart/.test(menu)) {
|
|
73
|
-
throw new Error(`expected inventory after login, got:\n${menu}`);
|
|
74
|
-
}
|
|
75
|
-
send(`${pickByLabel(menu, "Add all to cart")}\n`);
|
|
76
|
-
menu = await waitChoose();
|
|
77
|
-
send(`${pickByLabel(menu, "Remove all from cart")}\n`);
|
|
78
|
-
menu = await waitChoose();
|
|
79
|
-
if (!/Add all to cart/.test(menu)) {
|
|
80
|
-
throw new Error(`expected Add all again after remove-all, got:\n${menu}`);
|
|
81
|
-
}
|
|
82
|
-
send("q\n");
|
|
83
|
-
const code = await new Promise((res) => child.on("exit", res));
|
|
84
|
-
if (code !== 0 && code !== null) process.exitCode = code;
|
|
85
|
-
else console.error("\ndrive-auto-cli: PASS login -> add-all -> remove-all -> quit");
|
|
86
|
-
} catch (err) {
|
|
87
|
-
console.error(err instanceof Error ? err.message : String(err));
|
|
88
|
-
child.kill("SIGTERM");
|
|
89
|
-
process.exitCode = 1;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
main();
|