@crvouga/atlas 0.3.0 → 0.4.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +15 -2
  3. package/dist/reports/src/evidence-live.d.ts +6 -0
  4. package/dist/reports/src/evidence-live.js +35 -3
  5. package/dist/reports/src/evidence-types.d.ts +2 -0
  6. package/dist/reports/src/evidence-view.d.ts +15 -2
  7. package/dist/reports/src/evidence-view.js +31 -3
  8. package/dist/reports/src/layer-axes.d.ts +18 -0
  9. package/dist/reports/src/layer-axes.js +51 -0
  10. package/dist/reports/src/layer-catalog.js +1 -1
  11. package/dist/reports/src/layer-merge.d.ts +1 -1
  12. package/dist/reports/src/layer-merge.js +9 -4
  13. package/dist/reports/src/layer-source.js +3 -0
  14. package/dist/reports/src/layer-types.d.ts +2 -0
  15. package/dist/reports/src/layers-route.js +2 -5
  16. package/dist/reports/src/protocol.d.ts +4 -0
  17. package/dist/reports/src/publish.d.ts +2 -0
  18. package/dist/reports/src/publish.js +4 -0
  19. package/dist/reports/src/report-parts.js +3 -0
  20. package/package.json +2 -2
  21. package/packages/reports/README.md +4 -2
  22. package/packages/reports/STORAGE.md +1 -1
  23. package/packages/visualizer/README.md +6 -5
  24. package/packages/visualizer/example/specs/coffee/ordering/cart.qnt +7 -0
  25. package/packages/visualizer/example/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  26. package/packages/visualizer/example/specs/coffee/ordering/drink-price.dmn +24 -0
  27. package/packages/visualizer/example/specs/coffee/ordering/loyalty.feature +7 -0
  28. package/packages/visualizer/example/specs/coffee/ordering/ordering.feature +36 -0
  29. package/packages/visualizer/example/specs/coffee/ordering/payment.als +4 -0
  30. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/cart.qnt +7 -0
  31. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  32. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/drink-price.dmn +24 -0
  33. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/loyalty.feature +7 -0
  34. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/ordering.feature +36 -0
  35. package/packages/visualizer/fixtures/failures/specs/coffee/ordering/payment.als +4 -0
  36. package/packages/visualizer/fixtures/full/specs/coffee/ordering/cart.qnt +7 -0
  37. package/packages/visualizer/fixtures/full/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  38. package/packages/visualizer/fixtures/full/specs/coffee/ordering/drink-price.dmn +24 -0
  39. package/packages/visualizer/fixtures/full/specs/coffee/ordering/loyalty.feature +7 -0
  40. package/packages/visualizer/fixtures/full/specs/coffee/ordering/ordering.feature +36 -0
  41. package/packages/visualizer/fixtures/full/specs/coffee/ordering/payment.als +4 -0
  42. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/cart.qnt +7 -0
  43. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  44. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/drink-price.dmn +24 -0
  45. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/loyalty.feature +7 -0
  46. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/ordering.feature +36 -0
  47. package/packages/visualizer/fixtures/malformed/specs/coffee/ordering/payment.als +4 -0
  48. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/cart.qnt +7 -0
  49. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  50. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/drink-price.dmn +24 -0
  51. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/loyalty.feature +7 -0
  52. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/ordering.feature +36 -0
  53. package/packages/visualizer/fixtures/partial/specs/coffee/ordering/payment.als +4 -0
  54. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/cart.qnt +7 -0
  55. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  56. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/drink-price.dmn +24 -0
  57. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/loyalty.feature +7 -0
  58. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/ordering.feature +36 -0
  59. package/packages/visualizer/fixtures/removed/specs/coffee/ordering/payment.als +4 -0
  60. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/cart.qnt +7 -0
  61. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/checkout.openslo.yaml +10 -0
  62. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/drink-price.dmn +24 -0
  63. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/loyalty.feature +7 -0
  64. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/ordering.feature +36 -0
  65. package/packages/visualizer/fixtures/spec-only/specs/coffee/ordering/payment.als +4 -0
  66. package/packages/visualizer/scripts/make-fixtures.ts +2 -0
  67. package/packages/visualizer/scripts/publish-data.ts +1 -2
  68. package/packages/visualizer/src/components/Header.tsx +1 -1
  69. package/packages/visualizer/src/evidence/check-detail.tsx +35 -3
  70. package/packages/visualizer/src/evidence/evidence.module.css +20 -0
  71. package/packages/visualizer/src/evidence/marks.tsx +2 -0
  72. package/packages/visualizer/src/evidence/overview.tsx +3 -3
  73. package/packages/visualizer/src/evidence/sources-panel.tsx +88 -34
  74. package/packages/visualizer/src/state/ui-store.ts +6 -2
  75. package/packages/visualizer/vite/example-reports.ts +475 -0
  76. package/packages/visualizer/vite.config.ts +9 -1
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -0,0 +1,7 @@
1
+ # Cart
2
+ module cart {
3
+ var items: int
4
+ var paid: bool
5
+ action add = items' = items + 1
6
+ action pay = paid' = true
7
+ }
@@ -0,0 +1,10 @@
1
+ # Checkout latency
2
+ apiVersion: openslo/v1
3
+ kind: SLO
4
+ metadata:
5
+ name: checkout-latency
6
+ spec:
7
+ description: Checkout answers within a second.
8
+ objectives:
9
+ - displayName: Checkout latency
10
+ target: 0.99
@@ -0,0 +1,24 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <definitions xmlns="https://www.omg.org/spec/DMN/20191111/MODEL/">
3
+ <decision id="drink-price" name="Drink price">
4
+ <decisionTable id="Drink price" hitPolicy="UNIQUE">
5
+ <input label="Size">
6
+ <inputExpression typeRef="string"><text>size</text></inputExpression>
7
+ </input>
8
+ <input label="Milk">
9
+ <inputExpression typeRef="string"><text>milk</text></inputExpression>
10
+ </input>
11
+ <output label="Price" name="price" />
12
+ <rule>
13
+ <inputEntry><text>"Small"</text></inputEntry>
14
+ <inputEntry><text>"None"</text></inputEntry>
15
+ <outputEntry><text>3</text></outputEntry>
16
+ </rule>
17
+ <rule>
18
+ <inputEntry><text>"Large"</text></inputEntry>
19
+ <inputEntry><text>"Oat"</text></inputEntry>
20
+ <outputEntry><text>5</text></outputEntry>
21
+ </rule>
22
+ </decisionTable>
23
+ </decision>
24
+ </definitions>
@@ -0,0 +1,7 @@
1
+ Feature: Loyalty stamps
2
+ A regular earns a free drink. No layer has recorded this yet.
3
+
4
+ Scenario: Tenth drink is free
5
+ Given nine stamps
6
+ When the customer orders
7
+ Then the drink is free
@@ -0,0 +1,36 @@
1
+ Feature: Order a drink
2
+ A customer picks a drink, pays, and picks it up.
3
+
4
+ Rule: Paying for the order
5
+
6
+ Scenario: Pays by card
7
+ Given a drink in the cart
8
+ When the customer pays by card
9
+ Then the barista can start the drink
10
+
11
+ Scenario: Pays with a wallet
12
+ Given a drink in the cart
13
+ When the customer pays with a wallet
14
+ Then the order is paid
15
+
16
+ Scenario: Card declined, then a wallet works
17
+ Given a drink in the cart
18
+ When the card is declined
19
+ And the customer pays with a wallet
20
+ Then the order is paid
21
+
22
+ Scenario: Slow payment
23
+ Given a drink in the cart
24
+ When the payment takes longer than a minute
25
+ Then the customer can check the payment again
26
+
27
+ Scenario: Leaves checkout and comes back
28
+ Given a drink in the cart
29
+ When the customer closes checkout
30
+ And the customer starts checkout again
31
+ Then checkout is open
32
+
33
+ Scenario: Drink left too long
34
+ Given a finished drink
35
+ When nobody picks it up
36
+ Then the drink is thrown away and refunded
@@ -0,0 +1,4 @@
1
+ // An order is paid once.
2
+ sig Order { paid: lone Payment }
3
+ sig Payment {}
4
+ fact { all o: Order | one o.paid }
@@ -30,6 +30,8 @@ import { APP_ROOT, FIXTURES_ROOT, listSpecFiles } from '../vite/atlas-files';
30
30
  * Regenerates every fixture from the example spec in `example/specs` (a coffee-ordering app: an
31
31
  * XState root chart with a parallel region that invokes an SCXML checkout chart) and a generated
32
32
  * large atlas. All media is synthetic: ImageMagick draws the screens and ffmpeg the clips.
33
+ * Gherkin, Quint, DMN, Alloy and OpenSLO documents in that spec are copied with the charts.
34
+ * The visualizer dev server serves the layered report for them; this script does not rebuild it.
33
35
  */
34
36
 
35
37
  const EXAMPLE_SPECS = path.join(APP_ROOT, 'example/specs');