@shivaedev/test-story 0.29.0 → 0.31.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/CHANGELOG.md +30 -0
- package/README.md +135 -34
- package/dist/server/adapters/outcomeMatchers.d.ts +12 -0
- package/dist/server/adapters/outcomeMatchers.d.ts.map +1 -0
- package/dist/server/adapters/outcomeMatchers.js +22 -0
- package/dist/server/adapters/outcomeMatchers.js.map +1 -0
- package/dist/server/{internal → adapters}/screenElements.d.ts +5 -2
- package/dist/server/adapters/screenElements.d.ts.map +1 -0
- package/dist/server/{internal → adapters}/screenElements.js +22 -5
- package/dist/server/adapters/screenElements.js.map +1 -0
- package/dist/server/adapters/screenMutations.d.ts +3 -0
- package/dist/server/adapters/screenMutations.d.ts.map +1 -0
- package/dist/server/adapters/screenMutations.js +11 -0
- package/dist/server/adapters/screenMutations.js.map +1 -0
- package/dist/server/adapters/screenNavigation.d.ts +3 -0
- package/dist/server/adapters/screenNavigation.d.ts.map +1 -0
- package/dist/server/adapters/screenNavigation.js +34 -0
- package/dist/server/adapters/screenNavigation.js.map +1 -0
- package/dist/server/adapters/screenQueries.d.ts +8 -0
- package/dist/server/adapters/screenQueries.d.ts.map +1 -0
- package/dist/server/adapters/screenQueries.js +62 -0
- package/dist/server/adapters/screenQueries.js.map +1 -0
- package/dist/server/fakeHttpService.d.ts +2 -0
- package/dist/server/fakeHttpService.d.ts.map +1 -1
- package/dist/server/fakeHttpService.js +6 -1
- package/dist/server/fakeHttpService.js.map +1 -1
- package/dist/server/internal/fakeHttpReceive.d.ts +1 -1
- package/dist/server/internal/fakeHttpReceive.d.ts.map +1 -1
- package/dist/server/internal/fakeHttpReceive.js +6 -1
- package/dist/server/internal/fakeHttpReceive.js.map +1 -1
- package/dist/server/internal/nextClientHint.d.ts +4 -0
- package/dist/server/internal/nextClientHint.d.ts.map +1 -0
- package/dist/server/internal/{screenActivity.js → nextClientHint.js} +1 -5
- package/dist/server/internal/nextClientHint.js.map +1 -0
- package/dist/server/internal/recordedSignals.d.ts +8 -0
- package/dist/server/internal/recordedSignals.d.ts.map +1 -0
- package/dist/server/internal/recordedSignals.js +44 -0
- package/dist/server/internal/recordedSignals.js.map +1 -0
- package/dist/server/internal/screenAccessibility.d.ts +0 -1
- package/dist/server/internal/screenAccessibility.d.ts.map +1 -1
- package/dist/server/internal/screenAccessibility.js +1 -22
- package/dist/server/internal/screenAccessibility.js.map +1 -1
- package/dist/server/internal/screenReadouts.d.ts +1 -1
- package/dist/server/internal/screenReadouts.d.ts.map +1 -1
- package/dist/server/internal/screenReadouts.js +3 -3
- package/dist/server/internal/screenReadouts.js.map +1 -1
- package/dist/server/internal/screenWaits.d.ts +28 -0
- package/dist/server/internal/screenWaits.d.ts.map +1 -0
- package/dist/server/internal/screenWaits.js +47 -0
- package/dist/server/internal/screenWaits.js.map +1 -0
- package/dist/server/internal/storyIt.d.ts.map +1 -1
- package/dist/server/internal/storyIt.js +2 -1
- package/dist/server/internal/storyIt.js.map +1 -1
- package/dist/server/internal/waitForScreen.d.ts +9 -0
- package/dist/server/internal/waitForScreen.d.ts.map +1 -0
- package/dist/server/internal/waitForScreen.js +36 -0
- package/dist/server/internal/waitForScreen.js.map +1 -0
- package/dist/server/internal/withWatchedClock.d.ts +3 -0
- package/dist/server/internal/withWatchedClock.d.ts.map +1 -0
- package/dist/server/internal/withWatchedClock.js +6 -0
- package/dist/server/internal/withWatchedClock.js.map +1 -0
- package/dist/server/lineSignals.d.ts +8 -0
- package/dist/server/lineSignals.d.ts.map +1 -0
- package/dist/server/lineSignals.js +21 -0
- package/dist/server/lineSignals.js.map +1 -0
- package/dist/server/otlpReceiver.d.ts +39 -1
- package/dist/server/otlpReceiver.d.ts.map +1 -1
- package/dist/server/otlpReceiver.js +17 -8
- package/dist/server/otlpReceiver.js.map +1 -1
- package/dist/server/outcomes.d.ts +8 -1
- package/dist/server/outcomes.d.ts.map +1 -1
- package/dist/server/outcomes.js +6 -6
- package/dist/server/outcomes.js.map +1 -1
- package/dist/server/screenDriver.d.ts +19 -9
- package/dist/server/screenDriver.d.ts.map +1 -1
- package/dist/server/screenDriver.js +18 -58
- package/dist/server/screenDriver.js.map +1 -1
- package/dist/server/watchedClock.d.ts +10 -0
- package/dist/server/watchedClock.d.ts.map +1 -0
- package/dist/server/watchedClock.js +35 -0
- package/dist/server/watchedClock.js.map +1 -0
- package/package.json +4 -4
- package/src/server/adapters/outcomeMatchers.ts +33 -0
- package/src/server/{internal → adapters}/screenElements.ts +22 -5
- package/src/server/adapters/screenMutations.ts +14 -0
- package/src/server/adapters/screenNavigation.ts +37 -0
- package/src/server/adapters/screenQueries.ts +75 -0
- package/src/server/fakeHttpService.ts +7 -1
- package/src/server/internal/fakeHttpReceive.ts +6 -0
- package/src/server/internal/{screenActivity.ts → nextClientHint.ts} +1 -5
- package/src/server/internal/recordedSignals.ts +44 -0
- package/src/server/internal/screenAccessibility.ts +1 -25
- package/src/server/internal/screenReadouts.ts +3 -3
- package/src/server/internal/screenWaits.ts +105 -0
- package/src/server/internal/storyIt.ts +2 -1
- package/src/server/internal/waitForScreen.ts +48 -0
- package/src/server/internal/withWatchedClock.ts +8 -0
- package/src/server/lineSignals.ts +25 -0
- package/src/server/otlpReceiver.ts +23 -8
- package/src/server/outcomes.ts +19 -10
- package/src/server/screenDriver.ts +25 -73
- package/src/server/watchedClock.ts +49 -0
- package/dist/server/internal/screenActivity.d.ts +0 -5
- package/dist/server/internal/screenActivity.d.ts.map +0 -1
- package/dist/server/internal/screenActivity.js.map +0 -1
- package/dist/server/internal/screenElements.d.ts.map +0 -1
- package/dist/server/internal/screenElements.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.31.0 - 2026-10-31
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- Wait for child-process output with scoped `lineSignals` and `untilLine`, exported traces with the OTLP receiver's `untilSpan`, and unfinished HTTP connections with `fakeHttpService.untilAbandoned`. Each wait uses `until`, retains earlier observations, and reports the missing signal on failure.
|
|
8
|
+
- `watchedClock` publishes sleep starts from the native TestClock. Stories use it automatically with a test clock, wait for a matching sleep with `untilTimer`, and advance time while awaiting completion with `passes(interval, then)`.
|
|
9
|
+
|
|
10
|
+
## 0.30.0 - 2026-10-31
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `test-story` exports `lessThan`, `atMost`, `greaterThan` and `atLeast` from `server/adapters/outcomeMatchers.ts` for numeric bounds, including in nested expected values. Failure diffs show the bound and received value.
|
|
15
|
+
- Supply a native `Stream<boolean>` as the screen driver's `pending` signal to wake settlement and target searches when application work changes without a DOM mutation.
|
|
16
|
+
- Wait for visible text with `findText`, removal or hiding with `gone`, and a destination URL prefix with `navigatedAway`. Wait failures name their targets in the story report.
|
|
17
|
+
- Change native select controls with `select(target, value)` inside the renderer's `act` adapter.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- The shared story-testing skill teaches ordered lazy outcomes, nested partial expectations and numeric bounds. Quality’s grouped-outcomes diagnostic recommends the ordered callback form.
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
|
|
25
|
+
- Reach portalled dialogs from the screen driver while keeping `within` scopes local, and find unnamed alerts by their visible text.
|
|
26
|
+
- Avoid holding `act` open between DOM mutations when no pending signal is supplied.
|
|
27
|
+
|
|
28
|
+
### Breaking
|
|
29
|
+
|
|
30
|
+
- `test-story` outcomes now takes an ordered list of `[label, () => readout(), expected]` rows. Migrate each `label: [readout(), expected]` object entry to a tuple and wrap its readout in a callback. Keep labels natural and put rows in their intended run order. Readouts are built only when their row starts. Expected objects match partially at every depth with native `toMatchObject` semantics; arrays retain length and order. Use a plain `expect(...).toEqual(...)` when exact object equality is required.
|
|
31
|
+
- Screen settlement and target searches react to DOM mutations instead of polling. Boolean pending samplers run on the initial check and mutations. Migrate samplers that complete work without a mutation to a pending stream. Target searches now wait for pending work to finish and for the target to render, with the existing timeout diagnostics.
|
|
32
|
+
|
|
3
33
|
## 0.29.0 - 2026-10-31
|
|
4
34
|
|
|
5
35
|
### Added
|
package/README.md
CHANGED
|
@@ -308,10 +308,10 @@ app.it("exports the work span without the planted secret", [], function* ({ runW
|
|
|
308
308
|
yield* runWork();
|
|
309
309
|
yield* disposeRuntime();
|
|
310
310
|
|
|
311
|
-
yield* outcomes(
|
|
312
|
-
"exported spans"
|
|
313
|
-
"exports with the planted secret"
|
|
314
|
-
|
|
311
|
+
yield* outcomes([
|
|
312
|
+
["exported spans", () => exportedSpanNames(), ["CountWords"]],
|
|
313
|
+
["exports with the planted secret", () => exportsContaining("planted-secret"), 0],
|
|
314
|
+
]);
|
|
315
315
|
});
|
|
316
316
|
```
|
|
317
317
|
|
|
@@ -489,7 +489,7 @@ bakery.it("tells each step into the story", [ovenIsLit()], function* ({ baker, o
|
|
|
489
489
|
|
|
490
490
|
A spec starts a story, acts through verbs and checks what a user would see. When it needs a setup or an action the kit lacks, add a trait or verb to the kit instead of building it in the spec.
|
|
491
491
|
|
|
492
|
-
For several outcomes after one action, use `outcomes` from `@shivaedev/test-story/server/outcomes.ts`. Each row
|
|
492
|
+
For several outcomes after one action, use `outcomes` from `@shivaedev/test-story/server/outcomes.ts`. Each row is `[label, () => readout(), expected]`. The list states the run order, independently of alphabetical key sorting:
|
|
493
493
|
|
|
494
494
|
```ts
|
|
495
495
|
import { outcomes } from "@shivaedev/test-story/server/outcomes.ts";
|
|
@@ -497,15 +497,33 @@ import { outcomes } from "@shivaedev/test-story/server/outcomes.ts";
|
|
|
497
497
|
accounts.it("removing Bob leaves Alice signed in", [bobAndAliceAreSignedIn()], function* ({ remove, request, sessions }) {
|
|
498
498
|
yield* remove("bob");
|
|
499
499
|
|
|
500
|
-
yield* outcomes(
|
|
501
|
-
"bob's next request"
|
|
502
|
-
"bob's sessions"
|
|
503
|
-
"alice's next request"
|
|
504
|
-
|
|
500
|
+
yield* outcomes([
|
|
501
|
+
["bob's next request", () => request("bob"), "unauthorized"],
|
|
502
|
+
["bob's sessions", () => sessions("bob"), 0],
|
|
503
|
+
["alice's next request", () => request("alice"), "ok"],
|
|
504
|
+
]);
|
|
505
|
+
});
|
|
506
|
+
```
|
|
507
|
+
|
|
508
|
+
`outcomes` builds and runs each readout only when its row starts, so a verb that tells its line before returning an Effect still prints in row order. It compares all results with one native Vitest `toMatchObject`: objects match partially at every depth, arrays keep their length and order, and asymmetric matchers such as `expect.any(Number)` still work. Each expected value is checked against its own readout’s success type. Repeated labels remain separate rows. A failing readout keeps its typed error and stops later rows; a mismatch shows a labelled diff and the story report points to the `outcomes` call.
|
|
509
|
+
|
|
510
|
+
Import `lessThan`, `atMost`, `greaterThan` or `atLeast` from `@shivaedev/test-story/server/adapters/outcomeMatchers.ts` to state numeric bounds, including inside nested partial values:
|
|
511
|
+
|
|
512
|
+
```ts
|
|
513
|
+
import { atMost, lessThan } from "@shivaedev/test-story/server/adapters/outcomeMatchers.ts";
|
|
514
|
+
import { outcomes } from "@shivaedev/test-story/server/outcomes.ts";
|
|
515
|
+
|
|
516
|
+
accounts.it("removing Bob leaves no sessions within the request budget", [bobIsSignedIn()], function* ({ remove, details, elapsed }) {
|
|
517
|
+
yield* remove("bob");
|
|
518
|
+
|
|
519
|
+
yield* outcomes([
|
|
520
|
+
["bob’s account", () => details("bob"), { account: { sessions: atMost(0) } }],
|
|
521
|
+
["request time", () => elapsed(), lessThan(100)],
|
|
522
|
+
]);
|
|
505
523
|
});
|
|
506
524
|
```
|
|
507
525
|
|
|
508
|
-
`
|
|
526
|
+
`lessThan` and `greaterThan` exclude the limit; `atMost` and `atLeast` include it. A bound mismatch prints its name and limit beside the received value. For one outcome, keep a plain `expect`:
|
|
509
527
|
|
|
510
528
|
```ts
|
|
511
529
|
accounts.it("removing Bob ends his session", [bobIsSignedIn()], function* ({ remove, request }) {
|
|
@@ -555,6 +573,43 @@ Acquire hosts, workers and screens in per-story Scope so they inherit the story'
|
|
|
555
573
|
|
|
556
574
|
A live-clock kit still runs on real time when a story omits the override.
|
|
557
575
|
|
|
576
|
+
### Waiting for a timer
|
|
577
|
+
|
|
578
|
+
Test-clock stories use `watchedClock` automatically, including stories that pin a UTC instant or override a live kit with `clock: "test"`. It instruments the native TestClock and publishes every sleep start as a native `Duration` through its consuming `sleeps` stream. Starts stay queued until consumed, so a wait can observe a sleep that began before it subscribed. Each story gets its own queue.
|
|
579
|
+
|
|
580
|
+
Use `untilTimer(interval)` in a kit verb to wait for the next matching sleep start before advancing time. It consumes starts in arrival order, skipping other durations. Equivalent durations such as `"1 second"` and `"1000 millis"` match. A start records that the sleep was called; it does not mean the timer is still pending. `untilTimer` returns the matching `Duration` and never advances virtual time. Its default deadline is five seconds of live time; pass `{ timeout }` to change it. If no matching sleep starts, it fails with `SignalNotReceived`, naming the missing sleep and the last observation.
|
|
581
|
+
|
|
582
|
+
`passes(interval, then)` advances the native TestClock by the interval, then awaits the supplied Effect and returns its result. Give it the task's completion signal so the verb waits for what the elapsed time triggers:
|
|
583
|
+
|
|
584
|
+
```ts
|
|
585
|
+
import { Queue } from "effect";
|
|
586
|
+
import { passes, untilTimer } from "@shivaedev/test-story/server/watchedClock.ts";
|
|
587
|
+
|
|
588
|
+
verbs: (engine, story) => ({
|
|
589
|
+
untilDeliveryTimer: () => {
|
|
590
|
+
story.tell("wait until the delivery timer starts");
|
|
591
|
+
return untilTimer("1 second");
|
|
592
|
+
},
|
|
593
|
+
twoSecondsPass: () => {
|
|
594
|
+
story.tell("two seconds pass and the delivery completes");
|
|
595
|
+
return passes("2 seconds", Queue.take(engine.delivered));
|
|
596
|
+
},
|
|
597
|
+
}),
|
|
598
|
+
```
|
|
599
|
+
|
|
600
|
+
```ts
|
|
601
|
+
deliveries.it("delivers after its timer fires", [], function* ({ send, untilDeliveryTimer, twoSecondsPass }) {
|
|
602
|
+
yield* send("parcel");
|
|
603
|
+
yield* untilDeliveryTimer();
|
|
604
|
+
|
|
605
|
+
const delivered = yield* twoSecondsPass();
|
|
606
|
+
|
|
607
|
+
expect(delivered).toBe("parcel");
|
|
608
|
+
});
|
|
609
|
+
```
|
|
610
|
+
|
|
611
|
+
Outside a story kit, `yield* watchedClock` instruments the active native TestClock within Scope; provide the returned value as `Clock.Clock` within its Scope. It preserves the active clock's time, adjustments and `withLive` behavior. Acquire it under `TestClock.layer()` to retain the native scheduler. Live-clock stories keep their live clock, and sleeps inside `withLive` do not enter the watched queue.
|
|
612
|
+
|
|
558
613
|
### Running the engine
|
|
559
614
|
|
|
560
615
|
Hooks and steps that wait for real workers can use `withLive(Effect.sleep(...))` or `withLive(eventually(...))` from `@shivaedev/test/withLive.ts` and `@shivaedev/test/eventually.ts`. Both work under the kit's live clock and a story's TestClock override. The wrapped work uses live time without advancing the story's virtual time; outside it, the selected clock still applies. Unwrapped `eventually` uses the active clock and advances TestClock between attempts.
|
|
@@ -597,6 +652,40 @@ The helpers subscribe by running the stream before inspecting its values. Use a
|
|
|
597
652
|
|
|
598
653
|
A deadline or stream ending without a match fails with `SignalNotReceived` in the error channel. Its message names the missing signal, shows the last observation (the collection for `collectUntil`, or that no value arrived), and includes a `help:` line. Source failures pass through.
|
|
599
654
|
|
|
655
|
+
### Waiting for process output, spans and abandoned requests
|
|
656
|
+
|
|
657
|
+
Acquire `lineSignals(child.stdout)` or `lineSignals(child.stderr)` in the kit's scoped `create` hook before driving the child. Its `untilLine(matches, options)` waits for a complete line and returns it; `lines` reads the captured lines. It handles lines split across writes, CRLF, UTF-8 characters split across writes, and the final line without a newline. Closing the story scope closes the line reader; the kit owns the child process lifetime.
|
|
658
|
+
|
|
659
|
+
```ts
|
|
660
|
+
import { lineSignals } from "@shivaedev/test-story/server/lineSignals.ts";
|
|
661
|
+
|
|
662
|
+
const output = yield* lineSignals(child.stdout);
|
|
663
|
+
const readyLine = yield* output.untilLine(
|
|
664
|
+
(line) => line === "Worker ready",
|
|
665
|
+
{ name: "worker readiness", timeout: "2 seconds" },
|
|
666
|
+
);
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
The OTLP receiver offers `untilSpan(matches, options)` and returns the decoded matching `OtlpSpan`. Use it to wait for a real exporter without polling `receiver.spans`.
|
|
670
|
+
|
|
671
|
+
```ts
|
|
672
|
+
const completed = yield* receiver.untilSpan(
|
|
673
|
+
(span) => span.name === "process-order",
|
|
674
|
+
{ name: "order processing span" },
|
|
675
|
+
);
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
`fakeHttpService` offers `untilAbandoned(matches, options)`. It returns the request record when the connection closes before its response finishes, including a held request or a stalled response body. Completed responses do not emit this signal. An unfinished connection closed by a scripted fault also qualifies; the signal observes the connection, not who closed it.
|
|
679
|
+
|
|
680
|
+
```ts
|
|
681
|
+
const abandoned = yield* service.untilAbandoned(
|
|
682
|
+
(request) => request.path === "/orders/42",
|
|
683
|
+
{ name: "abandoned order request" },
|
|
684
|
+
);
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
All three adapters retain observations from acquisition, so a wait can start before or after its matching event. Each wait observes independently. They use `until` and its live-time deadline and `SignalNotReceived` diagnostics. Ending child output without a match fails immediately with the last line; a missing span or abandoned request fails at the deadline with the last observation. A silent source reports that no values arrived.
|
|
688
|
+
|
|
600
689
|
### When a story fails
|
|
601
690
|
|
|
602
691
|
After the engine has been created, a failing story test adds the story to its first error, as in the examples above:
|
|
@@ -743,15 +832,18 @@ pnpm add --save-dev react react-dom @effect/atom-react @types/react @types/react
|
|
|
743
832
|
|
|
744
833
|
`screenDriver(options)` supplies DOM verbs and readouts for a kit's `verbs` hook. Give it the mounted `root` (or a getter for a root that navigation replaces) and the story's `tell`. The `pending` option is required for `settle()`; `nextLiveHint()` requires client activity in that option. DOM actions, lookups and synchronous readouts work without it. Without `pending`, `settle()` fails immediately in its error channel with `MissingScreenPending`, exported from `server/screenDriver.ts`, even when the screen is idle.
|
|
745
834
|
|
|
746
|
-
To use `settle()`, supply a `pending()`
|
|
835
|
+
To use `settle()`, supply a native `Stream<boolean>` as `pending`, emitting the current pending state on subscription and every subsequent change. For example, a package that tracks work in a native `SubscriptionRef<boolean>` supplies `pending: SubscriptionRef.changes(requests.pending)`. For a native boolean atom, use `AtomRegistry.toStream(view.registry, pendingAtom)` from `effect/reactivity/AtomRegistry`. Keep pending true until the resulting screen work is ready to render. Settlement keeps its `Effect<void>` type with no typed errors and waits until the stream emits false; DOM mutations also wake the driver, and repeated identical renders never count as completion. `find()` waits for pending work to finish and its target to appear, reacting to both signals and mutations.
|
|
836
|
+
|
|
837
|
+
A `pending: () => boolean` sampler remains available for packages whose pending work completes with a DOM mutation. It is sampled after the initial renderer flush and on mutations, without a polling timer. Use the stream when pending can become false without changing the DOM.
|
|
747
838
|
|
|
748
839
|
```ts
|
|
840
|
+
import { SubscriptionRef } from "effect";
|
|
749
841
|
import { screenDriver } from "@shivaedev/test-story/server/screenDriver.ts";
|
|
750
842
|
|
|
751
843
|
verbs: ({ view, requests }, story) =>
|
|
752
844
|
screenDriver({
|
|
753
845
|
root: view.container,
|
|
754
|
-
pending: (
|
|
846
|
+
pending: SubscriptionRef.changes(requests.pending),
|
|
755
847
|
tell: story.tell,
|
|
756
848
|
});
|
|
757
849
|
```
|
|
@@ -768,18 +860,24 @@ yield* screen.settle();
|
|
|
768
860
|
expect(screen.text("output")).toBe("Saved title");
|
|
769
861
|
```
|
|
770
862
|
|
|
771
|
-
This form of `settle()` observes client activity changes and flushes the renderer before returning. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not.
|
|
863
|
+
This form of `settle()` observes client activity changes and flushes the renderer before returning. Finite RPC calls, coalesced invalidations and refreshing query atoms all keep it waiting; subscription streams themselves do not. `find()` waits for idle client activity and a matching target, including a target rendered by a later DOM mutation. Keep live coalescing enabled. `nextLiveHint()` waits for the next subscription update received after the verb starts, including initial or resync updates; it does not wait for a refresh. Start the wait before another viewer writes, then settle before reading the resulting screen. It needs client activity; a callback-only driver fails with `MissingClientActivity`.
|
|
772
864
|
|
|
773
|
-
`click(selector)`, `enter(selector, value)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root; missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Disabled controls refuse clicks and
|
|
865
|
+
`click(selector)`, `enter(selector, value)`, `select(selector, value)` and `submit(selector = "form")` return Effects. Selectors identify exactly one descendant of the root or a dialog portalled into its document; missing or ambiguous controls fail. Hidden targets and targets inside hidden ancestors refuse actions and readouts. Text entry focuses an input or textarea and dispatches input and change events. Select focuses a native `<select>`, sets an available option value and dispatches change inside `act`. Disabled controls refuse clicks, entry and selection, inert ancestors also prevent form submission, and read-only fields refuse entry. Actions do not wait for settlement, so a story can release a held request before calling `settle()`.
|
|
774
866
|
|
|
775
|
-
`within(container)` returns the same driver scoped to that container, including nested `within` calls. Pass a selector, a role/name target or an `HTMLElement`. Selector and role containers must resolve to one rendered descendant and use the usual missing or ambiguous target diagnostics. For example, `within({ role: "region", name: "Billing" }).click({ role: "button", name: "Save" })` can address a Save button when Delivery has an identical button. Settlement keeps the original pending signal and error type.
|
|
867
|
+
`within(container)` returns the same driver scoped to that container, including nested `within` calls. Pass a selector, a role/name target or an `HTMLElement`. Selector and role containers must resolve to one rendered descendant and use the usual missing or ambiguous target diagnostics. For example, `within({ role: "region", name: "Billing" }).click({ role: "button", name: "Save" })` can address a Save button when Delivery has an identical button. A scoped driver searches only that container, including when the container is a portalled dialog. Settlement keeps the original pending signal and error type.
|
|
776
868
|
|
|
777
869
|
`text(selector?)` reads visible HTML text from the selected element or the whole root. Block boundaries (using CSS display) and `<br>` separate adjacent text with a newline when there is no existing whitespace; inline text, including emphasis, stays joined. A card's title, message and action read as separate parts. Text transforms and layout wrapping are not applied. `value(selector)` returns the current input or textarea value. Both narrate what they read through `tell` and leave assertions to the spec. Entry narration omits the supplied value.
|
|
778
870
|
|
|
779
|
-
`click`, `enter`, `submit`, `text` and `value` also accept a `ScreenTarget` object such as `{ role: "button", name: "Save" }` or `{ role: "textbox", name: /email/i }`. The role and computed accessible name must match exactly when strings are used; regular expressions match the name. Like Testing Library's role queries, these targets exclude hidden elements, including `aria-hidden` ancestors. Missing or ambiguous targets fail with the requested role, name and the visible candidates on screen. Narration names the role and name instead of a selector.
|
|
871
|
+
`click`, `enter`, `select`, `submit`, `text` and `value` also accept a `ScreenTarget` object such as `{ role: "button", name: "Save" }` or `{ role: "textbox", name: /email/i }`. The role and computed accessible name must match exactly when strings are used; regular expressions match the name. An alert without an accessible name can instead match its visible text. Like Testing Library's role queries, these targets exclude hidden elements, including `aria-hidden` ancestors. Missing or ambiguous targets fail with the requested role, name and the visible candidates on screen. Narration names the role and name instead of a selector.
|
|
780
872
|
|
|
781
873
|
`find(target, { timeout }?)` returns an Effect that waits for exactly one matching rendered element and returns that `HTMLElement`. It accepts the same selectors and role/name targets as the actions, narrates the lookup, and uses the driver's live-time `timeoutMs` limit unless `timeout` overrides it in milliseconds. If no unique element appears before the limit, it fails with the same target diagnostics as the actions, including visible candidates for role/name targets.
|
|
782
874
|
|
|
875
|
+
`findText(text, { timeout }?)` waits for one visible element with matching text, returning the deepest matching `HTMLElement`. Strings match exactly after whitespace normalization; regular expressions also work. Inline markup stays joined and hidden text is excluded. Separate visible matches are ambiguous, and a timeout names the text being awaited.
|
|
876
|
+
|
|
877
|
+
`gone(target, { timeout }?)` waits until no rendered element matches the selector or role/name target. It accepts an already absent target and observes removal and hiding through DOM mutations, without polling. Like `find`, both waits also observe a supplied pending signal and wait until it is idle.
|
|
878
|
+
|
|
879
|
+
`navigatedAway(prefix, { timeout }?)` waits until the document's URL starts with the expected destination prefix, such as `https://identity.example/authorize`. It accepts navigation that already happened and observes happy-dom location assignment, including `assign` and `replace`, without polling or waiting for app work to settle. A timeout reports the prefix and current URL. The temporary location observer is released on completion, timeout or interruption. These waits use the driver's `timeoutMs` unless a per-call `timeout` overrides it.
|
|
880
|
+
|
|
783
881
|
`accessible(selector)` returns `{ name, role }` computed by `dom-accessibility-api`, including native roles and label references that take precedence over `aria-label`. It narrates the readout and uses the same single rendered target checks as other readouts. Assert on this result when checking a control's accessible name; reading its raw attributes does not compute that name. This DOM computation does not inspect a browser's accessibility tree or prove speech from a screen reader.
|
|
784
882
|
|
|
785
883
|
`accessible(element)` uses the same computation on an `Element` the kit already holds and tells no story line.
|
|
@@ -807,23 +905,26 @@ A story calls `const hints = yield* watchHints()` before the write, then `yield*
|
|
|
807
905
|
|
|
808
906
|
Import each module with the prefix `@shivaedev/test-story/`; there is no root entry.
|
|
809
907
|
|
|
810
|
-
| Module
|
|
811
|
-
|
|
|
812
|
-
| `server/storyKit.ts`
|
|
813
|
-
| `server/
|
|
814
|
-
| `server/
|
|
815
|
-
| `server/
|
|
816
|
-
| `server/
|
|
817
|
-
| `server/
|
|
818
|
-
| `server/
|
|
819
|
-
| `server/
|
|
820
|
-
| `server/
|
|
821
|
-
| `server/
|
|
822
|
-
| `server/
|
|
823
|
-
| `server/
|
|
824
|
-
| `server/
|
|
825
|
-
| `server/
|
|
826
|
-
| `server/
|
|
908
|
+
| Module | Exports |
|
|
909
|
+
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
910
|
+
| `server/storyKit.ts` | `storyKit`, `Trait`, `RunUntilOptions`, `Story`, `RunHooks`, `StoryKitDefinition`, `Told`, `StoryBody`, `StoryTest`, `StoryIt`, `StoryKit` |
|
|
911
|
+
| `server/adapters/outcomeMatchers.ts` | `lessThan(limit)`, `atMost(limit)`, `greaterThan(limit)`, `atLeast(limit)`, `NumericBound` |
|
|
912
|
+
| `server/outcomes.ts` | `outcomes(rows)` |
|
|
913
|
+
| `server/lineSignals.ts` | `lineSignals(output)` with `lines` and `untilLine(matches, options)` |
|
|
914
|
+
| `server/until.ts` | `until(stream, matches, options)`, `collectUntil(stream, matches, options)`, `UntilOptions`, `SignalNotReceived` |
|
|
915
|
+
| `server/watchedClock.ts` | `watchedClock`, `WatchedClock`, `untilTimer(interval, options?)`, `passes(interval, then)` |
|
|
916
|
+
| `server/browserReads.ts` | `browserReads(options)`, `BrowserReadsOptions`, `BrowserRead`, `BrowserSubscription` |
|
|
917
|
+
| `server/domFetch.ts` | `domFetch(baseUrl, target?)` |
|
|
918
|
+
| `server/seedCookies.ts` | `seedCookies(cookies, target?)`, `DomCookie` |
|
|
919
|
+
| `server/routeOutbound.ts` | `routeOutbound(routes)` |
|
|
920
|
+
| `server/screenDriver.ts` | `screenDriver(options)`, `ScreenDriverOptions`, `ScreenDriver`, `ScreenTarget`, `MissingScreenPending` |
|
|
921
|
+
| `server/memberScreens.ts` | `memberScreens(options)`, `MemberScreen` |
|
|
922
|
+
| `server/domNavigate.ts` | `domNavigate(url?)` |
|
|
923
|
+
| `server/genreTags.ts` | `genreTags(...kitNames)`, `GenreTag` |
|
|
924
|
+
| `server/domEnvironment.config.ts` | Default Vitest environment preserving Node host globals and happy-dom document transport |
|
|
925
|
+
| `server/fakeHttpService.ts` | `fakeHttpService(options)`, `FakeHttpRoute`, `FakeHttpRequest`, `FakeHttpRequestRecord` (`status`: number, `"pending"` or `"unanswered"`), `FakeHttpReply`, `FakeHttpReplySource` (fixed or request/time function), `FakeHttpFault`, `FakeHttpHold`, `FakeHttpHoldOptions` (`params`, `once`), `FakeHttpScope`, `FakeHttpScriptOptions`, `FakeHttpScript`, `FakeHttpServiceOptions` |
|
|
926
|
+
| `server/forwardingProxy.ts` | `forwardingProxy(upstream, options?)`, `ForwardingProxyOptions` |
|
|
927
|
+
| `server/otlpReceiver.ts` | `otlpReceiver(options?)`, `OtlpSpan`, `OtlpExport`, `OtlpReceiverOptions` |
|
|
827
928
|
|
|
828
929
|
### Install and limits
|
|
829
930
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface NumericBound {
|
|
2
|
+
readonly $$typeof: symbol;
|
|
3
|
+
readonly asymmetricMatch: (actual: unknown) => boolean;
|
|
4
|
+
readonly getExpectedType: () => string;
|
|
5
|
+
readonly toAsymmetricMatcher: () => string;
|
|
6
|
+
readonly toString: () => string;
|
|
7
|
+
}
|
|
8
|
+
export declare function lessThan(limit: number): NumericBound;
|
|
9
|
+
export declare function atMost(limit: number): NumericBound;
|
|
10
|
+
export declare function greaterThan(limit: number): NumericBound;
|
|
11
|
+
export declare function atLeast(limit: number): NumericBound;
|
|
12
|
+
//# sourceMappingURL=outcomeMatchers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcomeMatchers.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/outcomeMatchers.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;IACvD,QAAQ,CAAC,eAAe,EAAE,MAAM,MAAM,CAAC;IACvC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,MAAM,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,CAAC;CAChC;AAYD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,gBAErC;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,gBAEnC;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,gBAExC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,gBAEpC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
function bound(name, limit, compare) {
|
|
2
|
+
return {
|
|
3
|
+
$$typeof: Symbol.for("jest.asymmetricMatcher"),
|
|
4
|
+
asymmetricMatch: (actual) => typeof actual === "number" && compare(actual, limit),
|
|
5
|
+
getExpectedType: () => "number",
|
|
6
|
+
toAsymmetricMatcher: () => `${name}(${limit})`,
|
|
7
|
+
toString: () => name,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export function lessThan(limit) {
|
|
11
|
+
return bound("lessThan", limit, (actual, value) => actual < value);
|
|
12
|
+
}
|
|
13
|
+
export function atMost(limit) {
|
|
14
|
+
return bound("atMost", limit, (actual, value) => actual <= value);
|
|
15
|
+
}
|
|
16
|
+
export function greaterThan(limit) {
|
|
17
|
+
return bound("greaterThan", limit, (actual, value) => actual > value);
|
|
18
|
+
}
|
|
19
|
+
export function atLeast(limit) {
|
|
20
|
+
return bound("atLeast", limit, (actual, value) => actual >= value);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=outcomeMatchers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outcomeMatchers.js","sourceRoot":"","sources":["../../../src/server/adapters/outcomeMatchers.ts"],"names":[],"mappings":"AAQA,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa,EAAE,OAAmD;IAC9F,OAAO;QACN,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC;QAC9C,eAAe,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,MAAM,KAAK,QAAQ,IAAI,OAAO,CAAC,MAAM,EAAE,KAAK,CAAC;QACjF,eAAe,EAAE,GAAG,EAAE,CAAC,QAAQ;QAC/B,mBAAmB,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,IAAI,KAAK,GAAG;QAC9C,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI;KACpB,CAAC;AACH,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAa;IACrC,OAAO,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,KAAa;IACxC,OAAO,KAAK,CAAC,aAAa,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { screenText } from "#internal/screenText.ts";
|
|
1
2
|
import type { ScreenTarget } from "#screenDriver.ts";
|
|
2
|
-
|
|
3
|
-
export declare function screenElements(root: () => HTMLElement): {
|
|
3
|
+
export declare function screenElements(root: () => HTMLElement, dialogs?: boolean): {
|
|
4
4
|
element: (selector: ScreenTarget) => HTMLElement;
|
|
5
5
|
enabled: (found: HTMLElement, selector: ScreenTarget) => void;
|
|
6
6
|
enter: (selector: ScreenTarget, value: string) => void;
|
|
7
7
|
form: (selector: ScreenTarget) => HTMLFormElement;
|
|
8
8
|
input: (selector: ScreenTarget) => HTMLInputElement | HTMLTextAreaElement;
|
|
9
|
+
matches: (target: ScreenTarget) => HTMLElement[];
|
|
9
10
|
rendered: (found: HTMLElement, selector: string) => HTMLElement;
|
|
11
|
+
select: (selector: ScreenTarget, value: string) => void;
|
|
10
12
|
text: typeof screenText;
|
|
13
|
+
textElement: (text: string | RegExp) => HTMLElement;
|
|
11
14
|
};
|
|
12
15
|
//# sourceMappingURL=screenElements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenElements.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenElements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGrD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,WAAW,EAAE,OAAO,UAAO;wBAQ1C,YAAY;qBAsBf,WAAW,YAAY,YAAY;sBAQxC,YAAY,SAAS,MAAM;qBAY5B,YAAY;sBA7BL,YAAY;;sBAnBZ,WAAW,YAAY,MAAM;uBA2DlC,YAAY,SAAS,MAAM;;;EAgB/C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { isRendered,
|
|
2
|
-
import { screenText } from "
|
|
3
|
-
|
|
1
|
+
import { isRendered, targetName } from "#internal/screenAccessibility.ts";
|
|
2
|
+
import { screenText } from "#internal/screenText.ts";
|
|
3
|
+
import { screenQueries } from "./screenQueries.js";
|
|
4
|
+
export function screenElements(root, dialogs = true) {
|
|
5
|
+
const queries = screenQueries(root, dialogs);
|
|
4
6
|
function rendered(found, selector) {
|
|
5
7
|
if (!isRendered(found)) {
|
|
6
8
|
throw new Error(`The screen's ${selector} is not rendered.\nhelp: Reveal the target and its ancestors before acting on or reading it.`);
|
|
@@ -9,9 +11,9 @@ export function screenElements(root) {
|
|
|
9
11
|
}
|
|
10
12
|
function element(selector) {
|
|
11
13
|
if (typeof selector !== "string") {
|
|
12
|
-
return roleElement(
|
|
14
|
+
return queries.roleElement(selector);
|
|
13
15
|
}
|
|
14
|
-
const matches =
|
|
16
|
+
const matches = queries.query(selector);
|
|
15
17
|
const found = matches[0];
|
|
16
18
|
if (matches.length !== 1 || found === undefined) {
|
|
17
19
|
throw new Error(`The screen has ${matches.length} matches for ${JSON.stringify(selector)}.\nhelp: Use a selector for exactly one rendered control or readout.`);
|
|
@@ -54,8 +56,23 @@ export function screenElements(root) {
|
|
|
54
56
|
return found;
|
|
55
57
|
},
|
|
56
58
|
input,
|
|
59
|
+
matches: queries.matches,
|
|
57
60
|
rendered,
|
|
61
|
+
select: (selector, value) => {
|
|
62
|
+
const field = element(selector);
|
|
63
|
+
if (!(field instanceof HTMLSelectElement)) {
|
|
64
|
+
throw new Error(`The screen's ${targetName(selector)} is not a select.\nhelp: Select a rendered select control.`);
|
|
65
|
+
}
|
|
66
|
+
enabled(field, selector);
|
|
67
|
+
if (!Array.from(field.options).some((option) => option.value === value)) {
|
|
68
|
+
throw new Error(`The screen's ${targetName(selector)} has no option ${JSON.stringify(value)}.\nhelp: Choose an available option value.`);
|
|
69
|
+
}
|
|
70
|
+
field.focus();
|
|
71
|
+
field.value = value;
|
|
72
|
+
field.dispatchEvent(new Event("change", { bubbles: true }));
|
|
73
|
+
},
|
|
58
74
|
text: screenText,
|
|
75
|
+
textElement: queries.textElement,
|
|
59
76
|
};
|
|
60
77
|
}
|
|
61
78
|
//# sourceMappingURL=screenElements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenElements.js","sourceRoot":"","sources":["../../../src/server/adapters/screenElements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,UAAU,cAAc,CAAC,IAAuB,EAAE,OAAO,GAAG,IAAI;IACrE,MAAM,OAAO,GAAG,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAC7C,SAAS,QAAQ,CAAC,KAAkB,EAAE,QAAgB;QACrD,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,gBAAgB,QAAQ,8FAA8F,CAAC,CAAC;QACzI,CAAC;QACD,OAAO,KAAK,CAAC;IACd,CAAC;IACD,SAAS,OAAO,CAAC,QAAsB;QACtC,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,OAAO,GAAG,OA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K,EAAE,QAAQ,CAAC,CAAC;YACzB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC,EAAE,CAAC;gBACzE,MAAM,IAAI,KAAK,CAAC,gBAAgB,UAAU,CAAC,QAAQ,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,4CAA4C,CAAC,CAAC;YAC1I,CAAC;YACD,KAAK,CAAC,KAAK,EAAE,CAAC;YACd,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YACpB,KAAK,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC;QACD,IAAI,EAAE,UAAU;QAChB,WAAW,EAAE,OAAO,CAAC,WAAW;KAChC,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenMutations.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,IAAI,wEAWrE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
export function screenMutations(root, changed) {
|
|
3
|
+
return Effect.acquireRelease(Effect.sync(() => {
|
|
4
|
+
const observer = new MutationObserver(changed);
|
|
5
|
+
// Root getters can follow navigation, and visibility can change on an ancestor.
|
|
6
|
+
observer.observe(root.ownerDocument, { attributes: true, characterData: true, childList: true, subtree: true });
|
|
7
|
+
observer.observe(root, { attributes: true, characterData: true, childList: true, subtree: true });
|
|
8
|
+
return observer;
|
|
9
|
+
}), (observer) => Effect.sync(() => observer.disconnect()));
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=screenMutations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenMutations.js","sourceRoot":"","sources":["../../../src/server/adapters/screenMutations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,IAAiB,EAAE,OAAmB;IACrE,OAAO,MAAM,CAAC,cAAc,CAC3B,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE;QAChB,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,CAAC;QAC/C,gFAAgF;QAChF,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAChH,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAClG,OAAO,QAAQ,CAAC;IACjB,CAAC,CAAC,EACF,CAAC,QAAQ,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenNavigation.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,WAAW,EAAE,MAAM,EAAE,MAAM,qCAkCvE"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
export function screenNavigation(root, prefix) {
|
|
3
|
+
return Effect.suspend(() => {
|
|
4
|
+
const location = root().ownerDocument.location;
|
|
5
|
+
const original = Object.getOwnPropertyDescriptor(location, "href");
|
|
6
|
+
const descriptor = original ?? Object.getOwnPropertyDescriptor(Object.getPrototypeOf(location), "href");
|
|
7
|
+
const wait = Effect.callback((resume) => {
|
|
8
|
+
function changed() {
|
|
9
|
+
if (location.href.startsWith(prefix)) {
|
|
10
|
+
resume(Effect.void);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
// happy-dom's detached window changes location without emitting a navigation event.
|
|
14
|
+
Object.defineProperty(location, "href", {
|
|
15
|
+
configurable: true,
|
|
16
|
+
get: () => descriptor?.get?.call(location),
|
|
17
|
+
set: (value) => {
|
|
18
|
+
descriptor?.set?.call(location, value);
|
|
19
|
+
changed();
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
changed();
|
|
23
|
+
});
|
|
24
|
+
return wait.pipe(Effect.ensuring(Effect.sync(() => {
|
|
25
|
+
if (original) {
|
|
26
|
+
Object.defineProperty(location, "href", original);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
Reflect.deleteProperty(location, "href");
|
|
30
|
+
}
|
|
31
|
+
})));
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=screenNavigation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenNavigation.js","sourceRoot":"","sources":["../../../src/server/adapters/screenNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,gBAAgB,CAAC,IAAuB,EAAE,MAAc;IACvE,OAAO,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,QAAQ,GAAG,IAAI,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC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from "#screenDriver.ts";
|
|
2
|
+
export declare function screenQueries(root: () => HTMLElement, dialogs: boolean): {
|
|
3
|
+
matches: (target: ScreenTarget) => HTMLElement[];
|
|
4
|
+
query: (selector: string) => HTMLElement[];
|
|
5
|
+
roleElement: (target: Exclude<ScreenTarget, string>) => HTMLElement;
|
|
6
|
+
textElement: (text: string | RegExp) => HTMLElement;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=screenQueries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenQueries.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/screenQueries.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAMrD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,WAAW,EAAE,OAAO,EAAE,OAAO;sBAgCnD,YAAY;sBA/BN,MAAM;0BAoCR,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;wBAa/B,MAAM,GAAG,MAAM;EAepC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { isInaccessible } from "dom-accessibility-api";
|
|
2
|
+
import { accessibility, isRendered, targetName } from "#internal/screenAccessibility.ts";
|
|
3
|
+
import { screenText } from "#internal/screenText.ts";
|
|
4
|
+
function matchesText(value, expected) {
|
|
5
|
+
return typeof expected === "string" ? value === expected : new RegExp(expected.source, expected.flags).test(value);
|
|
6
|
+
}
|
|
7
|
+
export function screenQueries(root, dialogs) {
|
|
8
|
+
function query(selector) {
|
|
9
|
+
const current = root();
|
|
10
|
+
const found = new Set(current.querySelectorAll(selector));
|
|
11
|
+
const portals = dialogs
|
|
12
|
+
? [...current.ownerDocument.querySelectorAll('dialog,[role="dialog"],[role="alertdialog"]')].filter((dialog) => !current.contains(dialog))
|
|
13
|
+
: [];
|
|
14
|
+
for (const dialog of portals) {
|
|
15
|
+
if (dialog.matches(selector)) {
|
|
16
|
+
found.add(dialog);
|
|
17
|
+
}
|
|
18
|
+
for (const child of dialog.querySelectorAll(selector)) {
|
|
19
|
+
found.add(child);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return [...found];
|
|
23
|
+
}
|
|
24
|
+
function candidates() {
|
|
25
|
+
return query("*")
|
|
26
|
+
.filter((element) => isRendered(element) && !isInaccessible(element))
|
|
27
|
+
.map((element) => {
|
|
28
|
+
const { role, name } = accessibility(element);
|
|
29
|
+
return { element, name: role === "alert" && name === "" ? screenText(element).replace(/\s+/gu, " ").trim() : name, role };
|
|
30
|
+
})
|
|
31
|
+
.filter(({ role }) => role !== null);
|
|
32
|
+
}
|
|
33
|
+
function roles(target) {
|
|
34
|
+
return candidates().filter(({ role, name }) => role === target.role && matchesText(name, target.name));
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
matches: (target) => (typeof target === "string" ? query(target).filter(isRendered) : roles(target).map(({ element }) => element)).filter((element) => element.isConnected),
|
|
38
|
+
query,
|
|
39
|
+
roleElement: (target) => {
|
|
40
|
+
const matches = roles(target);
|
|
41
|
+
const found = matches[0];
|
|
42
|
+
if (matches.length === 1 && found) {
|
|
43
|
+
return found.element;
|
|
44
|
+
}
|
|
45
|
+
const listing = candidates()
|
|
46
|
+
.map(({ role, name }) => ` - ${role} named ${JSON.stringify(name)}`)
|
|
47
|
+
.join("\n");
|
|
48
|
+
throw new Error(`The screen has ${matches.length} matches for ${targetName(target)}.\nhelp: Use a role and name for exactly one visible target.\nCandidates on screen:\n${listing || " (none)"}`);
|
|
49
|
+
},
|
|
50
|
+
textElement: (text) => {
|
|
51
|
+
const current = root();
|
|
52
|
+
const matches = [current, ...query("*")].filter((element) => isRendered(element) && matchesText(screenText(element).replace(/\s+/gu, " ").trim(), text));
|
|
53
|
+
const deepest = matches.filter((element) => !matches.some((other) => element !== other && element.contains(other)));
|
|
54
|
+
const found = deepest[0];
|
|
55
|
+
if (deepest.length !== 1 || found === undefined) {
|
|
56
|
+
throw new Error(`The screen has ${deepest.length} matches for text ${String(text instanceof RegExp ? text : JSON.stringify(text))}.\nhelp: Use text that identifies exactly one visible element.`);
|
|
57
|
+
}
|
|
58
|
+
return found;
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=screenQueries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"screenQueries.js","sourceRoot":"","sources":["../../../src/server/adapters/screenQueries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGrD,SAAS,WAAW,CAAC,KAAa,EAAE,QAAyB;IAC5D,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACpH,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAuB,EAAE,OAAgB;IACtE,SAAS,KAAK,CAAC,QAAgB;QAC9B,MAAM,OAAO,GAAG,IAAI,EAAE,CAAC;QACvB,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAc,QAAQ,CAAC,CAAC,CAAC;QACvE,MAAM,OAAO,GAAG,OAAO;YACtB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,gBAAgB,CAAc,6CAA6C,CAAC,CAAC,CAAC,MAAM,CAC9G,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CACrC;YACF,CAAC,CAAC,EAAE,CAAC;QACN,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YA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