obsidian-integration-testing 12.0.0 → 12.1.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/lib/cjs/adb-device-list.cjs +54 -0
- package/dist/lib/cjs/adb-device-list.d.cts +72 -0
- package/dist/lib/cjs/android-sdk.cjs +52 -0
- package/dist/lib/cjs/android-sdk.d.cts +29 -0
- package/dist/lib/cjs/app-startup-progress.cjs +87 -0
- package/dist/lib/cjs/app-startup-progress.d.cts +128 -0
- package/dist/lib/cjs/appium-server-marker.cjs +29 -32
- package/dist/lib/cjs/appium-server-marker.d.cts +22 -0
- package/dist/lib/cjs/avd-probe-verdict.cjs +90 -0
- package/dist/lib/cjs/avd-probe-verdict.d.cts +175 -0
- package/dist/lib/cjs/community-plugin-registry.cjs +1 -1
- package/dist/lib/cjs/community-plugin-registry.d.cts +1 -1
- package/dist/lib/cjs/config-directory-fallback-error.cjs +57 -0
- package/dist/lib/cjs/config-directory-fallback-error.d.cts +64 -0
- package/dist/lib/cjs/config-directory.cjs +46 -0
- package/dist/lib/cjs/config-directory.d.cts +45 -0
- package/dist/lib/cjs/connect-to-cdp.cjs +13 -7
- package/dist/lib/cjs/connect-to-cdp.d.cts +19 -0
- package/dist/lib/cjs/demo-vault-bootstrap.cjs +1 -1
- package/dist/lib/cjs/demo-vault-bootstrap.d.cts +3 -2
- package/dist/lib/cjs/demo-vault-populate.cjs +3 -2
- package/dist/lib/cjs/device-readiness.cjs +38 -3
- package/dist/lib/cjs/device-readiness.d.cts +83 -9
- package/dist/lib/cjs/emulator-arguments.cjs +6 -2
- package/dist/lib/cjs/emulator-arguments.d.cts +26 -0
- package/dist/lib/cjs/emulator-backend.cjs +71 -0
- package/dist/lib/cjs/emulator-backend.d.cts +76 -0
- package/dist/lib/cjs/emulator-liveness.cjs +72 -0
- package/dist/lib/cjs/emulator-liveness.d.cts +158 -0
- package/dist/lib/cjs/emulator-snapshot.cjs +57 -0
- package/dist/lib/cjs/emulator-snapshot.d.cts +68 -0
- package/dist/lib/cjs/global-setup-core.cjs +30 -30
- package/dist/lib/cjs/global-setup-core.d.cts +27 -2
- package/dist/lib/cjs/headless-vault-config.cjs +51 -0
- package/dist/lib/cjs/headless-vault-config.d.cts +67 -0
- package/dist/lib/cjs/index.cjs +12 -1
- package/dist/lib/cjs/index.d.cts +6 -1
- package/dist/lib/cjs/library.cjs +1 -1
- package/dist/lib/cjs/mobile-input.cjs +14 -2
- package/dist/lib/cjs/mobile-input.d.cts +5 -9
- package/dist/lib/cjs/namespace-bootstrap.cjs +1 -1
- package/dist/lib/cjs/obsidian-instance.cjs +52 -3
- package/dist/lib/cjs/obsidian-instance.d.cts +12 -0
- package/dist/lib/cjs/open-obsidian-settings-tab.cjs +1 -1
- package/dist/lib/cjs/open-obsidian-settings-tab.d.cts +3 -2
- package/dist/lib/cjs/owned-instance-exit-marker.cjs +99 -0
- package/dist/lib/cjs/owned-instance-exit-marker.d.cts +106 -0
- package/dist/lib/cjs/owned-instance-exited-error.cjs +106 -0
- package/dist/lib/cjs/owned-instance-exited-error.d.cts +98 -0
- package/dist/lib/cjs/owned-vault-seed.cjs +9 -5
- package/dist/lib/cjs/owned-vault-seed.d.cts +24 -3
- package/dist/lib/cjs/parent-liveness.cjs +42 -5
- package/dist/lib/cjs/parent-liveness.d.cts +37 -5
- package/dist/lib/cjs/port-owner.cjs +61 -0
- package/dist/lib/cjs/port-owner.d.cts +47 -0
- package/dist/lib/cjs/process-capture.cjs +62 -0
- package/dist/lib/cjs/process-capture.d.cts +83 -0
- package/dist/lib/cjs/process-exit-message.cjs +14 -8
- package/dist/lib/cjs/process-exit-message.d.cts +37 -3
- package/dist/lib/cjs/process-liveness.cjs +51 -0
- package/dist/lib/cjs/process-liveness.d.cts +18 -0
- package/dist/lib/cjs/run-version-matrix.cjs +1 -1
- package/dist/lib/cjs/run-version-matrix.d.cts +1 -1
- package/dist/lib/cjs/teardown-verdict.cjs +53 -0
- package/dist/lib/cjs/teardown-verdict.d.cts +69 -0
- package/dist/lib/cjs/temporary-vault.cjs +43 -8
- package/dist/lib/cjs/temporary-vault.d.cts +47 -5
- package/dist/lib/cjs/transport-appium.cjs +102 -17
- package/dist/lib/cjs/transport-appium.d.cts +53 -3
- package/dist/lib/cjs/transport-desktop-cdp.cjs +195 -6
- package/dist/lib/cjs/transport-desktop-cdp.d.cts +99 -0
- package/dist/lib/cjs/transport-factory.cjs +951 -133
- package/dist/lib/cjs/transport-options.cjs +11 -3
- package/dist/lib/cjs/transport-options.d.cts +131 -12
- package/dist/lib/cjs/transport.cjs +1 -1
- package/dist/lib/cjs/transport.d.cts +7 -1
- package/dist/lib/cjs/vault-plugin-install.cjs +40 -0
- package/dist/lib/cjs/vault-plugin-install.d.cts +64 -0
- package/dist/lib/cjs/vault-teardown-verdict.cjs +42 -0
- package/dist/lib/cjs/vault-teardown-verdict.d.cts +57 -0
- package/dist/lib/cjs/version-matrix.cjs +1 -1
- package/dist/lib/cjs/version-matrix.d.cts +2 -2
- package/dist/lib/cjs/webview-cdp.cjs +6 -7
- package/dist/lib/cjs/webview-cdp.d.cts +5 -1
- package/dist/lib/esm/adb-device-list.d.mts +72 -0
- package/dist/lib/esm/adb-device-list.mjs +28 -0
- package/dist/lib/esm/android-sdk.d.mts +29 -0
- package/dist/lib/esm/android-sdk.mjs +18 -0
- package/dist/lib/esm/app-startup-progress.d.mts +128 -0
- package/dist/lib/esm/app-startup-progress.mjs +59 -0
- package/dist/lib/esm/appium-server-marker.d.mts +22 -0
- package/dist/lib/esm/appium-server-marker.mjs +28 -22
- package/dist/lib/esm/avd-probe-verdict.d.mts +175 -0
- package/dist/lib/esm/avd-probe-verdict.mjs +62 -0
- package/dist/lib/esm/community-plugin-registry.d.mts +1 -1
- package/dist/lib/esm/community-plugin-registry.mjs +1 -1
- package/dist/lib/esm/config-directory-fallback-error.d.mts +64 -0
- package/dist/lib/esm/config-directory-fallback-error.mjs +33 -0
- package/dist/lib/esm/config-directory.d.mts +45 -0
- package/dist/lib/esm/config-directory.mjs +21 -0
- package/dist/lib/esm/connect-to-cdp.d.mts +19 -0
- package/dist/lib/esm/connect-to-cdp.mjs +13 -7
- package/dist/lib/esm/demo-vault-bootstrap.d.mts +3 -2
- package/dist/lib/esm/demo-vault-bootstrap.mjs +1 -1
- package/dist/lib/esm/demo-vault-populate.mjs +3 -2
- package/dist/lib/esm/device-readiness.d.mts +83 -9
- package/dist/lib/esm/device-readiness.mjs +34 -2
- package/dist/lib/esm/emulator-arguments.d.mts +26 -0
- package/dist/lib/esm/emulator-arguments.mjs +6 -2
- package/dist/lib/esm/emulator-backend.d.mts +76 -0
- package/dist/lib/esm/emulator-backend.mjs +45 -0
- package/dist/lib/esm/emulator-liveness.d.mts +158 -0
- package/dist/lib/esm/emulator-liveness.mjs +47 -0
- package/dist/lib/esm/emulator-snapshot.d.mts +68 -0
- package/dist/lib/esm/emulator-snapshot.mjs +32 -0
- package/dist/lib/esm/global-setup-core.d.mts +27 -2
- package/dist/lib/esm/global-setup-core.mjs +34 -35
- package/dist/lib/esm/headless-vault-config.d.mts +67 -0
- package/dist/lib/esm/headless-vault-config.mjs +31 -0
- package/dist/lib/esm/index.d.mts +6 -1
- package/dist/lib/esm/index.mjs +11 -1
- package/dist/lib/esm/library.mjs +1 -1
- package/dist/lib/esm/mobile-input.d.mts +5 -9
- package/dist/lib/esm/mobile-input.mjs +14 -2
- package/dist/lib/esm/namespace-bootstrap.mjs +1 -1
- package/dist/lib/esm/obsidian-instance.d.mts +12 -0
- package/dist/lib/esm/obsidian-instance.mjs +55 -3
- package/dist/lib/esm/open-obsidian-settings-tab.d.mts +3 -2
- package/dist/lib/esm/open-obsidian-settings-tab.mjs +1 -1
- package/dist/lib/esm/owned-instance-exit-marker.d.mts +106 -0
- package/dist/lib/esm/owned-instance-exit-marker.mjs +78 -0
- package/dist/lib/esm/owned-instance-exited-error.d.mts +98 -0
- package/dist/lib/esm/owned-instance-exited-error.mjs +81 -0
- package/dist/lib/esm/owned-vault-seed.d.mts +24 -3
- package/dist/lib/esm/owned-vault-seed.mjs +9 -5
- package/dist/lib/esm/parent-liveness.d.mts +37 -5
- package/dist/lib/esm/parent-liveness.mjs +42 -5
- package/dist/lib/esm/port-owner.d.mts +47 -0
- package/dist/lib/esm/port-owner.mjs +36 -0
- package/dist/lib/esm/process-capture.d.mts +83 -0
- package/dist/lib/esm/process-capture.mjs +38 -0
- package/dist/lib/esm/process-exit-message.d.mts +37 -3
- package/dist/lib/esm/process-exit-message.mjs +13 -8
- package/dist/lib/esm/process-liveness.d.mts +18 -0
- package/dist/lib/esm/process-liveness.mjs +17 -0
- package/dist/lib/esm/run-version-matrix.d.mts +1 -1
- package/dist/lib/esm/run-version-matrix.mjs +1 -1
- package/dist/lib/esm/teardown-verdict.d.mts +69 -0
- package/dist/lib/esm/teardown-verdict.mjs +28 -0
- package/dist/lib/esm/temporary-vault.d.mts +47 -5
- package/dist/lib/esm/temporary-vault.mjs +43 -8
- package/dist/lib/esm/transport-appium.d.mts +53 -3
- package/dist/lib/esm/transport-appium.mjs +108 -17
- package/dist/lib/esm/transport-desktop-cdp.d.mts +99 -0
- package/dist/lib/esm/transport-desktop-cdp.mjs +202 -7
- package/dist/lib/esm/transport-factory.mjs +995 -138
- package/dist/lib/esm/transport-options.d.mts +131 -12
- package/dist/lib/esm/transport-options.mjs +9 -2
- package/dist/lib/esm/transport.d.mts +7 -1
- package/dist/lib/esm/vault-plugin-install.d.mts +64 -0
- package/dist/lib/esm/vault-plugin-install.mjs +20 -0
- package/dist/lib/esm/vault-teardown-verdict.d.mts +57 -0
- package/dist/lib/esm/vault-teardown-verdict.mjs +18 -0
- package/dist/lib/esm/version-matrix.d.mts +2 -2
- package/dist/lib/esm/version-matrix.mjs +1 -1
- package/dist/lib/esm/webview-cdp.d.mts +5 -1
- package/dist/lib/esm/webview-cdp.mjs +6 -7
- package/package.json +24 -23
- package/dist/lib/cjs/native-dialog-monitor.cjs +0 -192
- package/dist/lib/cjs/native-dialog-monitor.d.cts +0 -66
- package/dist/lib/cjs/obsidian-namespace.cjs +0 -17
- package/dist/lib/cjs/obsidian-namespace.d.cts +0 -128
- package/dist/lib/esm/native-dialog-monitor.d.mts +0 -66
- package/dist/lib/esm/native-dialog-monitor.mjs +0 -158
- package/dist/lib/esm/obsidian-namespace.d.mts +0 -128
- package/dist/lib/esm/obsidian-namespace.mjs +0 -1
|
@@ -40,6 +40,19 @@ export interface DesktopCdpTransportConfig {
|
|
|
40
40
|
* Defaults to `30000`.
|
|
41
41
|
*/
|
|
42
42
|
commandTimeoutInMilliseconds?: number;
|
|
43
|
+
/**
|
|
44
|
+
* The vault's config folder override (Obsidian's *Override config folder*),
|
|
45
|
+
* e.g. `'.obsidian-desktop'`. When set, the owned instance boots to the
|
|
46
|
+
* starter screen, writes `<vaultId>-config` into that renderer's
|
|
47
|
+
* `localStorage`, and only then opens the vault over the `vault-open` IPC —
|
|
48
|
+
* the override is read once, during the vault renderer's own setup, so it has
|
|
49
|
+
* to exist before that window is created. The opened vault's actual
|
|
50
|
+
* `app.vault.configDir` is then read back, and a mismatch throws
|
|
51
|
+
* {@link ConfigDirectoryFallbackError}. Only meaningful in owned mode.
|
|
52
|
+
*
|
|
53
|
+
* @default `undefined` (Obsidian's own default, `.obsidian`)
|
|
54
|
+
*/
|
|
55
|
+
configDirectory?: string;
|
|
43
56
|
/**
|
|
44
57
|
* Grace window in milliseconds for fast-failing a dead boot of the owned
|
|
45
58
|
* instance (empty `<body>` with no `window.app` after the renderer reached
|
|
@@ -170,6 +183,7 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
170
183
|
private cdpPort;
|
|
171
184
|
private cdpUrl;
|
|
172
185
|
private readonly commandTimeoutInMilliseconds;
|
|
186
|
+
private readonly configDirectory;
|
|
173
187
|
private readonly deadBootGraceInMilliseconds;
|
|
174
188
|
private electronCompatibility;
|
|
175
189
|
private readonly isHarnessOwnedInstance;
|
|
@@ -177,6 +191,14 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
177
191
|
private messageId;
|
|
178
192
|
private readonly ownedConfig;
|
|
179
193
|
private ownedInstance;
|
|
194
|
+
/**
|
|
195
|
+
* Vault paths THIS transport opened via {@link registerVault}, normalized by
|
|
196
|
+
* {@link normalizeVaultPathForComparison}. A worker attached to a
|
|
197
|
+
* harness-owned instance may tear down only these — every other vault in that
|
|
198
|
+
* instance belongs to the global setup that launched it (see
|
|
199
|
+
* {@link shouldTearDownVaultWindow}).
|
|
200
|
+
*/
|
|
201
|
+
private readonly selfRegisteredVaultPaths;
|
|
180
202
|
private readonly shouldDisableSandbox;
|
|
181
203
|
private readonly shouldThrowOnSilentAsarFallback;
|
|
182
204
|
private readonly shouldWarnOnCompatibilityIssues;
|
|
@@ -288,6 +310,10 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
288
310
|
/**
|
|
289
311
|
* Unregisters a vault by destroying its window and removing it from the registry.
|
|
290
312
|
*
|
|
313
|
+
* Refuses when this transport does not own what it would be tearing down —
|
|
314
|
+
* see {@link shouldTearDownVaultWindow} for which of the two ownership flags
|
|
315
|
+
* means what, and why they are not interchangeable.
|
|
316
|
+
*
|
|
291
317
|
* @param vaultPath - The absolute path to the vault folder.
|
|
292
318
|
*/
|
|
293
319
|
unregisterVault(vaultPath: string): Promise<void>;
|
|
@@ -313,6 +339,39 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
313
339
|
* @param parentLivenessPort - The loopback port the renderer should connect back to.
|
|
314
340
|
*/
|
|
315
341
|
private armParentLivenessWatchdog;
|
|
342
|
+
/**
|
|
343
|
+
* Verifies the ready vault is actually using the requested config folder,
|
|
344
|
+
* throwing {@link ConfigDirectoryFallbackError} when it is not.
|
|
345
|
+
*
|
|
346
|
+
* Obsidian applies the override with `setConfigDir`, which substitutes
|
|
347
|
+
* `.obsidian` for any value its own `validateConfigDir` rejects — without a
|
|
348
|
+
* word, and without failing the boot. The resulting vault opens, reaches
|
|
349
|
+
* layout-ready, and reports success; what it lacks is the settings and enabled
|
|
350
|
+
* plugins of the folder that was asked for. Reading the live
|
|
351
|
+
* `app.vault.configDir` back is the only way to tell the two apart, and it
|
|
352
|
+
* covers every cause at once: a name Obsidian rejected (including its
|
|
353
|
+
* unrecoverable character blacklist, which `assertValidConfigDirectory` deliberately
|
|
354
|
+
* does not guess at), and a write that never reached the vault's renderer.
|
|
355
|
+
*
|
|
356
|
+
* A no-op when no override was requested.
|
|
357
|
+
*
|
|
358
|
+
* @param vaultPath - The absolute path to the vault folder.
|
|
359
|
+
*/
|
|
360
|
+
private assertRequestedConfigDirectory;
|
|
361
|
+
/**
|
|
362
|
+
* Builds the error for a harness-owned instance that is no longer serving CDP,
|
|
363
|
+
* from the best evidence this process has.
|
|
364
|
+
*
|
|
365
|
+
* Two processes see two different halves of the death. The one that launched
|
|
366
|
+
* the instance holds the child and can read the exit code straight off it; a
|
|
367
|
+
* test worker holds nothing but the port, and reads the same facts from the
|
|
368
|
+
* exit marker the owner wrote (`owned-instance-exit-marker.ts`). With neither
|
|
369
|
+
* — the marker lost, or a kill so abrupt nothing recorded it — the error still
|
|
370
|
+
* names the instance as the cause, which is the whole point of it.
|
|
371
|
+
*
|
|
372
|
+
* @returns The error to throw in place of a refused connection.
|
|
373
|
+
*/
|
|
374
|
+
private buildOwnedInstanceExitedError;
|
|
316
375
|
/**
|
|
317
376
|
* Verifies the running app (asar) version matches the swapped-in pin, storing the
|
|
318
377
|
* verdict on {@link getAsarFallback}. On a **silent fallback** (the installer ran
|
|
@@ -440,6 +499,32 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
440
499
|
* proceeds (worst case the window is briefly visible).
|
|
441
500
|
*/
|
|
442
501
|
private moveOwnedWindowOffscreen;
|
|
502
|
+
/**
|
|
503
|
+
* Writes the config-folder override into the starter screen's `localStorage`
|
|
504
|
+
* and then opens the vault from there over the `vault-open` IPC.
|
|
505
|
+
*
|
|
506
|
+
* Obsidian reads the override exactly once, in the vault's own renderer, during
|
|
507
|
+
* `Vault.setup` — `getOverrideConfigDir(appId)` is `localStorage.getItem(appId +
|
|
508
|
+
* '-config')`. So there is no writing it into the vault's window: by the time
|
|
509
|
+
* that window exists the read has happened. The starter screen is the earlier
|
|
510
|
+
* renderer the write needs, and it qualifies because it has `localStorage` and
|
|
511
|
+
* `window.electron.ipcRenderer` but no `app` (verified on 1.13.7).
|
|
512
|
+
*
|
|
513
|
+
* That missing `app` is also why this talks raw CDP rather than going through
|
|
514
|
+
* {@link ensureNamespaceBootstrapped} / the `ipcSendSync` helper as
|
|
515
|
+
* {@link DesktopCdpTransport.openVaultInRunningInstance} does: every one of
|
|
516
|
+
* those paths probes `app.vault.adapter` to identify its target, and would fail
|
|
517
|
+
* on the very renderer this needs.
|
|
518
|
+
*
|
|
519
|
+
* The key name is known ahead of the write because the harness registered the
|
|
520
|
+
* vault under an id it generated itself, and `vault-open` reuses that entry
|
|
521
|
+
* rather than minting a new one.
|
|
522
|
+
*
|
|
523
|
+
* @param vaultPath - The absolute path to the vault folder.
|
|
524
|
+
* @param vaultId - The harness-generated vault id the vault is registered under.
|
|
525
|
+
* @param configDirectory - The config folder to override to.
|
|
526
|
+
*/
|
|
527
|
+
private openVaultFromStarterScreen;
|
|
443
528
|
/**
|
|
444
529
|
* Opens a vault in an already-running Obsidian instance via the `vault-open`
|
|
445
530
|
* Electron IPC (evaluated through CDP on an existing target), then polls until
|
|
@@ -529,4 +614,18 @@ export declare class DesktopCdpTransport implements ObsidianTransport {
|
|
|
529
614
|
* @param vaultPath - The absolute path to the vault folder.
|
|
530
615
|
*/
|
|
531
616
|
private waitForOwnedVaultReady;
|
|
617
|
+
/**
|
|
618
|
+
* Polls until the starter screen's renderer can accept the config-folder
|
|
619
|
+
* override — that is, until it exposes both `localStorage` and
|
|
620
|
+
* `window.electron.ipcRenderer.sendSync`.
|
|
621
|
+
*
|
|
622
|
+
* A page target exists as soon as the launch resolves, so this is not waiting
|
|
623
|
+
* for a window; it is waiting for that window's own scripts to finish. Writing
|
|
624
|
+
* before then would either throw or, worse, land in a renderer that is about to
|
|
625
|
+
* be replaced.
|
|
626
|
+
*
|
|
627
|
+
* @returns The starter screen's CDP target.
|
|
628
|
+
* @throws {Error} When no renderer becomes writable within the timeout.
|
|
629
|
+
*/
|
|
630
|
+
private waitForStarterScreenTarget;
|
|
532
631
|
}
|