@9l/playwright 0.6.0-beta.1 → 0.6.0-beta.3

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/android.d.ts CHANGED
@@ -1,36 +1,94 @@
1
1
  import { type TargetDriver } from './targets';
2
+ export { TargetSetupError, type TargetSetupRecord } from './targets';
2
3
  export { androidVersions, androidRuntimeType, validAndroidRuntime, type AndroidRuntime } from './android-runtime';
3
- /** Explicit aliases for apps without resource IDs. All matches remain strict
4
- * and scoped to the configured package; arbitrary XPath is not accepted. */
5
- export type AndroidControl = ({
6
- accessibilityId: string;
7
- text?: never;
8
- accessibilityIdSuffix?: never;
9
- } | {
10
- text: string;
11
- accessibilityId?: never;
12
- accessibilityIdSuffix?: never;
13
- } | {
14
- accessibilityIdSuffix: string;
15
- text?: never;
16
- accessibilityId?: never;
17
- }) & {
4
+ export { androidDefaults, androidSdkCandidates, androidSdkVariables, androidToolPaths, androidToolingPaths, androidToolsInstall, androidBuildTools, type AndroidDefaults, type AndroidSource } from './android-env';
5
+ /** Explicit aliases for apps without resource IDs. Each names exactly one
6
+ * matcher: exact text, an exact accessibility description, a literal
7
+ * description suffix or substring (a merged multi-line label is one
8
+ * description, so either reaches part of it), or an exact input hint. All
9
+ * matches remain strict and scoped to the configured package; arbitrary
10
+ * XPath is not accepted. */
11
+ type AndroidMatcher = 'text' | 'accessibilityId' | 'accessibilityIdSuffix' | 'accessibilityIdContains' | 'hint';
12
+ export type AndroidControl = {
13
+ [K in AndroidMatcher]: {
14
+ [M in K]: string;
15
+ } & {
16
+ [M in Exclude<AndroidMatcher, K>]?: never;
17
+ };
18
+ }[AndroidMatcher] & {
18
19
  className?: string;
19
20
  selected?: boolean;
20
21
  };
21
22
  export type AndroidTargetOptions = {
22
23
  appId: string;
23
- sdkRoot: string;
24
- toolsRoot: string;
25
- apkSHA256: string;
24
+ /** The Android SDK root. Defaults to androidDefaults(): ANDROID_HOME,
25
+ * ANDROID_SDK_ROOT, then common install locations. */
26
+ sdkRoot?: string;
27
+ /** The directory whose node_modules holds the pinned Appium and
28
+ * UiAutomator2 packages. Defaults to NINELIVES_ANDROID_TOOLS, else
29
+ * ~/.9l/android-tools. Nothing is downloaded. */
30
+ toolsRoot?: string;
31
+ /** The expected SHA-256 of the installed base APK. May be omitted only
32
+ * when `expected.apk` names the artifact to compare the installation with. */
33
+ apkSHA256?: string;
26
34
  appPackage: string;
27
35
  activity: string;
28
36
  controls?: Record<string, AndroidControl>;
37
+ /** What the installed build must be. A digest that differs from the
38
+ * declared one, or from `expected.apk`, a different versionCode or
39
+ * versionName, or another signing certificate stops the test as
40
+ * `setup mismatch` before any application operation. The signer is read
41
+ * by pulling the installed base APK through the local apksigner when
42
+ * declared; versions come from the device's package manager. */
43
+ expected?: {
44
+ apk?: string;
45
+ versionCode?: string;
46
+ versionName?: string;
47
+ signerSHA256?: string;
48
+ };
49
+ /** Attached device only: the app state expected before each test. The
50
+ * driver reads the app's window count, focus and keyboard visibility after
51
+ * launching the activity; a difference is classified `dirty` (state left by
52
+ * a previous test) instead of running the test against it. */
53
+ baseline?: {
54
+ windows?: number;
55
+ };
56
+ /** Attached device only: on a dirty baseline, press Back up to this many
57
+ * times until the baseline returns. Recorded in the receipt; never clears
58
+ * data, force-stops or changes settings. */
59
+ recovery?: {
60
+ back: number;
61
+ };
62
+ /** Opt-in failure diagnostics: the app's window count and focus are read
63
+ * before each gesture and again when an operation fails, and a metadata
64
+ * record (timing, requested point, viewport, windows) is attached to the
65
+ * failed test. With it, a hidden-assertion failure whose window the window
66
+ * manager no longer lists is classified as observer staleness. No
67
+ * screenshot, hierarchy, text or log is captured. */
68
+ diagnostics?: {
69
+ gestures: boolean;
70
+ };
71
+ /** What the spec needs from the device: a fold posture and/or a minimum
72
+ * active-display width in dp. Another posture or a narrower display is
73
+ * reported as a setup mismatch before any application operation. */
74
+ requires?: {
75
+ posture?: 'opened' | 'half-opened' | 'closed' | 'flat';
76
+ minWidthDp?: number;
77
+ };
29
78
  } & ({
30
79
  avd: string;
31
80
  apk: string;
32
81
  headless?: boolean;
33
82
  deviceSerial?: never;
83
+ /** Owned emulator only: boot the named snapshot of a dedicated AVD that
84
+ * scripts/prepare-biometric-avd.cjs prepared (a lock screen and an
85
+ * enrolled fingerprint, saved unlocked), still read-only, and offer
86
+ * app.fingerprint(). The driver never sees, sets or enters a PIN; a
87
+ * snapshot that boots locked or without an enrolled fingerprint is a
88
+ * setup mismatch (biometrics-unavailable). */
89
+ biometrics?: {
90
+ snapshot: string;
91
+ };
34
92
  } | {
35
93
  /** Experimental attachment: installed, single-base APK only. Never resets,
36
94
  * reinstalls or terminates the app. Installs the pinned automation helpers. */
@@ -38,8 +96,30 @@ export type AndroidTargetOptions = {
38
96
  avd?: never;
39
97
  apk?: never;
40
98
  headless?: never;
99
+ biometrics?: never;
41
100
  });
101
+ /** The host-local lease that gives one owner exclusive use of a device.
102
+ * The driver and installInPlace both take it, so an installation cannot
103
+ * replace the app under a running test or interleave with another installer. */
104
+ export declare function androidLeasePath(serial: string): string;
42
105
  /** Optional local Android adapter. Appium/UiAutomator2 owns native automation;
43
106
  * Go still owns scheduling/deadlines/receipts and this worker owns all handles.
44
107
  * No emulator, server, action or assertion is retried. */
45
108
  export declare function androidTargetDriver(options: AndroidTargetOptions): TargetDriver;
109
+ /** Install or update an app on an explicitly selected device without
110
+ * uninstalling or clearing its data. The APK's signing certificate must
111
+ * match the installed app's, read through the local apksigner; a different
112
+ * signer refuses before any device change. Returns the installed identity
113
+ * for the project's reviewed build metadata. Never runs inside a test. */
114
+ export declare function installInPlace(options: {
115
+ sdkRoot?: string;
116
+ deviceSerial: string;
117
+ apk: string;
118
+ timeoutMs?: number;
119
+ }): Promise<{
120
+ versionCode: string;
121
+ versionName: string;
122
+ appPackage: string;
123
+ apkSHA256: string;
124
+ signer: string;
125
+ }>;