spana-test 0.7.0 → 0.9.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/dist/agent/index.d.ts +2 -2
- package/dist/agent/index.js +9 -9
- package/dist/{allure-RNMEYTXS.js → allure-RAEK4SIH.js} +2 -2
- package/dist/allure-RAEK4SIH.js.map +1 -0
- package/dist/{android-4NVTZMHL.js → android-6BOQTMM3.js} +2 -2
- package/dist/app-DSh1ejLh.d.ts +1266 -0
- package/dist/{chunk-H27IBIGA.js → chunk-2AFWVHQK.js} +63 -43
- package/dist/chunk-2AFWVHQK.js.map +1 -0
- package/dist/{chunk-RURZVMZ7.js → chunk-2KRVN4WN.js} +3 -3
- package/dist/{chunk-T5CROOR7.js → chunk-3UVSUVHW.js} +1828 -299
- package/dist/chunk-3UVSUVHW.js.map +1 -0
- package/dist/{chunk-6B5Y75V4.js → chunk-ALPQES3J.js} +1001 -281
- package/dist/chunk-ALPQES3J.js.map +1 -0
- package/dist/{chunk-2IXXEXTL.js → chunk-FP6PVHHR.js} +2 -2
- package/dist/{chunk-KNSAHEXI.js → chunk-IGTK5MHB.js} +8 -8
- package/dist/chunk-JPZCZHL4.js +79 -0
- package/dist/chunk-JPZCZHL4.js.map +1 -0
- package/dist/{chunk-JYFPZRCN.js → chunk-JZZ2W2XH.js} +5 -2
- package/dist/chunk-JZZ2W2XH.js.map +1 -0
- package/dist/{chunk-HCG4CJKR.js → chunk-SF7UYW4I.js} +3 -3
- package/dist/{chunk-T3EBOYLS.js → chunk-UEWZ2EXL.js} +1314 -129
- package/dist/chunk-UEWZ2EXL.js.map +1 -0
- package/dist/{chunk-HYSTRWYN.js → chunk-VP6V4XEJ.js} +4 -4
- package/dist/{chunk-S5JNNDXS.js → chunk-WV3ALL3H.js} +65 -37
- package/dist/chunk-WV3ALL3H.js.map +1 -0
- package/dist/chunk-Z6K4QQAR.js +358 -0
- package/dist/chunk-Z6K4QQAR.js.map +1 -0
- package/dist/cli.js +23 -11
- package/dist/cli.js.map +1 -1
- package/dist/config-loader-F5YAY7RP.js +9 -0
- package/dist/{console-MI2XB5RG.js → console-BGAK7Z2L.js} +11 -1
- package/dist/{console-MI2XB5RG.js.map → console-BGAK7Z2L.js.map} +1 -1
- package/dist/{daemon-manager-FBISTX24.js → daemon-manager-2EQDVUVM.js} +10 -2
- package/dist/{discover-LHEBSUIP.js → discover-RLSKEBAX.js} +5 -5
- package/dist/{doctor-command-WPEVZEZ4.js → doctor-command-YTCQ2SC7.js} +26 -18
- package/dist/doctor-command-YTCQ2SC7.js.map +1 -0
- package/dist/{flow-g6AICPAl.d.ts → flow-CSMwD9Fh.d.ts} +3 -29
- package/dist/gherkin/steps.d.ts +2 -2
- package/dist/{html-IKCTZH2U.js → html-JO2YNRWX.js} +3 -3
- package/dist/html-JO2YNRWX.js.map +1 -0
- package/dist/index.d.ts +215 -21
- package/dist/index.js +246 -147
- package/dist/index.js.map +1 -1
- package/dist/{installer-VUPFWP5X.js → installer-5UHTYQTB.js} +4 -4
- package/dist/{ios-JPK43TFZ.js → ios-Y4TO5MBR.js} +7 -3
- package/dist/{server-EBPYK3VE.js → server-4YLBAZEM.js} +50 -36
- package/dist/server-4YLBAZEM.js.map +1 -0
- package/dist/{server-IGLBFEU7.js → server-IS4K5FCT.js} +2 -2
- package/dist/{session-cJ_tZjCL.d.ts → session-CgvT-Oso.d.ts} +3 -1
- package/dist/session-K7FCRKOC.js +18 -0
- package/dist/{studio-command-FLA5HKRK.js → studio-command-RFPV2DS7.js} +2 -2
- package/dist/{test-command-P5W7UD52.js → test-command-UEJG5AI6.js} +223 -27
- package/dist/test-command-UEJG5AI6.js.map +1 -0
- package/native/darwin-arm64/libspana_native.dylib +0 -0
- package/native/darwin-x64/libspana_native.dylib +0 -0
- package/native/linux-arm64/libspana_native.so +0 -0
- package/native/linux-x64/libspana_native.so +0 -0
- package/native/win32-x64/spana_native.dll +0 -0
- package/package.json +1 -1
- package/studio-dist/assets/index-CBFsOh-9.js +193 -0
- package/studio-dist/assets/index-DH_18EyL.css +1 -0
- package/studio-dist/index.html +2 -2
- package/dist/allure-RNMEYTXS.js.map +0 -1
- package/dist/app-D_UyZBsl.d.ts +0 -915
- package/dist/chunk-6B5Y75V4.js.map +0 -1
- package/dist/chunk-DTNK54C2.js +0 -127
- package/dist/chunk-DTNK54C2.js.map +0 -1
- package/dist/chunk-H27IBIGA.js.map +0 -1
- package/dist/chunk-JYFPZRCN.js.map +0 -1
- package/dist/chunk-OBCFACUW.js +0 -28
- package/dist/chunk-OBCFACUW.js.map +0 -1
- package/dist/chunk-S5JNNDXS.js.map +0 -1
- package/dist/chunk-T3EBOYLS.js.map +0 -1
- package/dist/chunk-T5CROOR7.js.map +0 -1
- package/dist/config-loader-NIDQGP3K.js +0 -9
- package/dist/doctor-command-WPEVZEZ4.js.map +0 -1
- package/dist/html-IKCTZH2U.js.map +0 -1
- package/dist/server-EBPYK3VE.js.map +0 -1
- package/dist/session-QRWH3SPW.js +0 -18
- package/dist/test-command-P5W7UD52.js.map +0 -1
- package/studio-dist/assets/index-C-Io44gy.js +0 -193
- package/studio-dist/assets/index-DfM9lK4p.css +0 -1
- /package/dist/{android-4NVTZMHL.js.map → android-6BOQTMM3.js.map} +0 -0
- /package/dist/{chunk-RURZVMZ7.js.map → chunk-2KRVN4WN.js.map} +0 -0
- /package/dist/{chunk-2IXXEXTL.js.map → chunk-FP6PVHHR.js.map} +0 -0
- /package/dist/{chunk-KNSAHEXI.js.map → chunk-IGTK5MHB.js.map} +0 -0
- /package/dist/{chunk-HCG4CJKR.js.map → chunk-SF7UYW4I.js.map} +0 -0
- /package/dist/{chunk-HYSTRWYN.js.map → chunk-VP6V4XEJ.js.map} +0 -0
- /package/dist/{config-loader-NIDQGP3K.js.map → config-loader-F5YAY7RP.js.map} +0 -0
- /package/dist/{daemon-manager-FBISTX24.js.map → daemon-manager-2EQDVUVM.js.map} +0 -0
- /package/dist/{discover-LHEBSUIP.js.map → discover-RLSKEBAX.js.map} +0 -0
- /package/dist/{installer-VUPFWP5X.js.map → installer-5UHTYQTB.js.map} +0 -0
- /package/dist/{ios-JPK43TFZ.js.map → ios-Y4TO5MBR.js.map} +0 -0
- /package/dist/{server-IGLBFEU7.js.map → server-IS4K5FCT.js.map} +0 -0
- /package/dist/{session-QRWH3SPW.js.map → session-K7FCRKOC.js.map} +0 -0
- /package/dist/{studio-command-FLA5HKRK.js.map → studio-command-RFPV2DS7.js.map} +0 -0
package/dist/app-D_UyZBsl.d.ts
DELETED
|
@@ -1,915 +0,0 @@
|
|
|
1
|
-
import { Schema, Effect } from 'effect';
|
|
2
|
-
|
|
3
|
-
type Platform = "android" | "ios" | "web" | "electron" | "electrobun";
|
|
4
|
-
type TapMode = "native" | "dom";
|
|
5
|
-
/**
|
|
6
|
-
* Selector types. Generic parameter `T` lets projects pin a union of known
|
|
7
|
-
* testIDs so `{ testID: "bogus-id" }` becomes a type error.
|
|
8
|
-
*
|
|
9
|
-
* Use `systemUI: true` (or the `systemUI(...)` helper) on `{ text }` /
|
|
10
|
-
* `{ accessibilityLabel }` selectors that intentionally target out-of-process
|
|
11
|
-
* OS UI (SFSafariViewController, ASWebAuthenticationSession, Chrome Custom Tabs,
|
|
12
|
-
* permission dialogs) where DOM `data-testid` cannot reach.
|
|
13
|
-
*/
|
|
14
|
-
type Selector<T extends string = string> = T | {
|
|
15
|
-
testID: T;
|
|
16
|
-
} | {
|
|
17
|
-
text: string;
|
|
18
|
-
systemUI?: boolean;
|
|
19
|
-
} | {
|
|
20
|
-
accessibilityLabel: string;
|
|
21
|
-
systemUI?: boolean;
|
|
22
|
-
} | {
|
|
23
|
-
point: {
|
|
24
|
-
x: number;
|
|
25
|
-
y: number;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
/** Relative selector — find element relative to an anchor element's position. */
|
|
29
|
-
interface RelativeSelector<T extends string = string> {
|
|
30
|
-
selector: Selector<T>;
|
|
31
|
-
below?: Selector<T>;
|
|
32
|
-
above?: Selector<T>;
|
|
33
|
-
leftOf?: Selector<T>;
|
|
34
|
-
rightOf?: Selector<T>;
|
|
35
|
-
childOf?: Selector<T>;
|
|
36
|
-
}
|
|
37
|
-
/** Extended selector that supports both simple and relative selectors. */
|
|
38
|
-
type ExtendedSelector<T extends string = string> = Selector<T> | RelativeSelector<T>;
|
|
39
|
-
/**
|
|
40
|
-
* Marks a label/text selector as targeting out-of-process system UI
|
|
41
|
-
* (e.g. SFSafariViewController, ASWebAuthenticationSession, Chrome Custom Tabs,
|
|
42
|
-
* OS permission alerts). Skips the DOM channel and suppresses brittle-text warnings.
|
|
43
|
-
*/
|
|
44
|
-
declare function systemUI(selector: {
|
|
45
|
-
text: string;
|
|
46
|
-
} | {
|
|
47
|
-
accessibilityLabel: string;
|
|
48
|
-
}): {
|
|
49
|
-
text: string;
|
|
50
|
-
systemUI: true;
|
|
51
|
-
} | {
|
|
52
|
-
accessibilityLabel: string;
|
|
53
|
-
systemUI: true;
|
|
54
|
-
};
|
|
55
|
-
declare function isSystemUISelector<T extends string = string>(sel: ExtendedSelector<T>): boolean;
|
|
56
|
-
declare function isTestIDSelector<T extends string = string>(sel: ExtendedSelector<T>): sel is {
|
|
57
|
-
testID: T;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
declare const DriverError_base: Schema.TaggedErrorClass<DriverError, "DriverError", {
|
|
61
|
-
readonly _tag: Schema.tag<"DriverError">;
|
|
62
|
-
} & {
|
|
63
|
-
message: typeof Schema.String;
|
|
64
|
-
command: Schema.optional<typeof Schema.String>;
|
|
65
|
-
exitCode: Schema.optional<typeof Schema.Number>;
|
|
66
|
-
stdout: Schema.optional<typeof Schema.String>;
|
|
67
|
-
stderr: Schema.optional<typeof Schema.String>;
|
|
68
|
-
}>;
|
|
69
|
-
declare class DriverError extends DriverError_base {
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
declare const DeviceInfo: Schema.Struct<{
|
|
73
|
-
platform: Schema.Literal<["android", "ios", "web", "electron", "electrobun"]>;
|
|
74
|
-
deviceId: typeof Schema.String;
|
|
75
|
-
name: typeof Schema.String;
|
|
76
|
-
isEmulator: typeof Schema.Boolean;
|
|
77
|
-
screenWidth: typeof Schema.Number;
|
|
78
|
-
screenHeight: typeof Schema.Number;
|
|
79
|
-
driverType: Schema.Literal<["playwright", "uiautomator2", "wda", "appium", "electron", "electrobun"]>;
|
|
80
|
-
}>;
|
|
81
|
-
type DeviceInfo = typeof DeviceInfo.Type;
|
|
82
|
-
|
|
83
|
-
type DomChannelKind = "bridge" | "cdp" | "webkit-inspector" | "playwright";
|
|
84
|
-
interface DomRect {
|
|
85
|
-
x: number;
|
|
86
|
-
y: number;
|
|
87
|
-
width: number;
|
|
88
|
-
height: number;
|
|
89
|
-
}
|
|
90
|
-
interface DomElementMatch {
|
|
91
|
-
id?: string;
|
|
92
|
-
tag?: string;
|
|
93
|
-
text?: string;
|
|
94
|
-
value?: string;
|
|
95
|
-
accessibilityLabel?: string;
|
|
96
|
-
rect: DomRect;
|
|
97
|
-
scrollX: number;
|
|
98
|
-
scrollY: number;
|
|
99
|
-
devicePixelRatio: number;
|
|
100
|
-
viewportWidth: number;
|
|
101
|
-
viewportHeight: number;
|
|
102
|
-
visible: boolean;
|
|
103
|
-
enabled: boolean;
|
|
104
|
-
clickable: boolean;
|
|
105
|
-
focused?: boolean;
|
|
106
|
-
attributes?: Record<string, string>;
|
|
107
|
-
/** True when the matched element lives inside a ShadowRoot */
|
|
108
|
-
inShadowDom?: boolean;
|
|
109
|
-
/** True when the matched element lives inside a same-origin iframe */
|
|
110
|
-
inIframe?: boolean;
|
|
111
|
-
}
|
|
112
|
-
interface DomIdleOptions {
|
|
113
|
-
/** Max time to wait for idle in ms. Default: 5000. */
|
|
114
|
-
timeout?: number;
|
|
115
|
-
/** Quiet window after network/DOM/animations settle in ms. Default: 50. */
|
|
116
|
-
quietPeriodMs?: number;
|
|
117
|
-
}
|
|
118
|
-
interface DomWaitForSelectorOptions {
|
|
119
|
-
/** Max time to wait in ms. Default: 5000. */
|
|
120
|
-
timeoutMs?: number;
|
|
121
|
-
/** Require the matched element to be visible, enabled, unobstructed, and stable for pointer actions. */
|
|
122
|
-
forAction?: boolean;
|
|
123
|
-
/** Fail early once the DOM stays quiet and document.readyState === "complete". */
|
|
124
|
-
failFastWhenIdle?: boolean;
|
|
125
|
-
/** Quiet window in ms before failFastWhenIdle resolves empty. Default: 250. */
|
|
126
|
-
idleQuietMs?: number;
|
|
127
|
-
/** Consecutive requestAnimationFrame frames the bounding box must remain stable (≤ 1px) when `forAction: true`. Default: 2 (0 when instantAnimations active). */
|
|
128
|
-
stableFrames?: number;
|
|
129
|
-
/** Verify center point via deep `elementFromPoint` (piercing Shadow DOM & iframes) when `forAction: true`. Default: true. */
|
|
130
|
-
checkHitTest?: boolean;
|
|
131
|
-
/** Respect app-owned `window.__SPANA_APP_READY__` signal when defined. Default: true. */
|
|
132
|
-
waitForAppReady?: boolean;
|
|
133
|
-
}
|
|
134
|
-
interface DomWaitForHiddenOptions {
|
|
135
|
-
/** Max time to wait in ms. Default: 5000. */
|
|
136
|
-
timeoutMs?: number;
|
|
137
|
-
}
|
|
138
|
-
interface DomWaitForMatchOptions {
|
|
139
|
-
/** Max time to wait in ms. Default: 5000. */
|
|
140
|
-
timeoutMs?: number;
|
|
141
|
-
/** Assertion kind evaluated reactively inside the page via MutationObserver. */
|
|
142
|
-
kind: "text" | "containsText" | "matchesText" | "value" | "attribute" | "accessibilityLabel";
|
|
143
|
-
/** Expected value/substring (optional when `kind === "attribute"` or `"accessibilityLabel"` checks presence). */
|
|
144
|
-
expected?: string;
|
|
145
|
-
/** Attribute name when `kind === "attribute"`. */
|
|
146
|
-
attributeName?: string;
|
|
147
|
-
/** RegExp source when `kind === "matchesText"`. */
|
|
148
|
-
patternSource?: string;
|
|
149
|
-
/** RegExp flags when `kind === "matchesText"`. */
|
|
150
|
-
patternFlags?: string;
|
|
151
|
-
}
|
|
152
|
-
interface DomFillOptions {
|
|
153
|
-
/** Max time to wait for an editable actionable target in ms. Default: 5000. */
|
|
154
|
-
timeoutMs?: number;
|
|
155
|
-
/** Verify center point via deep `elementFromPoint` before filling. Default: true. */
|
|
156
|
-
checkHitTest?: boolean;
|
|
157
|
-
}
|
|
158
|
-
interface DomWaitForMatchResult {
|
|
159
|
-
matched: boolean;
|
|
160
|
-
actual?: string;
|
|
161
|
-
}
|
|
162
|
-
interface DomStorageEntries {
|
|
163
|
-
localStorage?: Record<string, string>;
|
|
164
|
-
sessionStorage?: Record<string, string>;
|
|
165
|
-
cookies?: Array<{
|
|
166
|
-
name: string;
|
|
167
|
-
value: string;
|
|
168
|
-
path?: string;
|
|
169
|
-
domain?: string;
|
|
170
|
-
}>;
|
|
171
|
-
capacitorPreferences?: Record<string, string>;
|
|
172
|
-
}
|
|
173
|
-
interface DomClearStorageOptions {
|
|
174
|
-
localStorage?: boolean;
|
|
175
|
-
sessionStorage?: boolean;
|
|
176
|
-
cookies?: boolean;
|
|
177
|
-
indexedDB?: boolean;
|
|
178
|
-
capacitorPreferences?: boolean;
|
|
179
|
-
}
|
|
180
|
-
interface DomTargetInfo {
|
|
181
|
-
id: string;
|
|
182
|
-
title?: string;
|
|
183
|
-
url?: string;
|
|
184
|
-
type?: string;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Unified DOM channel interface shared across:
|
|
188
|
-
* - `spana-bridge` (in-app WebSocket bridge, same JS on all 5 targets)
|
|
189
|
-
* - Android WebView CDP (`adb forward localabstract:webview_devtools_remote_<pid>`)
|
|
190
|
-
* - iOS WKWebView WebKit Remote Inspector (`isInspectable = true`)
|
|
191
|
-
* - Electron / Electrobun CDP or WebKit Inspector
|
|
192
|
-
*/
|
|
193
|
-
interface DomChannel {
|
|
194
|
-
readonly kind: DomChannelKind;
|
|
195
|
-
isConnected(): boolean;
|
|
196
|
-
connect(): Promise<void>;
|
|
197
|
-
disconnect(): Promise<void>;
|
|
198
|
-
evaluate<T = unknown>(script: string | ((...args: any[]) => T), ...args: any[]): Promise<T>;
|
|
199
|
-
query(selector: Selector): Promise<DomElementMatch[]>;
|
|
200
|
-
/** MutationObserver-reactive DOM wait: resolves immediately when a matching visible element mounts & is actionable. */
|
|
201
|
-
waitForSelector?(selector: Selector, opts?: DomWaitForSelectorOptions): Promise<DomElementMatch[]>;
|
|
202
|
-
/** MutationObserver-reactive wait until no matching visible element remains. */
|
|
203
|
-
waitForHidden?(selector: Selector, opts?: DomWaitForHiddenOptions): Promise<boolean>;
|
|
204
|
-
/** MutationObserver-reactive wait until text/value/attribute matches (zero runner-side polling). */
|
|
205
|
-
waitForMatch?(selector: Selector, opts: DomWaitForMatchOptions): Promise<DomWaitForMatchResult>;
|
|
206
|
-
/** Atomic 1-round-trip actionability wait + focus + React/Vue-safe value fill + input/change dispatch. */
|
|
207
|
-
fillDom?(selector: Selector, value: string, opts?: DomFillOptions): Promise<boolean>;
|
|
208
|
-
tapDom(selector: Selector): Promise<boolean>;
|
|
209
|
-
/** Scroll a DOM element into the viewport center and return its updated bounding rect. */
|
|
210
|
-
scrollIntoView?(selector: Selector): Promise<DomElementMatch | null>;
|
|
211
|
-
dispatch?(selector: Selector, eventType: string, eventInit?: Record<string, unknown>): Promise<boolean>;
|
|
212
|
-
waitForIdle?(opts?: DomIdleOptions): Promise<void>;
|
|
213
|
-
setStorage?(entries: DomStorageEntries): Promise<void>;
|
|
214
|
-
clearStorage?(opts?: DomClearStorageOptions): Promise<void>;
|
|
215
|
-
reload?(): Promise<void>;
|
|
216
|
-
mockNetwork?(matcher: BrowserRouteMatcher, response: BrowserMockResponse): Promise<void>;
|
|
217
|
-
blockNetwork?(matcher: BrowserRouteMatcher): Promise<void>;
|
|
218
|
-
clearNetworkMocks?(): Promise<void>;
|
|
219
|
-
getConsoleLogs?(): Promise<BrowserConsoleLog[]>;
|
|
220
|
-
getJSErrors?(): Promise<BrowserJSError[]>;
|
|
221
|
-
listTargets?(): Promise<DomTargetInfo[]>;
|
|
222
|
-
selectTarget?(targetId: string): Promise<void>;
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Self-contained MutationObserver-reactive DOM wait script with full single-round-trip
|
|
226
|
-
* Playwright-grade actionability checks when `forAction: true`:
|
|
227
|
-
* 1. App-ready signal (`window.__SPANA_APP_READY__`) when defined.
|
|
228
|
-
* 2. Visible + enabled match (piercing open Shadow DOM & same-origin iframes).
|
|
229
|
-
* 3. Auto-scroll offscreen targets into viewport (`scrollIntoView({ behavior: "instant" })`).
|
|
230
|
-
* 4. Deep `elementFromPoint` hit-test verifying no overlay/backdrop/modal obscures the target.
|
|
231
|
-
* 5. 2-rAF bounding-box stability check (≤ 1px movement; bypassed when `stableFrames === 0` or
|
|
232
|
-
* `instantAnimations` style is active).
|
|
233
|
-
* Retries seamlessly inside the page via `MutationObserver` + `rAF` in ONE single round trip!
|
|
234
|
-
*/
|
|
235
|
-
declare function buildDomWaitForSelectorScript(selector: Selector, opts?: DomWaitForSelectorOptions): string;
|
|
236
|
-
/**
|
|
237
|
-
* Self-contained MutationObserver-reactive script that resolves `true` as soon as
|
|
238
|
-
* no visible matching element exists in the DOM (zero runner-side polling).
|
|
239
|
-
*/
|
|
240
|
-
declare function buildDomWaitForHiddenScript(selector: Selector, opts?: DomWaitForHiddenOptions): string;
|
|
241
|
-
/**
|
|
242
|
-
* Self-contained MutationObserver-reactive assertion wait script for text,
|
|
243
|
-
* substring text, input value, and DOM attribute assertions — runs completely
|
|
244
|
-
* in-page with zero runner-side polling ticks.
|
|
245
|
-
*/
|
|
246
|
-
declare function buildDomWaitForMatchScript(selector: Selector, opts: DomWaitForMatchOptions): string;
|
|
247
|
-
/**
|
|
248
|
-
* Atomic 1-round-trip in-page fill script: waits for an editable target to be visible,
|
|
249
|
-
* enabled, in-viewport, and unobstructed, then focuses it, sets the value via the native
|
|
250
|
-
* HTMLInputElement/HTMLTextAreaElement prototype setter (React/Vue/Svelte compatible),
|
|
251
|
-
* and dispatches `input` + `change` events.
|
|
252
|
-
*/
|
|
253
|
-
declare function buildDomFillScript(selector: Selector, value: string, opts?: DomFillOptions): string;
|
|
254
|
-
|
|
255
|
-
type RawHierarchy = string;
|
|
256
|
-
/**
|
|
257
|
-
* Per-launch device state overrides (language/locale/timeZone) applied at app
|
|
258
|
-
* launch time. Maps to the `appium:language` / `appium:locale` /
|
|
259
|
-
* `appium:timeZone` capabilities on Appium providers; used to drive Expo /
|
|
260
|
-
* React Native localization for the duration of a flow.
|
|
261
|
-
*/
|
|
262
|
-
interface DeviceStateConfig {
|
|
263
|
-
language?: string;
|
|
264
|
-
locale?: string;
|
|
265
|
-
timeZone?: string;
|
|
266
|
-
}
|
|
267
|
-
interface LaunchOptions<R extends string = string> {
|
|
268
|
-
clearState?: boolean;
|
|
269
|
-
clearKeychain?: boolean;
|
|
270
|
-
/** Native deep link URL (e.g. `spana://playground`). `R` lets projects type it. */
|
|
271
|
-
deepLink?: R;
|
|
272
|
-
launchArguments?: Record<string, unknown>;
|
|
273
|
-
deviceState?: DeviceStateConfig;
|
|
274
|
-
}
|
|
275
|
-
type BrowserRouteMatcher = string | RegExp;
|
|
276
|
-
interface BrowserMockResponse {
|
|
277
|
-
status?: number;
|
|
278
|
-
body?: string;
|
|
279
|
-
json?: unknown;
|
|
280
|
-
headers?: Record<string, string>;
|
|
281
|
-
contentType?: string;
|
|
282
|
-
}
|
|
283
|
-
type NetworkProfile = "wifi" | "4g" | "3g" | "2g" | "edge" | "offline";
|
|
284
|
-
interface NetworkConditions {
|
|
285
|
-
profile?: NetworkProfile;
|
|
286
|
-
offline?: boolean;
|
|
287
|
-
latencyMs?: number;
|
|
288
|
-
downloadThroughputKbps?: number;
|
|
289
|
-
uploadThroughputKbps?: number;
|
|
290
|
-
}
|
|
291
|
-
/** @deprecated Use `NetworkConditions` instead. */
|
|
292
|
-
type BrowserNetworkConditions = NetworkConditions;
|
|
293
|
-
interface BrowserConsoleLogLocation {
|
|
294
|
-
url?: string;
|
|
295
|
-
lineNumber?: number;
|
|
296
|
-
columnNumber?: number;
|
|
297
|
-
}
|
|
298
|
-
interface BrowserConsoleLog {
|
|
299
|
-
type: string;
|
|
300
|
-
text: string;
|
|
301
|
-
location?: BrowserConsoleLogLocation;
|
|
302
|
-
}
|
|
303
|
-
interface BrowserJSError {
|
|
304
|
-
name?: string;
|
|
305
|
-
message: string;
|
|
306
|
-
stack?: string;
|
|
307
|
-
}
|
|
308
|
-
interface BrowserHARHeader {
|
|
309
|
-
name: string;
|
|
310
|
-
value: string;
|
|
311
|
-
}
|
|
312
|
-
interface BrowserHAREntry {
|
|
313
|
-
pageref: string;
|
|
314
|
-
startedDateTime: string;
|
|
315
|
-
time: number;
|
|
316
|
-
request: {
|
|
317
|
-
method: string;
|
|
318
|
-
url: string;
|
|
319
|
-
httpVersion: string;
|
|
320
|
-
headers: BrowserHARHeader[];
|
|
321
|
-
queryString: BrowserHARHeader[];
|
|
322
|
-
headersSize: number;
|
|
323
|
-
bodySize: number;
|
|
324
|
-
postData?: {
|
|
325
|
-
mimeType: string;
|
|
326
|
-
text?: string;
|
|
327
|
-
};
|
|
328
|
-
};
|
|
329
|
-
response: {
|
|
330
|
-
status: number;
|
|
331
|
-
statusText: string;
|
|
332
|
-
httpVersion: string;
|
|
333
|
-
headers: BrowserHARHeader[];
|
|
334
|
-
redirectURL: string;
|
|
335
|
-
headersSize: number;
|
|
336
|
-
bodySize: number;
|
|
337
|
-
content: {
|
|
338
|
-
size: number;
|
|
339
|
-
mimeType: string;
|
|
340
|
-
};
|
|
341
|
-
};
|
|
342
|
-
cache: Record<string, never>;
|
|
343
|
-
timings: {
|
|
344
|
-
blocked: number;
|
|
345
|
-
dns: number;
|
|
346
|
-
connect: number;
|
|
347
|
-
ssl: number;
|
|
348
|
-
send: number;
|
|
349
|
-
wait: number;
|
|
350
|
-
receive: number;
|
|
351
|
-
};
|
|
352
|
-
serverIPAddress?: string;
|
|
353
|
-
_resourceType?: string;
|
|
354
|
-
_failureText?: string;
|
|
355
|
-
}
|
|
356
|
-
interface BrowserHARPage {
|
|
357
|
-
id: string;
|
|
358
|
-
title: string;
|
|
359
|
-
startedDateTime: string;
|
|
360
|
-
pageTimings: {
|
|
361
|
-
onContentLoad: number;
|
|
362
|
-
onLoad: number;
|
|
363
|
-
};
|
|
364
|
-
}
|
|
365
|
-
interface BrowserHAR {
|
|
366
|
-
log: {
|
|
367
|
-
version: "1.2";
|
|
368
|
-
creator: {
|
|
369
|
-
name: "spana";
|
|
370
|
-
version: string;
|
|
371
|
-
};
|
|
372
|
-
browser: {
|
|
373
|
-
name: string;
|
|
374
|
-
};
|
|
375
|
-
pages: BrowserHARPage[];
|
|
376
|
-
entries: BrowserHAREntry[];
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
type TouchAction = {
|
|
380
|
-
type: "move";
|
|
381
|
-
x: number;
|
|
382
|
-
y: number;
|
|
383
|
-
duration?: number;
|
|
384
|
-
} | {
|
|
385
|
-
type: "down";
|
|
386
|
-
} | {
|
|
387
|
-
type: "up";
|
|
388
|
-
} | {
|
|
389
|
-
type: "pause";
|
|
390
|
-
duration: number;
|
|
391
|
-
};
|
|
392
|
-
interface TouchSequence {
|
|
393
|
-
id: number;
|
|
394
|
-
actions: TouchAction[];
|
|
395
|
-
}
|
|
396
|
-
interface VirtualAuthenticatorOptions {
|
|
397
|
-
/** WebAuthn protocol. Default: "ctap2". */
|
|
398
|
-
protocol?: "ctap2" | "u2f";
|
|
399
|
-
/** Authenticator transport. Default: "internal" (platform passkey). */
|
|
400
|
-
transport?: "usb" | "nfc" | "ble" | "cable" | "internal";
|
|
401
|
-
/** Support discoverable resident keys (passkeys). Default: true. */
|
|
402
|
-
hasResidentKey?: boolean;
|
|
403
|
-
/** Support user verification (Touch ID / Face ID / PIN). Default: true. */
|
|
404
|
-
hasUserVerification?: boolean;
|
|
405
|
-
/** Automatically pass user verification. Default: true. */
|
|
406
|
-
isUserVerified?: boolean;
|
|
407
|
-
/** Automatically simulate user presence on prompts. Default: true. */
|
|
408
|
-
automaticPresenceSimulation?: boolean;
|
|
409
|
-
}
|
|
410
|
-
interface VirtualCredential {
|
|
411
|
-
credentialId: string;
|
|
412
|
-
isResidentCredential: boolean;
|
|
413
|
-
rpId?: string;
|
|
414
|
-
userHandle?: string;
|
|
415
|
-
signCount: number;
|
|
416
|
-
}
|
|
417
|
-
interface RawDriverService<_T extends string = string, R extends string = string> {
|
|
418
|
-
readonly beginFlow?: (flowName: string) => Effect.Effect<void, DriverError>;
|
|
419
|
-
readonly getDriverLogs?: () => Effect.Effect<string[], DriverError>;
|
|
420
|
-
readonly dumpHierarchy: () => Effect.Effect<RawHierarchy, DriverError>;
|
|
421
|
-
readonly tapAtCoordinate: (x: number, y: number) => Effect.Effect<void, DriverError>;
|
|
422
|
-
readonly doubleTapAtCoordinate: (x: number, y: number) => Effect.Effect<void, DriverError>;
|
|
423
|
-
readonly longPressAtCoordinate: (x: number, y: number, duration: number) => Effect.Effect<void, DriverError>;
|
|
424
|
-
readonly swipe: (startX: number, startY: number, endX: number, endY: number, duration: number) => Effect.Effect<void, DriverError>;
|
|
425
|
-
readonly pinch?: (cx: number, cy: number, scale: number, duration: number) => Effect.Effect<void, DriverError>;
|
|
426
|
-
readonly zoom?: (cx: number, cy: number, scale: number, duration: number) => Effect.Effect<void, DriverError>;
|
|
427
|
-
readonly multiTouch?: (sequences: TouchSequence[]) => Effect.Effect<void, DriverError>;
|
|
428
|
-
readonly inputText: (text: string) => Effect.Effect<void, DriverError>;
|
|
429
|
-
readonly pressKey: (key: string) => Effect.Effect<void, DriverError>;
|
|
430
|
-
readonly hideKeyboard: () => Effect.Effect<void, DriverError>;
|
|
431
|
-
readonly takeScreenshot: () => Effect.Effect<Uint8Array, DriverError>;
|
|
432
|
-
readonly getDeviceInfo: () => Effect.Effect<DeviceInfo, DriverError>;
|
|
433
|
-
readonly launchApp: (bundleId: string, opts?: LaunchOptions<R>) => Effect.Effect<void, DriverError>;
|
|
434
|
-
readonly stopApp: (bundleId: string) => Effect.Effect<void, DriverError>;
|
|
435
|
-
readonly killApp: (bundleId: string) => Effect.Effect<void, DriverError>;
|
|
436
|
-
readonly clearAppState: (bundleId: string) => Effect.Effect<void, DriverError>;
|
|
437
|
-
readonly openLink: (url: string) => Effect.Effect<void, DriverError>;
|
|
438
|
-
readonly back: () => Effect.Effect<void, DriverError>;
|
|
439
|
-
readonly evaluate: <T = unknown>(script: string | ((...args: any[]) => T), ...args: unknown[]) => Effect.Effect<T, DriverError>;
|
|
440
|
-
readonly getContexts?: () => Effect.Effect<string[], DriverError>;
|
|
441
|
-
readonly getCurrentContext?: () => Effect.Effect<string, DriverError>;
|
|
442
|
-
readonly setContext?: (contextId: string) => Effect.Effect<void, DriverError>;
|
|
443
|
-
readonly domChannel?: DomChannel;
|
|
444
|
-
/** Fast reset via bridge storage clear + reload (avoids uninstall/reinstall) */
|
|
445
|
-
readonly resetFast?: () => Effect.Effect<void, DriverError>;
|
|
446
|
-
readonly mockNetwork?: (matcher: BrowserRouteMatcher, response: BrowserMockResponse) => Effect.Effect<void, DriverError>;
|
|
447
|
-
readonly blockNetwork?: (matcher: BrowserRouteMatcher) => Effect.Effect<void, DriverError>;
|
|
448
|
-
readonly clearNetworkMocks?: () => Effect.Effect<void, DriverError>;
|
|
449
|
-
readonly setNetworkConditions?: (conditions: NetworkConditions) => Effect.Effect<void, DriverError>;
|
|
450
|
-
readonly saveCookies?: (path: string) => Effect.Effect<void, DriverError>;
|
|
451
|
-
readonly loadCookies?: (path: string) => Effect.Effect<void, DriverError>;
|
|
452
|
-
readonly saveAuthState?: (path: string) => Effect.Effect<void, DriverError>;
|
|
453
|
-
readonly loadAuthState?: (path: string) => Effect.Effect<void, DriverError>;
|
|
454
|
-
readonly downloadFile?: (path: string) => Effect.Effect<void, DriverError>;
|
|
455
|
-
readonly uploadFile?: (selector: Selector, path: string) => Effect.Effect<void, DriverError>;
|
|
456
|
-
readonly newTab?: (url?: string) => Effect.Effect<string, DriverError>;
|
|
457
|
-
readonly switchToTab?: (index: number) => Effect.Effect<void, DriverError>;
|
|
458
|
-
readonly closeTab?: () => Effect.Effect<void, DriverError>;
|
|
459
|
-
readonly getTabIds?: () => Effect.Effect<string[], DriverError>;
|
|
460
|
-
readonly getConsoleLogs?: () => Effect.Effect<BrowserConsoleLog[], DriverError>;
|
|
461
|
-
readonly getJSErrors?: () => Effect.Effect<BrowserJSError[], DriverError>;
|
|
462
|
-
readonly getHAR?: () => Effect.Effect<BrowserHAR, DriverError>;
|
|
463
|
-
readonly getRawPage?: () => unknown;
|
|
464
|
-
readonly enableVirtualAuthenticator?: (opts?: VirtualAuthenticatorOptions) => Effect.Effect<string, DriverError>;
|
|
465
|
-
readonly removeVirtualAuthenticator?: (authenticatorId?: string) => Effect.Effect<void, DriverError>;
|
|
466
|
-
readonly getVirtualCredentials?: (authenticatorId?: string) => Effect.Effect<VirtualCredential[], DriverError>;
|
|
467
|
-
readonly clearVirtualCredentials?: (authenticatorId?: string) => Effect.Effect<void, DriverError>;
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
interface IOSSigningConfig {
|
|
471
|
-
/** Apple Development Team ID (from developer.apple.com or Xcode) */
|
|
472
|
-
teamId: string;
|
|
473
|
-
/** Code signing identity (default: "Apple Development") */
|
|
474
|
-
signingIdentity?: string;
|
|
475
|
-
}
|
|
476
|
-
interface BridgeConfig {
|
|
477
|
-
/** Enable the in-app spana-bridge WebSocket server. Default: auto-detected when port/url is set. */
|
|
478
|
-
enabled?: boolean;
|
|
479
|
-
/** Port for the runner's spana-bridge WebSocket server (default: 9333). */
|
|
480
|
-
port?: number;
|
|
481
|
-
/** Host to bind the bridge server on (default: "127.0.0.1"). */
|
|
482
|
-
host?: string;
|
|
483
|
-
/** Explicit external bridge URL if already running (e.g. ws://127.0.0.1:9333). */
|
|
484
|
-
url?: string;
|
|
485
|
-
/** Connection timeout in ms when waiting for the app bridge to connect (default: 5000). */
|
|
486
|
-
connectTimeout?: number;
|
|
487
|
-
}
|
|
488
|
-
interface WarmDaemonConfig {
|
|
489
|
-
/** Keep WDA / UiAutomator2 daemons alive across test runs and reuse them. Default: false. */
|
|
490
|
-
enabled?: boolean;
|
|
491
|
-
/** Reuse a single browser process across flows with fresh BrowserContexts. Default: true. */
|
|
492
|
-
reuseBrowserProcess?: boolean;
|
|
493
|
-
/** Reuse an active WDA/UiAutomator2 session across flows instead of recreating. Default: true when warm daemons enabled. */
|
|
494
|
-
reuseSession?: boolean;
|
|
495
|
-
/** Optional path to store warm daemon metadata. */
|
|
496
|
-
stateFile?: string;
|
|
497
|
-
}
|
|
498
|
-
interface AppConfig {
|
|
499
|
-
url?: string;
|
|
500
|
-
packageName?: string;
|
|
501
|
-
bundleId?: string;
|
|
502
|
-
/** Path to .app or .ipa for auto-install on device/simulator */
|
|
503
|
-
appPath?: string;
|
|
504
|
-
/** iOS code signing config for physical devices */
|
|
505
|
-
signing?: IOSSigningConfig;
|
|
506
|
-
/** Explicit WebKit Inspector URL or port for iOS WKWebView direct DOM access */
|
|
507
|
-
webkitInspectorUrl?: string;
|
|
508
|
-
webkitInspectorPort?: number;
|
|
509
|
-
/** Explicit CDP port for Android WebView or desktop targets */
|
|
510
|
-
cdpPort?: number;
|
|
511
|
-
/** Pin device locale (e.g. "en_US", "sv_SE") for predictable system UI labels */
|
|
512
|
-
locale?: string;
|
|
513
|
-
/** Optional spana-bridge override for this app target */
|
|
514
|
-
bridge?: BridgeConfig;
|
|
515
|
-
}
|
|
516
|
-
interface ElectronAppConfig {
|
|
517
|
-
/** Path to Electron main entry file or app directory (passed to Playwright _electron.launch) */
|
|
518
|
-
entry?: string;
|
|
519
|
-
/** Path to a packaged Electron executable */
|
|
520
|
-
executablePath?: string;
|
|
521
|
-
/** Extra CLI arguments passed to Electron */
|
|
522
|
-
args?: string[];
|
|
523
|
-
/** Working directory for Electron launch */
|
|
524
|
-
cwd?: string;
|
|
525
|
-
/** Additional environment variables for Electron */
|
|
526
|
-
env?: Record<string, string>;
|
|
527
|
-
/** Attach to an already-running Electron app over CDP instead of launching */
|
|
528
|
-
cdpUrl?: string;
|
|
529
|
-
/** Remote debugging port when launching or attaching over CDP */
|
|
530
|
-
cdpPort?: number;
|
|
531
|
-
/** Optional URL to navigate to after launch */
|
|
532
|
-
url?: string;
|
|
533
|
-
/** Optional spana-bridge config */
|
|
534
|
-
bridge?: BridgeConfig;
|
|
535
|
-
}
|
|
536
|
-
type ElectrobunRenderer = "native" | "cef";
|
|
537
|
-
interface ElectrobunAppConfig {
|
|
538
|
-
/** Path to Electrobun binary or packaged .app/.exe */
|
|
539
|
-
executablePath?: string;
|
|
540
|
-
/** Path to Electrobun project root (containing electrobun.config.ts) */
|
|
541
|
-
appDir?: string;
|
|
542
|
-
/** Extra CLI arguments passed to the Electrobun process */
|
|
543
|
-
args?: string[];
|
|
544
|
-
/** Working directory for launch */
|
|
545
|
-
cwd?: string;
|
|
546
|
-
/** Additional environment variables */
|
|
547
|
-
env?: Record<string, string>;
|
|
548
|
-
/** Renderer engine used by the Electrobun build: "native" (WKWebView/WebView2/WebKitGTK) or "cef" */
|
|
549
|
-
renderer?: ElectrobunRenderer;
|
|
550
|
-
/** Attach to an already-running Electrobun CEF/WebView2 app over CDP */
|
|
551
|
-
cdpUrl?: string;
|
|
552
|
-
/** Remote debugging port (ELECTROBUN_CDP_PORT / WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS) */
|
|
553
|
-
cdpPort?: number;
|
|
554
|
-
/** WebKit Inspector port for macOS WKWebView or Linux WebKitGTK */
|
|
555
|
-
webkitInspectorPort?: number;
|
|
556
|
-
/** Optional URL to navigate to after launch */
|
|
557
|
-
url?: string;
|
|
558
|
-
/** Optional spana-bridge config */
|
|
559
|
-
bridge?: BridgeConfig;
|
|
560
|
-
}
|
|
561
|
-
type BrowserName = "chromium" | "firefox" | "webkit";
|
|
562
|
-
type WebBrowserEngine = "auto" | "playwright" | "cdp" | "lightpanda";
|
|
563
|
-
type WebResourceBlockType = "image" | "font" | "media" | "stylesheet";
|
|
564
|
-
type VideoRecordingMode = "off" | "on" | "retain-on-failure";
|
|
565
|
-
type StorybookValue = string | number | boolean | null;
|
|
566
|
-
interface StorybookConfig {
|
|
567
|
-
/** Optional dedicated Storybook URL (falls back to apps.web.url when omitted) */
|
|
568
|
-
url?: string;
|
|
569
|
-
/** Preview iframe path used to render isolated stories (default: /iframe.html) */
|
|
570
|
-
iframePath?: string;
|
|
571
|
-
}
|
|
572
|
-
interface WebExecutionConfig {
|
|
573
|
-
browser?: BrowserName;
|
|
574
|
-
/** Browser engine backend: "playwright" (default), "cdp" (direct CDP WebSocket — zero Playwright pipe), or "lightpanda". */
|
|
575
|
-
engine?: WebBrowserEngine;
|
|
576
|
-
/** Connect to an existing CDP browser / Lightpanda endpoint (e.g. "http://127.0.0.1:9222"). */
|
|
577
|
-
cdpUrl?: string;
|
|
578
|
-
/** Connect to a remote Playwright server WebSocket (e.g. BrowserStack Automate Web `wss://cdp.browserstack.com/playwright?...`). */
|
|
579
|
-
wsEndpoint?: string;
|
|
580
|
-
/** Explicit browser executable path (e.g. system Chrome or custom Chromium binary). */
|
|
581
|
-
executablePath?: string;
|
|
582
|
-
/** Browser release channel (e.g. "chrome", "chrome-beta", "msedge"). */
|
|
583
|
-
channel?: string;
|
|
584
|
-
headless?: boolean;
|
|
585
|
-
/** Navigation readiness event for launchApp/openLink (default: "load"). */
|
|
586
|
-
waitUntil?: "domcontentloaded" | "load" | "networkidle" | "commit";
|
|
587
|
-
/** Collapse CSS transitions & animations to 0.001ms for faster deterministic runs. */
|
|
588
|
-
instantAnimations?: boolean;
|
|
589
|
-
/** Abort heavy asset requests ("image" | "font" | "media" | "stylesheet") during web runs. */
|
|
590
|
-
blockResources?: WebResourceBlockType[];
|
|
591
|
-
/** Reuse a persistent warm Chromium daemon across runs via CDP (chromium only). */
|
|
592
|
-
warmBrowser?: boolean;
|
|
593
|
-
/** Scope key for isolating warm Chromium daemons across concurrent repos/runs (defaults to cwd hash). */
|
|
594
|
-
warmBrowserScope?: string;
|
|
595
|
-
/** Create a fresh isolated BrowserContext per flow using pre-warmed context pooling + background teardown. */
|
|
596
|
-
freshContextPerFlow?: boolean;
|
|
597
|
-
/** Max worker contexts sharing one Chromium browser process under `--parallel` (default: 2 to avoid CDP/IO contention). */
|
|
598
|
-
maxContextsPerBrowser?: number;
|
|
599
|
-
/** Automatically attach a CDP WebAuthn virtual authenticator (passkey) to every fresh context. */
|
|
600
|
-
virtualAuthenticator?: boolean | VirtualAuthenticatorOptions;
|
|
601
|
-
/** Optional Playwright storage state JSON file to preload for web runs */
|
|
602
|
-
storageState?: string;
|
|
603
|
-
/** Print verbose Playwright runtime events to stdout for local web debugging */
|
|
604
|
-
verboseLogging?: boolean;
|
|
605
|
-
/** Optional Storybook config for isolated component/story flows in the browser runtime */
|
|
606
|
-
storybook?: StorybookConfig;
|
|
607
|
-
}
|
|
608
|
-
interface CloudAppReferenceConfig {
|
|
609
|
-
/** Existing remote app reference, e.g. bs://... or storage:... */
|
|
610
|
-
id?: string;
|
|
611
|
-
/** Local file path to upload when the provider supports managed upload */
|
|
612
|
-
path?: string;
|
|
613
|
-
/** Override the uploaded file name when the provider supports it */
|
|
614
|
-
name?: string;
|
|
615
|
-
}
|
|
616
|
-
interface BrowserStackAppConfig extends CloudAppReferenceConfig {
|
|
617
|
-
/** Stable BrowserStack app alias */
|
|
618
|
-
customId?: string;
|
|
619
|
-
}
|
|
620
|
-
interface BrowserStackLocalConfig {
|
|
621
|
-
enabled?: boolean;
|
|
622
|
-
binary?: string;
|
|
623
|
-
identifier?: string;
|
|
624
|
-
args?: string[];
|
|
625
|
-
}
|
|
626
|
-
interface BrowserStackHelperConfig {
|
|
627
|
-
app?: BrowserStackAppConfig;
|
|
628
|
-
local?: BrowserStackLocalConfig;
|
|
629
|
-
options?: Record<string, unknown>;
|
|
630
|
-
}
|
|
631
|
-
interface SauceConnectConfig {
|
|
632
|
-
enabled?: boolean;
|
|
633
|
-
binary?: string;
|
|
634
|
-
tunnelName?: string;
|
|
635
|
-
args?: string[];
|
|
636
|
-
}
|
|
637
|
-
interface SauceLabsHelperConfig {
|
|
638
|
-
app?: CloudAppReferenceConfig;
|
|
639
|
-
connect?: SauceConnectConfig;
|
|
640
|
-
options?: Record<string, unknown>;
|
|
641
|
-
}
|
|
642
|
-
interface AppiumExecutionConfig {
|
|
643
|
-
serverUrl?: string;
|
|
644
|
-
capabilities?: Record<string, unknown>;
|
|
645
|
-
/**
|
|
646
|
-
* Platform-specific capabilities merged on top of `capabilities` when the
|
|
647
|
-
* matching platform runs. Useful when you want different `appium:deviceName`
|
|
648
|
-
* or `appium:platformVersion` for Android vs iOS.
|
|
649
|
-
*/
|
|
650
|
-
platformCapabilities?: {
|
|
651
|
-
android?: Record<string, unknown>;
|
|
652
|
-
ios?: Record<string, unknown>;
|
|
653
|
-
};
|
|
654
|
-
capabilitiesFile?: string;
|
|
655
|
-
reportToProvider?: boolean;
|
|
656
|
-
browserstack?: BrowserStackHelperConfig;
|
|
657
|
-
saucelabs?: SauceLabsHelperConfig;
|
|
658
|
-
/** Path to a custom cloud provider module (default export must conform to CloudProvider interface). */
|
|
659
|
-
cloudProvider?: string;
|
|
660
|
-
/**
|
|
661
|
-
* Opt in to having spana spawn a local `appium` subprocess for the
|
|
662
|
-
* duration of the test run. Requires `appium` to be on PATH. When true,
|
|
663
|
-
* `serverUrl` (if set) is ignored and a URL is assigned to the
|
|
664
|
-
* auto-started server instead. Off by default — spana never spawns
|
|
665
|
-
* background processes unless you ask.
|
|
666
|
-
*/
|
|
667
|
-
autoStart?: boolean;
|
|
668
|
-
/** Override the `appium` binary name. Default: "appium". */
|
|
669
|
-
autoStartBinary?: string;
|
|
670
|
-
/** Extra CLI args to forward to the spawned Appium process. */
|
|
671
|
-
autoStartArgs?: readonly string[];
|
|
672
|
-
}
|
|
673
|
-
interface ExecutionConfig {
|
|
674
|
-
mode?: "local" | "appium";
|
|
675
|
-
web?: WebExecutionConfig;
|
|
676
|
-
appium?: AppiumExecutionConfig;
|
|
677
|
-
/** In-app spana-bridge configuration shared across webview targets */
|
|
678
|
-
bridge?: BridgeConfig;
|
|
679
|
-
/** Warm daemon & process reuse settings for fast repeated runs */
|
|
680
|
-
warmDaemons?: WarmDaemonConfig;
|
|
681
|
-
}
|
|
682
|
-
interface ArtifactConfig {
|
|
683
|
-
outputDir?: string;
|
|
684
|
-
captureOnFailure?: boolean;
|
|
685
|
-
captureOnSuccess?: boolean;
|
|
686
|
-
captureSteps?: boolean;
|
|
687
|
-
screenshot?: boolean;
|
|
688
|
-
uiHierarchy?: boolean;
|
|
689
|
-
consoleLogs?: boolean;
|
|
690
|
-
jsErrors?: boolean;
|
|
691
|
-
har?: boolean;
|
|
692
|
-
/** Video / screencast recording mode: "off" (default), "on", or "retain-on-failure". */
|
|
693
|
-
video?: VideoRecordingMode;
|
|
694
|
-
/** Embed interactive step-by-step visual playback timeline inside report.html (auto-enabled when video !== "off"). */
|
|
695
|
-
playback?: boolean;
|
|
696
|
-
}
|
|
697
|
-
interface HookContext {
|
|
698
|
-
app: unknown;
|
|
699
|
-
expect?: unknown;
|
|
700
|
-
platform?: Platform;
|
|
701
|
-
result?: unknown;
|
|
702
|
-
summary?: unknown;
|
|
703
|
-
}
|
|
704
|
-
interface ProvConfig {
|
|
705
|
-
apps?: {
|
|
706
|
-
web?: AppConfig;
|
|
707
|
-
android?: AppConfig;
|
|
708
|
-
ios?: AppConfig;
|
|
709
|
-
electron?: ElectronAppConfig;
|
|
710
|
-
electrobun?: ElectrobunAppConfig;
|
|
711
|
-
};
|
|
712
|
-
defaults?: {
|
|
713
|
-
waitTimeout?: number;
|
|
714
|
-
pollInterval?: number;
|
|
715
|
-
settleTimeout?: number;
|
|
716
|
-
retries?: number;
|
|
717
|
-
/** Pause after each action (tap, scroll) to let the UI settle. Default: 0 (disabled). */
|
|
718
|
-
waitForIdleTimeout?: number;
|
|
719
|
-
/** Delay between each character when typing. Default: 0 (instant). */
|
|
720
|
-
typingDelay?: number;
|
|
721
|
-
/** Starting poll interval for adaptive backoff. Default: 50ms. Set equal to pollInterval to disable adaptive backoff. */
|
|
722
|
-
initialPollInterval?: number;
|
|
723
|
-
/** Max age in ms before cached hierarchy is stale. Default: 100. Set to 0 to disable. */
|
|
724
|
-
hierarchyCacheTtl?: number;
|
|
725
|
-
/** Max depth for UI hierarchy snapshots on iOS. Default: 100. */
|
|
726
|
-
snapshotMaxDepth?: number;
|
|
727
|
-
/** Delay in ms between retry attempts of a failed flow. Default: 0 (immediate). */
|
|
728
|
-
retryDelay?: number;
|
|
729
|
-
/** Max workers per platform when using --parallel. */
|
|
730
|
-
workers?: number;
|
|
731
|
-
/** Max in-process workers before automatically sharding across multiple OS processes (default: 8). */
|
|
732
|
-
maxWorkersPerProcess?: number;
|
|
733
|
-
/** Default tap mode when a DOM channel resolves an element: "native" (real touch, default) or "dom" (fast synthetic click). */
|
|
734
|
-
tapMode?: TapMode;
|
|
735
|
-
/** Pin device locale across targets so system UI sheet labels stay deterministic. */
|
|
736
|
-
locale?: string;
|
|
737
|
-
/** Fail web element waits early when the page is idle & readyState === "complete" instead of waiting full waitTimeout. */
|
|
738
|
-
failFastWhenIdle?: boolean;
|
|
739
|
-
};
|
|
740
|
-
platforms?: Platform[];
|
|
741
|
-
/** Run platforms concurrently when they use independent resources. Default: false (serial). */
|
|
742
|
-
parallelPlatforms?: boolean;
|
|
743
|
-
flowDir?: string;
|
|
744
|
-
launchOptions?: LaunchOptions;
|
|
745
|
-
/**
|
|
746
|
-
* Reporter names or module paths. Built-in: "console", "json", "junit", "html", "allure".
|
|
747
|
-
* Custom reporters: provide a relative path (e.g., "./reporters/slack.ts") that default-exports
|
|
748
|
-
* a Reporter object or a `(options: { outputDir: string }) => Reporter` factory function.
|
|
749
|
-
*/
|
|
750
|
-
reporters?: string[];
|
|
751
|
-
hooks?: {
|
|
752
|
-
beforeAll?: (ctx: HookContext) => Promise<void>;
|
|
753
|
-
beforeEach?: (ctx: HookContext) => Promise<void>;
|
|
754
|
-
afterEach?: (ctx: HookContext) => Promise<void>;
|
|
755
|
-
afterAll?: (ctx: HookContext) => Promise<void>;
|
|
756
|
-
};
|
|
757
|
-
artifacts?: ArtifactConfig;
|
|
758
|
-
execution?: ExecutionConfig;
|
|
759
|
-
visualRegression?: {
|
|
760
|
-
threshold?: number;
|
|
761
|
-
maxDiffPixelRatio?: number;
|
|
762
|
-
baselinesDir?: string;
|
|
763
|
-
mode?: "pixel" | "layout-tolerant";
|
|
764
|
-
};
|
|
765
|
-
/** Pluggable CI filters evaluated when `--changed-since <ref>` is passed. */
|
|
766
|
-
filters?: Array<{
|
|
767
|
-
name: string;
|
|
768
|
-
filter: (flows: any[], context: any) => Promise<any> | any;
|
|
769
|
-
}>;
|
|
770
|
-
/** Verified replay cache settings for optional agentic steps (`.spana/cache/`). */
|
|
771
|
-
replayCache?: {
|
|
772
|
-
mode?: "read-write" | "strict" | "off";
|
|
773
|
-
dir?: string;
|
|
774
|
-
};
|
|
775
|
-
}
|
|
776
|
-
declare function defineConfig(config: ProvConfig): ProvConfig;
|
|
777
|
-
|
|
778
|
-
interface WaitOptions {
|
|
779
|
-
timeout?: number;
|
|
780
|
-
pollInterval?: number;
|
|
781
|
-
settleTimeout?: number;
|
|
782
|
-
/** Starting poll interval for adaptive polling. Default: 50ms. Set equal to pollInterval to disable adaptive backoff. */
|
|
783
|
-
initialPollInterval?: number;
|
|
784
|
-
/** Tap dispatch mode when resolved via DOM channel: "native" (default, real touch) or "dom" (fast synthetic click). */
|
|
785
|
-
tapMode?: TapMode;
|
|
786
|
-
/** Platform hint for coordinate scaling (android physical px vs ios logical pt). */
|
|
787
|
-
platform?: Platform;
|
|
788
|
-
/** Fail early on web when DOM stays idle and document is complete instead of waiting full timeout. */
|
|
789
|
-
failFastWhenIdle?: boolean;
|
|
790
|
-
/** Quiet window in ms before failFastWhenIdle resolves empty. Default: 250. */
|
|
791
|
-
idleQuietMs?: number;
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
type Direction = "up" | "down" | "left" | "right";
|
|
795
|
-
interface ScrollUntilVisibleOptions<_T extends string = string> extends WaitOptions {
|
|
796
|
-
/** Where the target is relative to the current viewport. Default: "down". */
|
|
797
|
-
direction?: Direction;
|
|
798
|
-
/** Max number of scroll gestures to attempt before failing. Default: 5. */
|
|
799
|
-
maxScrolls?: number;
|
|
800
|
-
}
|
|
801
|
-
type KeyboardDismissStrategy = "auto" | "driver" | "back";
|
|
802
|
-
interface DismissKeyboardOptions {
|
|
803
|
-
/** Default: "auto" (driver hideKeyboard, then Android back fallback). */
|
|
804
|
-
strategy?: KeyboardDismissStrategy;
|
|
805
|
-
}
|
|
806
|
-
interface BackUntilVisibleOptions<_T extends string = string> extends WaitOptions {
|
|
807
|
-
/** Max number of back actions to attempt before failing. Default: 3. */
|
|
808
|
-
maxBacks?: number;
|
|
809
|
-
}
|
|
810
|
-
|
|
811
|
-
interface StorybookOpenOptions {
|
|
812
|
-
/** Override the Storybook base URL for this call. */
|
|
813
|
-
baseUrl?: string;
|
|
814
|
-
/** Storybook view mode. Defaults to "story". */
|
|
815
|
-
viewMode?: "story" | "docs";
|
|
816
|
-
/** Story args encoded into the Storybook iframe query string. */
|
|
817
|
-
args?: Record<string, StorybookValue>;
|
|
818
|
-
/** Story globals encoded into the Storybook iframe query string. */
|
|
819
|
-
globals?: Record<string, StorybookValue>;
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
interface PromiseApp<T extends string = string, R extends string = string> {
|
|
823
|
-
tap(selector: ExtendedSelector<T>, opts?: WaitOptions): Promise<void>;
|
|
824
|
-
tapXY(x: number, y: number): Promise<void>;
|
|
825
|
-
doubleTap(selector: ExtendedSelector<T>, opts?: WaitOptions): Promise<void>;
|
|
826
|
-
longPress(selector: ExtendedSelector<T>, opts?: {
|
|
827
|
-
duration?: number;
|
|
828
|
-
} & WaitOptions): Promise<void>;
|
|
829
|
-
longPressXY(x: number, y: number, opts?: {
|
|
830
|
-
duration?: number;
|
|
831
|
-
}): Promise<void>;
|
|
832
|
-
inputText(text: string): Promise<void>;
|
|
833
|
-
/** Atomic 1-round-trip form fill: waits for actionability, focuses, replaces value, and dispatches input/change. */
|
|
834
|
-
fill(selector: ExtendedSelector<T>, value: string, opts?: WaitOptions): Promise<void>;
|
|
835
|
-
pressKey(key: string): Promise<void>;
|
|
836
|
-
hideKeyboard(): Promise<void>;
|
|
837
|
-
dismissKeyboard(opts?: DismissKeyboardOptions): Promise<void>;
|
|
838
|
-
swipe(direction: Direction, opts?: {
|
|
839
|
-
duration?: number;
|
|
840
|
-
}): Promise<void>;
|
|
841
|
-
scroll(direction: Direction): Promise<void>;
|
|
842
|
-
scrollUntilVisible(selector: ExtendedSelector<T>, opts?: ScrollUntilVisibleOptions<T>): Promise<void>;
|
|
843
|
-
backUntilVisible(selector: ExtendedSelector<T>, opts?: BackUntilVisibleOptions<T>): Promise<void>;
|
|
844
|
-
launch(opts?: LaunchOptions<R>): Promise<void>;
|
|
845
|
-
stop(): Promise<void>;
|
|
846
|
-
kill(): Promise<void>;
|
|
847
|
-
clearState(): Promise<void>;
|
|
848
|
-
openLink(url: R): Promise<void>;
|
|
849
|
-
openStory(storyId: string, opts?: StorybookOpenOptions): Promise<void>;
|
|
850
|
-
back(): Promise<void>;
|
|
851
|
-
takeScreenshot(name?: string): Promise<Uint8Array>;
|
|
852
|
-
evaluate<Result = unknown>(fn: ((...args: any[]) => Result) | string, ...args: any[]): Promise<Result>;
|
|
853
|
-
mockNetwork(matcher: BrowserRouteMatcher, response: BrowserMockResponse): Promise<void>;
|
|
854
|
-
blockNetwork(matcher: BrowserRouteMatcher): Promise<void>;
|
|
855
|
-
clearNetworkMocks(): Promise<void>;
|
|
856
|
-
setNetworkConditions(conditions: BrowserNetworkConditions): Promise<void>;
|
|
857
|
-
saveCookies(path: string): Promise<void>;
|
|
858
|
-
loadCookies(path: string): Promise<void>;
|
|
859
|
-
saveAuthState(path: string): Promise<void>;
|
|
860
|
-
loadAuthState(path: string): Promise<void>;
|
|
861
|
-
downloadFile(path: string): Promise<void>;
|
|
862
|
-
uploadFile(selector: Selector<T>, path: string): Promise<void>;
|
|
863
|
-
newTab(url?: R): Promise<string>;
|
|
864
|
-
switchToTab(index: number): Promise<void>;
|
|
865
|
-
closeTab(): Promise<void>;
|
|
866
|
-
getTabIds(): Promise<string[]>;
|
|
867
|
-
getConsoleLogs(): Promise<BrowserConsoleLog[]>;
|
|
868
|
-
getJSErrors(): Promise<BrowserJSError[]>;
|
|
869
|
-
getHAR(): Promise<BrowserHAR>;
|
|
870
|
-
/** Escape hatch: access the underlying Playwright `Page` (or CDP session) on web runs. */
|
|
871
|
-
getPage<PageType = unknown>(): PageType;
|
|
872
|
-
/** Enable a CDP WebAuthn virtual authenticator (passkey / platform authenticator) for this context. */
|
|
873
|
-
enableVirtualAuthenticator(opts?: VirtualAuthenticatorOptions): Promise<string>;
|
|
874
|
-
/** Remove an active virtual WebAuthn authenticator (defaults to the latest enabled one). */
|
|
875
|
-
removeVirtualAuthenticator(authenticatorId?: string): Promise<void>;
|
|
876
|
-
/** List credentials stored inside the active virtual WebAuthn authenticator. */
|
|
877
|
-
getVirtualCredentials(authenticatorId?: string): Promise<VirtualCredential[]>;
|
|
878
|
-
/** Clear all credentials stored inside the active virtual WebAuthn authenticator. */
|
|
879
|
-
clearVirtualCredentials(authenticatorId?: string): Promise<void>;
|
|
880
|
-
pinch(selector: ExtendedSelector<T>, opts?: {
|
|
881
|
-
scale?: number;
|
|
882
|
-
duration?: number;
|
|
883
|
-
} & WaitOptions): Promise<void>;
|
|
884
|
-
zoom(selector: ExtendedSelector<T>, opts?: {
|
|
885
|
-
scale?: number;
|
|
886
|
-
duration?: number;
|
|
887
|
-
} & WaitOptions): Promise<void>;
|
|
888
|
-
multiTouch(sequences: TouchSequence[]): Promise<void>;
|
|
889
|
-
getText(selector: ExtendedSelector<T>, opts?: WaitOptions): Promise<string>;
|
|
890
|
-
getAttribute(selector: ExtendedSelector<T>, name: string, opts?: WaitOptions): Promise<string | undefined>;
|
|
891
|
-
isVisible(selector: ExtendedSelector<T>, opts?: {
|
|
892
|
-
timeout?: number;
|
|
893
|
-
}): Promise<boolean>;
|
|
894
|
-
isEnabled(selector: ExtendedSelector<T>, opts?: WaitOptions): Promise<boolean>;
|
|
895
|
-
/** Wait for in-flight fetch/XHR, animations, and framework renders to settle via spana-bridge. */
|
|
896
|
-
waitForIdle(opts?: DomIdleOptions): Promise<void>;
|
|
897
|
-
/** Inject storage/auth state directly through the DOM bridge (avoids slow UI login flows). */
|
|
898
|
-
setStorage(entries: DomStorageEntries): Promise<void>;
|
|
899
|
-
/** Clear localStorage, sessionStorage, cookies, IndexedDB, and Capacitor Preferences. */
|
|
900
|
-
clearStorage(opts?: DomClearStorageOptions): Promise<void>;
|
|
901
|
-
/** Fast reset: clear storage via bridge and reload in milliseconds (avoids uninstall/reinstall). */
|
|
902
|
-
resetFast(): Promise<void>;
|
|
903
|
-
/** @internal Low-level escape hatch: list available contexts (e.g. ["NATIVE_APP", "WEBVIEW_..."]). */
|
|
904
|
-
getContexts(): Promise<string[]>;
|
|
905
|
-
/** @internal Low-level escape hatch: get the current context ID. */
|
|
906
|
-
getCurrentContext(): Promise<string>;
|
|
907
|
-
/** @internal Low-level escape hatch: switch to a specific context by ID. */
|
|
908
|
-
switchToContext(contextId: string): Promise<void>;
|
|
909
|
-
/** @internal Low-level escape hatch: switch to the first available WebView context. */
|
|
910
|
-
switchToWebView(): Promise<void>;
|
|
911
|
-
/** @internal Low-level escape hatch: switch back to the native app context. */
|
|
912
|
-
switchToNativeApp(): Promise<void>;
|
|
913
|
-
}
|
|
914
|
-
|
|
915
|
-
export { type WebResourceBlockType as $, type AppiumExecutionConfig as A, type BrowserRouteMatcher as B, type DeviceStateConfig as C, DriverError as D, type ExtendedSelector as E, type DismissKeyboardOptions as F, type DomChannelKind as G, type DomRect as H, type ElectronAppConfig as I, type RelativeSelector as J, type ScrollUntilVisibleOptions as K, type LaunchOptions as L, type StorybookConfig as M, type StorybookOpenOptions as N, type StorybookValue as O, type Platform as P, type TouchAction as Q, type RawDriverService as R, type Selector as S, type TapMode as T, type TouchSequence as U, type VirtualAuthenticatorOptions as V, type VideoRecordingMode as W, type VirtualCredential as X, type WarmDaemonConfig as Y, type WebBrowserEngine as Z, type WebExecutionConfig as _, type DomElementMatch as a, buildDomFillScript as a0, buildDomWaitForHiddenScript as a1, buildDomWaitForMatchScript as a2, buildDomWaitForSelectorScript as a3, defineConfig as a4, isSystemUISelector as a5, isTestIDSelector as a6, systemUI as a7, type WaitOptions as a8, type ProvConfig as b, type DomChannel as c, type DomTargetInfo as d, type DomWaitForSelectorOptions as e, type DomWaitForHiddenOptions as f, type DomWaitForMatchOptions as g, type DomWaitForMatchResult as h, type DomFillOptions as i, type DomIdleOptions as j, type DomStorageEntries as k, type DomClearStorageOptions as l, type BrowserMockResponse as m, type BrowserConsoleLog as n, type BrowserJSError as o, type BrowserName as p, type ElectrobunAppConfig as q, type ElectrobunRenderer as r, type AppConfig as s, type PromiseApp as t, type ArtifactConfig as u, type BackUntilVisibleOptions as v, type BridgeConfig as w, type BrowserHAR as x, type BrowserNetworkConditions as y, DeviceInfo as z };
|