@threenative/playtest 0.3.11 → 0.3.13
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/capture.d.ts +1 -1
- package/dist/{diagnostics-BKg7C6Lf.d.ts → diagnostics-0g-Uyvds.d.ts} +2 -12
- package/dist/index.d.ts +14 -5
- package/dist/index.js +3625 -3796
- package/dist/protocol.d.ts +73 -1
- package/dist/protocol.js +13 -1
- package/dist/runner/cli.d.ts +3 -3
- package/dist/runner/cli.js +6946 -6968
- package/dist/runner/index.d.ts +231 -204
- package/dist/runner/index.js +10038 -10105
- package/dist/{schema-base-B26KSBoa.d.ts → schema-base-D8wNuOLE.d.ts} +26 -27
- package/dist/{shared-Dg-3kiU8.d.ts → shared-CRg0jlDU.d.ts} +11 -3
- package/package.json +2 -2
|
@@ -45,7 +45,9 @@ interface IPlaytestRegionalToneObservation extends Partial<IToneMetrics> {
|
|
|
45
45
|
}
|
|
46
46
|
type IPlaytestToneCaptureObservation = IPlaytestToneObservation | IPlaytestRegionalToneObservation;
|
|
47
47
|
|
|
48
|
+
/** The scenario file's `target` vocabulary. It stays as authored; the lane a run executes on is `PlaytestLane`. */
|
|
48
49
|
type PlaytestTarget = "web" | "desktop" | "bevy";
|
|
50
|
+
|
|
49
51
|
type PlaytestInputDelivery = "deterministic" | "focused-dom";
|
|
50
52
|
interface IPlaytestViewport {
|
|
51
53
|
height: number;
|
|
@@ -88,8 +90,24 @@ type IPlaytestResourceWait = {
|
|
|
88
90
|
lte: number;
|
|
89
91
|
path: string;
|
|
90
92
|
};
|
|
93
|
+
/**
|
|
94
|
+
* The standard pad a `gamepad` step holds down: the sticks' four axes and the indices held.
|
|
95
|
+
*/
|
|
96
|
+
interface IPlaytestGamepad {
|
|
97
|
+
/** The standard's stick axes 0..3, each `-1`..`1`. Absent axes read centred. */
|
|
98
|
+
readonly axes?: readonly number[];
|
|
99
|
+
/** Standard button indices held down, `0` south through `15` d-pad right. */
|
|
100
|
+
readonly buttons?: readonly number[];
|
|
101
|
+
}
|
|
91
102
|
interface IPlaytestStep {
|
|
92
103
|
kind?: "aimAt" | "click" | "input" | "lifecycle" | "wait";
|
|
104
|
+
/**
|
|
105
|
+
* A scripted W3C "standard" pad, so a scenario proves a controller binding without hardware. The
|
|
106
|
+
* runner installs `navigator.getGamepads` on the page and this is the pad it returns: `axes` are
|
|
107
|
+
* the standard's stick axes 0..3, `buttons` the indices held down. A step that names it drives
|
|
108
|
+
* input exactly like `press` does, and `release` lifts every button and re-centres both sticks.
|
|
109
|
+
*/
|
|
110
|
+
gamepad?: IPlaytestGamepad;
|
|
93
111
|
/** @deprecated Use holdTicks. Fixed-step bridges treat this as a tick alias. */
|
|
94
112
|
holdFrames?: number;
|
|
95
113
|
holdTicks?: number;
|
|
@@ -287,19 +305,6 @@ interface IPlaytestSettledAssertion {
|
|
|
287
305
|
minMeanPoseDistance?: number;
|
|
288
306
|
requiredOn?: PlaytestTarget[];
|
|
289
307
|
}
|
|
290
|
-
interface IPlaytestOccludedAssertion {
|
|
291
|
-
allowTrivial?: string;
|
|
292
|
-
entity?: string;
|
|
293
|
-
target?: string;
|
|
294
|
-
}
|
|
295
|
-
interface IPlaytestOverlayNodeAssertion {
|
|
296
|
-
attribute?: string;
|
|
297
|
-
equals?: unknown;
|
|
298
|
-
overlayId: string;
|
|
299
|
-
selector: string;
|
|
300
|
-
textIncludes?: string;
|
|
301
|
-
visible?: boolean;
|
|
302
|
-
}
|
|
303
308
|
/**
|
|
304
309
|
* Bounds on the room the game is played in — what a screenshot would have shown, as numbers.
|
|
305
310
|
*
|
|
@@ -667,16 +672,6 @@ interface IPlaytestAerodynamicsAssertion {
|
|
|
667
672
|
sign: "negative" | "positive";
|
|
668
673
|
}>;
|
|
669
674
|
}
|
|
670
|
-
interface IPlaytestReachabilityAssertion {
|
|
671
|
-
artifact: string;
|
|
672
|
-
entities: string[];
|
|
673
|
-
/** Loaded from artifact by loadPlaytestScenario; not authored in scenario JSON. */
|
|
674
|
-
envelope?: {
|
|
675
|
-
fallDistanceToGround: number;
|
|
676
|
-
forwardReach: number;
|
|
677
|
-
maxRise: number;
|
|
678
|
-
};
|
|
679
|
-
}
|
|
680
675
|
interface IPlaytestWorldRuntimeAssertion {
|
|
681
676
|
agent: string;
|
|
682
677
|
core: string;
|
|
@@ -754,13 +749,10 @@ interface IPlaytestScenarioAssertions {
|
|
|
754
749
|
geometry?: IPlaytestGeometryCaptureRequest;
|
|
755
750
|
hud?: IPlaytestPathAssertion[];
|
|
756
751
|
movement?: IPlaytestMovementAssertion;
|
|
757
|
-
occluded?: IPlaytestOccludedAssertion[];
|
|
758
|
-
overlayNodes?: IPlaytestOverlayNodeAssertion[];
|
|
759
752
|
parity?: IPlaytestParityAssertion;
|
|
760
753
|
performance?: IPlaytestPerformanceAssertion;
|
|
761
754
|
pipelineCensus?: IPlaytestPipelineCensusAssertion;
|
|
762
755
|
renderChain?: IPlaytestRenderChainAssertion;
|
|
763
|
-
reachability?: IPlaytestReachabilityAssertion;
|
|
764
756
|
resources?: IPlaytestResourceAssertion[];
|
|
765
757
|
settled?: IPlaytestSettledAssertion[];
|
|
766
758
|
signals?: IPlaytestSignalAssertion[];
|
|
@@ -929,6 +921,13 @@ interface IPlaytestScenario {
|
|
|
929
921
|
sourcePath?: string;
|
|
930
922
|
/** Absolute fixed-step tick reached after startup and warmup, before baseline and input. */
|
|
931
923
|
startTick?: number;
|
|
924
|
+
/**
|
|
925
|
+
* Draw one frame every this many fixed-step ticks, in every tick-advancing step. A component
|
|
926
|
+
* that samples a GPU readback lands at most one sample per drawn frame, so without a cadence the
|
|
927
|
+
* number of samples a scenario gets is a property of the adapter's frame rate and not of its
|
|
928
|
+
* ticks. Absent, ticks advance undrawn as they always did.
|
|
929
|
+
*/
|
|
930
|
+
drawEvery?: number;
|
|
932
931
|
steps: IPlaytestStep[];
|
|
933
932
|
subject?: string;
|
|
934
933
|
target: PlaytestTarget;
|
|
@@ -947,4 +946,4 @@ interface IPlaytestScenarioDiagnostic {
|
|
|
947
946
|
suggestion?: string;
|
|
948
947
|
}
|
|
949
948
|
|
|
950
|
-
export type { IToneMetrics as I,
|
|
949
|
+
export type { IToneMetrics as I, IPlaytestToneAssertion as a, IPlaytestRegionalToneObservation as b, IPlaytestStep as c, IPlaytestScenarioDiagnostic as d, IPlaytestScenario as e, IPlaytestArtifactRequest as f, IPlaytestFramebufferCoverageAssertion as g, IPlaytestGamepad as h, IPlaytestMedia as i, IPlaytestPathAssertion as j, IPlaytestPerformanceAssertion as k, IPlaytestPointer as l, IPlaytestRenderChainAssertion as m, IPlaytestResourceWait as n, IPlaytestSignalAssertion as o, IPlaytestStartupAssertion as p, IPlaytestToneObservation as q, IPlaytestVisualAssertion as r, IPlaytestVisualElementRegion as s, IPlaytestVisualRegion as t, IPlaytestVisualRegionBounds as u, IPlaytestVisualRegionTarget as v, IPlaytestWheel as w, IPlaytestWorldRuntimeAssertion as x, IPlaytestToneCaptureObservation as y, IPlaytestDiagnosticsAssertion as z };
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
import { e as IPlaytestScenario,
|
|
1
|
+
import { e as IPlaytestScenario, k as IPlaytestPerformanceAssertion } from './schema-base-D8wNuOLE.js';
|
|
2
2
|
import { IPlaytestObservationSnapshot } from './protocol.js';
|
|
3
3
|
import { Page } from 'playwright';
|
|
4
|
-
import { I as IPlaytestReport, p as IPlaytestProtocolDiagnostic, l as IPlaytestDiagnosticsPolicy, a as IPlaytestAssertionResult } from './diagnostics-
|
|
4
|
+
import { I as IPlaytestReport, p as IPlaytestProtocolDiagnostic, l as IPlaytestDiagnosticsPolicy, a as IPlaytestAssertionResult } from './diagnostics-0g-Uyvds.js';
|
|
5
5
|
|
|
6
6
|
/** Capture the largest rendered canvas bounds without waiting for locator screenshot stability. */
|
|
7
7
|
declare function captureVisualSurface(page: Page, artifactPath?: string): Promise<Buffer | undefined>;
|
|
8
|
+
/**
|
|
9
|
+
* A step's draw cadence: one rendered frame every `every` ticks. `ticks` counts what the step has
|
|
10
|
+
* already advanced, so a later call (the 10-tick path cadence) continues the same phase.
|
|
11
|
+
*/
|
|
12
|
+
interface IFixedStepDraw {
|
|
13
|
+
every: number;
|
|
14
|
+
ticks: number;
|
|
15
|
+
}
|
|
8
16
|
/**
|
|
9
17
|
* The core bridge is installed before an async scene load completes, so its describe/ready
|
|
10
18
|
* handshake can finish one browser frame before the fixed-step loop starts. Retry only that
|
|
@@ -14,7 +22,7 @@ declare function advanceFixedStep(page: Page, bridge: {
|
|
|
14
22
|
advance(ticks: number, options?: {
|
|
15
23
|
render?: boolean;
|
|
16
24
|
}): Promise<number | undefined | void>;
|
|
17
|
-
}, ticks: number, render?: boolean): Promise<void>;
|
|
25
|
+
}, ticks: number, render?: boolean, draw?: IFixedStepDraw): Promise<void>;
|
|
18
26
|
declare function playtestStepDrivesMovement(step: IPlaytestScenario["steps"][number], hasHeldInput: boolean): boolean;
|
|
19
27
|
interface ICompletionWindow {
|
|
20
28
|
label: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@threenative/playtest",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Scenario-driven playtest harness for Three.js games. Runs on plain Three.js with zero ThreeNative dependencies.",
|
|
6
6
|
"keywords": [
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/ThreeNativeHQ/threenative.git",
|
|
21
|
+
"url": "git+https://github.com/ThreeNativeHQ/threenative-engine.git",
|
|
22
22
|
"directory": "packages/playtest"
|
|
23
23
|
},
|
|
24
24
|
"type": "module",
|