waygraph 0.10.8 → 0.11.0
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/README.md +3 -2
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +331 -44
- package/dist/engine.d.ts +23 -0
- package/dist/engine.js +21 -0
- package/dist/highlights.d.ts +76 -0
- package/dist/highlights.js +136 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/types.d.ts +26 -15
- package/examples/saucedemo/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +29 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +8 -1
- package/examples/saucedemo/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +6 -0
- package/examples/saucedemo/src/flows/checkout.flow.ts +61 -22
- package/package.json +1 -1
- package/templates/quickstart/package.json +1 -1
- package/templates/quickstart/src/blocks/saucedemo-web/checkout-step-two/methods/finish-order.method.block.ts +29 -1
- package/templates/quickstart/src/blocks/saucedemo-web/inventory/methods/add-to-cart.effect.block.ts +8 -1
- package/templates/quickstart/src/blocks/saucedemo-web/methods/submit-login.method.block.ts +6 -0
- package/templates/quickstart/src/flows/checkout.flow.ts +61 -22
- package/templates/scaffold/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Engine, start, end, withTitle } from "waygraph";
|
|
1
|
+
import { Engine, start, end, withTitle, withHighlightFixtures } from "waygraph";
|
|
2
2
|
import type {
|
|
3
3
|
LoginPage,
|
|
4
4
|
LoggedIn,
|
|
@@ -21,25 +21,64 @@ const engine = new Engine({ headless: false, slowMo: 250 });
|
|
|
21
21
|
// Atomic nav/action per real URL - the shape `waygraph auto` discovers.
|
|
22
22
|
// Explicit type args: AddToCartBlock's In is Checkpoint<string> (wildcard),
|
|
23
23
|
// which trips defineFlow overload inference across a long array.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
24
|
+
//
|
|
25
|
+
// Demo narration showcase (waygraph 0.11+):
|
|
26
|
+
// - Block stubs: submit-login stubBefore, add-to-cart / finish-order stubAfter
|
|
27
|
+
// - Flow fixtures: ticket-style captions (unlimited purposes on .flow.ts)
|
|
28
|
+
// - Slides on finish-order: multi-step yap with Next between slides
|
|
29
|
+
export const checkoutFlow = withHighlightFixtures(
|
|
30
|
+
withTitle(
|
|
31
|
+
engine.defineFlow<
|
|
32
|
+
LoginPage,
|
|
33
|
+
LoggedIn,
|
|
34
|
+
ItemInCart,
|
|
35
|
+
CartPage,
|
|
36
|
+
CheckoutInfoPage,
|
|
37
|
+
CheckoutOverviewPage,
|
|
38
|
+
OrderComplete
|
|
39
|
+
>([
|
|
40
|
+
start,
|
|
41
|
+
NavLoginBlock,
|
|
42
|
+
SubmitLoginForFlow,
|
|
43
|
+
AddToCartBlock,
|
|
44
|
+
NavCartBlock,
|
|
45
|
+
NavCheckoutInfoBlock,
|
|
46
|
+
SubmitCheckoutInfoBlock,
|
|
47
|
+
FinishOrderBlock,
|
|
48
|
+
end,
|
|
49
|
+
]),
|
|
50
|
+
"Owner: Full Checkout",
|
|
51
|
+
),
|
|
52
|
+
{
|
|
53
|
+
"submit-login": {
|
|
54
|
+
stubBefore: {
|
|
55
|
+
username: {
|
|
56
|
+
label: "Demo user",
|
|
57
|
+
detail: "standard_user from Mem — library block stays neutral.",
|
|
58
|
+
tag: "AC",
|
|
59
|
+
},
|
|
60
|
+
password: { label: "Password", detail: "Filled from Mem credentials." },
|
|
61
|
+
submit: { label: "Sign in", tag: "GATE" },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
"add-to-cart": {
|
|
65
|
+
stubAfter: {
|
|
66
|
+
badge: {
|
|
67
|
+
label: "Cart now has the item",
|
|
68
|
+
detail: "Badge updates after Add to cart.",
|
|
69
|
+
tag: "AC",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
"finish-order": {
|
|
74
|
+
stubAfter: {
|
|
75
|
+
thanks: {
|
|
76
|
+
label: "Order placed",
|
|
77
|
+
detail: "Completion header is the durable proof.",
|
|
78
|
+
tag: "GATE",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
// Optional: fixture can replace block slides; leave unset to use block slides.
|
|
82
|
+
},
|
|
83
|
+
},
|
|
45
84
|
);
|