mobilewright 0.0.1 → 0.0.10

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/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from 'commander';
3
+ import { existsSync } from 'node:fs';
4
+ import { resolve } from 'node:path';
5
+ import { MobilecliDriver, DEFAULT_URL } from '@mobilewright/driver-mobilecli';
6
+ import { ensureMobilecliReachable } from './server.js';
7
+ const program = new Command();
8
+ program.name('mobilewright');
9
+ program.version('0.0.1');
10
+ // ── test ───────────────────────────────────────────────────────────────
11
+ program
12
+ .command('test [test-filter...]')
13
+ .description('run tests')
14
+ .option('-c, --config <file>', 'configuration file')
15
+ .option('--reporter <reporter>', 'reporter to use (e.g. list, html, json)')
16
+ .option('--grep <grep>', 'only run tests matching this regex')
17
+ .option('--grep-invert <grep>', 'only run tests NOT matching this regex')
18
+ .option('--project <name...>', 'only run tests from specified projects')
19
+ .option('--retries <retries>', 'maximum retry count for flaky tests')
20
+ .option('--timeout <timeout>', 'test timeout in milliseconds')
21
+ .option('--workers <workers>', 'number of concurrent workers')
22
+ .option('--pass-with-no-tests', 'exit with code 0 when no tests found')
23
+ .option('--list', 'list all tests without running them')
24
+ .action(async (args, opts) => {
25
+ const { loadConfigFromFile } = await import('playwright/lib/common/configLoader');
26
+ const { runAllTestsWithConfig } = await import('playwright/lib/runner/testRunner');
27
+ const overrides = {};
28
+ if (opts.timeout)
29
+ overrides.timeout = Number(opts.timeout);
30
+ if (opts.retries)
31
+ overrides.retries = Number(opts.retries);
32
+ if (opts.workers)
33
+ overrides.workers = opts.workers;
34
+ if (opts.reporter) {
35
+ const names = opts.reporter.split(',');
36
+ overrides.reporter = names.map((name) => [name.trim()]);
37
+ }
38
+ // Default to mobilewright.config.{ts,js} if no --config is given.
39
+ let configFile = opts.config;
40
+ if (!configFile) {
41
+ for (const ext of ['.ts', '.js', '.mts', '.mjs', '.cts', '.cjs']) {
42
+ const candidate = resolve(process.cwd(), 'mobilewright.config' + ext);
43
+ if (existsSync(candidate)) {
44
+ configFile = candidate;
45
+ break;
46
+ }
47
+ }
48
+ }
49
+ const config = await loadConfigFromFile(configFile, overrides);
50
+ const c = config;
51
+ c.cliArgs = args;
52
+ if (opts.grep)
53
+ c.cliGrep = opts.grep;
54
+ if (opts.grepInvert)
55
+ c.cliGrepInvert = opts.grepInvert;
56
+ if (opts.project)
57
+ c.cliProjectFilter = opts.project;
58
+ if (opts.list)
59
+ c.cliListOnly = true;
60
+ if (opts.passWithNoTests)
61
+ c.cliPassWithNoTests = true;
62
+ const status = await runAllTestsWithConfig(config);
63
+ const exitCode = status === 'interrupted' ? 130 : status === 'passed' ? 0 : 1;
64
+ process.exit(exitCode);
65
+ });
66
+ // ── show-report ────────────────────────────────────────────────────────
67
+ // Delegate to Playwright's built-in show-report, which handles
68
+ // content types, trace files, screenshots, and attachments correctly.
69
+ program
70
+ .command('show-report [report]')
71
+ .description('show HTML report')
72
+ .option('--host <host>', 'host to serve report on', 'localhost')
73
+ .option('--port <port>', 'port to serve report on', '9323')
74
+ .action(async (report, opts) => {
75
+ const { program: pwProgram } = await import('playwright/lib/program');
76
+ const args = ['node', 'playwright', 'show-report'];
77
+ if (report)
78
+ args.push(report);
79
+ args.push('--host', opts.host, '--port', opts.port);
80
+ await pwProgram.parseAsync(args);
81
+ });
82
+ // ── devices ────────────────────────────────────────────────────────────
83
+ program
84
+ .command('devices')
85
+ .description('list all connected devices, simulators, and emulators')
86
+ .option('--url <url>', 'mobilecli server URL', DEFAULT_URL)
87
+ .action(async (opts) => {
88
+ const { serverProcess } = await ensureMobilecliReachable(opts.url, { autoStart: true });
89
+ try {
90
+ const driver = new MobilecliDriver({ url: opts.url });
91
+ const devices = await driver.listDevices();
92
+ if (devices.length === 0) {
93
+ console.log('No devices found.');
94
+ return;
95
+ }
96
+ console.log(padRight('ID', 40) +
97
+ padRight('Name', 25) +
98
+ padRight('Platform', 10) +
99
+ padRight('Type', 12) +
100
+ padRight('State', 10));
101
+ console.log('-'.repeat(97));
102
+ for (const d of devices) {
103
+ console.log(padRight(d.id, 40) +
104
+ padRight(d.name, 25) +
105
+ padRight(d.platform, 10) +
106
+ padRight(d.type, 12) +
107
+ padRight(d.state, 10));
108
+ }
109
+ }
110
+ finally {
111
+ if (serverProcess)
112
+ await serverProcess.kill();
113
+ }
114
+ });
115
+ function padRight(str, len) {
116
+ return str.length >= len ? str + ' ' : str + ' '.repeat(len - str.length);
117
+ }
118
+ program.parse(process.argv);
119
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAEvD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAC9B,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;AAC7B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAEzB,0EAA0E;AAC1E,OAAO;KACJ,OAAO,CAAC,uBAAuB,CAAC;KAChC,WAAW,CAAC,WAAW,CAAC;KACxB,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;KACnD,MAAM,CAAC,uBAAuB,EAAE,yCAAyC,CAAC;KAC1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AAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ export interface MobilewrightConfig {
2
+ /** Default platform. */
3
+ platform?: 'ios' | 'android';
4
+ /** Default device ID. */
5
+ deviceId?: string;
6
+ /** Regex to match device name (e.g. /iPhone 17/). */
7
+ deviceName?: RegExp;
8
+ /** Default app bundle ID. */
9
+ bundleId?: string;
10
+ /** mobilecli server URL (use for remote servers). */
11
+ url?: string;
12
+ /** Path to mobilecli binary (if not on PATH). */
13
+ mobilecliPath?: string;
14
+ /** Global timeout for locators (ms). */
15
+ timeout?: number;
16
+ /** Auto-start mobilecli server if not running. Default: true. */
17
+ autoStart?: boolean;
18
+ }
19
+ /** Type-safe config helper for mobilewright.config.ts files. */
20
+ export declare function defineConfig(config: MobilewrightConfig): MobilewrightConfig;
21
+ /**
22
+ * Load mobilewright config from the project root.
23
+ * Returns empty config if no config file found.
24
+ */
25
+ export declare function loadConfig(cwd?: string): Promise<MobilewrightConfig>;
26
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,wBAAwB;IACxB,QAAQ,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC;IAC7B,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qDAAqD;IACrD,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wCAAwC;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iEAAiE;IACjE,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,kBAAkB,CAE3E;AAQD;;;GAGG;AACH,wBAAsB,UAAU,CAC9B,GAAG,GAAE,MAAsB,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAY7B"}
package/dist/config.js ADDED
@@ -0,0 +1,30 @@
1
+ import { access } from 'node:fs/promises';
2
+ import { join } from 'node:path';
3
+ /** Type-safe config helper for mobilewright.config.ts files. */
4
+ export function defineConfig(config) {
5
+ return config;
6
+ }
7
+ const CONFIG_FILES = [
8
+ 'mobilewright.config.ts',
9
+ 'mobilewright.config.js',
10
+ 'mobilewright.config.mjs',
11
+ ];
12
+ /**
13
+ * Load mobilewright config from the project root.
14
+ * Returns empty config if no config file found.
15
+ */
16
+ export async function loadConfig(cwd = process.cwd()) {
17
+ for (const name of CONFIG_FILES) {
18
+ const fullPath = join(cwd, name);
19
+ try {
20
+ await access(fullPath);
21
+ const mod = await import(fullPath);
22
+ return (mod.default ?? mod);
23
+ }
24
+ catch {
25
+ continue;
26
+ }
27
+ }
28
+ return {};
29
+ }
30
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAqBjC,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,MAA0B;IACrD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,YAAY,GAAG;IACnB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;CAC1B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAc,OAAO,CAAC,GAAG,EAAE;IAE3B,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;YACvB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAuB,CAAC;QACpD,CAAC;QAAC,MAAM,CAAC;YACP,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare class MobilewrightError extends Error {
2
+ constructor(message: string);
3
+ }
4
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B"}
package/dist/errors.js ADDED
@@ -0,0 +1,7 @@
1
+ export class MobilewrightError extends Error {
2
+ constructor(message) {
3
+ super(message);
4
+ this.name = 'MobilewrightError';
5
+ }
6
+ }
7
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
@@ -0,0 +1,6 @@
1
+ export { ios, android, type LaunchOptions } from './launchers.js';
2
+ export { expect } from '@mobilewright/core';
3
+ export { Device, Screen, Locator } from '@mobilewright/core';
4
+ export { defineConfig, loadConfig, type MobilewrightConfig } from './config.js';
5
+ export { MobilewrightError } from './errors.js';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGlE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAG7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGhF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,11 @@
1
+ // Platform launchers — the primary entry point
2
+ export { ios, android } from './launchers.js';
3
+ // Assertions
4
+ export { expect } from '@mobilewright/core';
5
+ // Core classes (for advanced use)
6
+ export { Device, Screen, Locator } from '@mobilewright/core';
7
+ // Configuration
8
+ export { defineConfig, loadConfig } from './config.js';
9
+ // Errors
10
+ export { MobilewrightError } from './errors.js';
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,OAAO,EAAE,GAAG,EAAE,OAAO,EAAsB,MAAM,gBAAgB,CAAC;AAElE,aAAa;AACb,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAE5C,kCAAkC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7D,gBAAgB;AAChB,OAAO,EAAE,YAAY,EAAE,UAAU,EAA2B,MAAM,aAAa,CAAC;AAEhF,SAAS;AACT,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { DeviceInfo } from '@mobilewright/protocol';
2
+ import { Device } from '@mobilewright/core';
3
+ export interface LaunchOptions {
4
+ bundleId?: string;
5
+ deviceName?: RegExp;
6
+ deviceId?: string;
7
+ url?: string;
8
+ timeout?: number;
9
+ autoStart?: boolean;
10
+ }
11
+ interface PlatformLauncher {
12
+ launch(opts?: LaunchOptions): Promise<Device>;
13
+ devices(opts?: {
14
+ url?: string;
15
+ }): Promise<DeviceInfo[]>;
16
+ }
17
+ /** iOS platform launcher */
18
+ export declare const ios: PlatformLauncher;
19
+ /** Android platform launcher */
20
+ export declare const android: PlatformLauncher;
21
+ export {};
22
+ //# sourceMappingURL=launchers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launchers.d.ts","sourceRoot":"","sources":["../src/launchers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAY,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAK5C,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,gBAAgB;IACxB,MAAM,CAAC,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC9C,OAAO,CAAC,IAAI,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;CACzD;AA6ED,4BAA4B;AAC5B,eAAO,MAAM,GAAG,kBAAwB,CAAC;AAEzC,gCAAgC;AAChC,eAAO,MAAM,OAAO,kBAA4B,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { Device } from '@mobilewright/core';
2
+ import { MobilecliDriver, DEFAULT_URL } from '@mobilewright/driver-mobilecli';
3
+ import { ensureMobilecliReachable } from './server.js';
4
+ import { MobilewrightError } from './errors.js';
5
+ function createLauncher(platform) {
6
+ return {
7
+ async launch(opts = {}) {
8
+ const url = opts.url ?? DEFAULT_URL;
9
+ const { serverProcess } = await ensureMobilecliReachable(url, {
10
+ autoStart: opts.autoStart ?? true,
11
+ });
12
+ const driver = new MobilecliDriver({ url });
13
+ const deviceId = opts.deviceId ?? await resolveDeviceId(driver, platform, opts.deviceName);
14
+ const device = new Device(driver);
15
+ await device.connect({ url, deviceId, platform, timeout: opts.timeout });
16
+ if (serverProcess) {
17
+ device.onClose(() => serverProcess.kill());
18
+ }
19
+ if (opts.bundleId) {
20
+ await device.launchApp(opts.bundleId);
21
+ }
22
+ return device;
23
+ },
24
+ async devices(opts = {}) {
25
+ const url = opts.url ?? DEFAULT_URL;
26
+ await ensureMobilecliReachable(url);
27
+ const driver = new MobilecliDriver({ url });
28
+ return driver.listDevices({ platform });
29
+ },
30
+ };
31
+ }
32
+ async function resolveDeviceId(driver, platform, deviceName) {
33
+ const allDevices = await driver.listDevices();
34
+ const online = allDevices.filter((d) => d.platform === platform && d.state === 'online');
35
+ let candidates = online.filter((d) => d.type === 'simulator' || d.type === 'emulator');
36
+ if (candidates.length === 0) {
37
+ candidates = online;
38
+ }
39
+ if (deviceName) {
40
+ candidates = candidates.filter((d) => deviceName.test(d.name));
41
+ if (candidates.length === 0) {
42
+ const available = online.map((d) => d.name).join(', ');
43
+ throw new MobilewrightError(`No online ${platform} device matching ${deviceName} found.\n` +
44
+ (available ? `Available: ${available}` : `No online ${platform} devices found.`));
45
+ }
46
+ }
47
+ if (candidates.length === 0) {
48
+ throw new MobilewrightError(`No online ${platform} devices found.\n\n` +
49
+ (platform === 'ios'
50
+ ? `Start a simulator in Xcode, or boot one with:\n xcrun simctl boot "<simulator name>"`
51
+ : `Start an emulator in Android Studio, or boot one with:\n emulator -avd <avd_name>`));
52
+ }
53
+ return candidates[0].id;
54
+ }
55
+ /** iOS platform launcher */
56
+ export const ios = createLauncher('ios');
57
+ /** Android platform launcher */
58
+ export const android = createLauncher('android');
59
+ //# sourceMappingURL=launchers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launchers.js","sour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zB,aAAa,QAAQ,oBAAoB,UAAU,WAAW;gBAC5D,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC,CAAC,aAAa,QAAQ,iBAAiB,CAAC,CACnF,CAAC;QACJ,CAAC;IACH,CAAC;IAED,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,iBAAiB,CACzB,aAAa,QAAQ,qBAAqB;YACxC,CAAC,QAAQ,KAAK,KAAK;gBACjB,CAAC,CAAC,uFAAuF;gBACzF,CAAC,CAAC,oFAAoF,CAAC,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1B,CAAC;AAED,4BAA4B;AAC5B,MAAM,CAAC,MAAM,GAAG,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEzC,gCAAgC;AAChC,MAAM,CAAC,MAAM,OAAO,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { type ChildProcess } from 'node:child_process';
2
+ export declare function isLocalUrl(url: string): boolean;
3
+ export interface ServerHandle {
4
+ process: ChildProcess;
5
+ kill: () => Promise<void>;
6
+ }
7
+ export declare function startMobilecliServer(opts?: {
8
+ binaryPath?: string;
9
+ port?: number;
10
+ }): Promise<ServerHandle>;
11
+ export declare function ensureMobilecliReachable(url?: string, opts?: {
12
+ autoStart?: boolean;
13
+ }): Promise<{
14
+ serverProcess?: ServerHandle;
15
+ }>;
16
+ //# sourceMappingURL=server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAY9D,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAO/C;AAID,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,YAAY,CAAC;IACtB,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,wBAAsB,oBAAoB,CAAC,IAAI,CAAC,EAAE;IAChD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,YAAY,CAAC,CAiCxB;AAID,wBAAsB,wBAAwB,CAC5C,GAAG,GAAE,MAAoB,EACzB,IAAI,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7B,OAAO,CAAC;IAAE,aAAa,CAAC,EAAE,YAAY,CAAA;CAAE,CAAC,CA4B3C"}
package/dist/server.js ADDED
@@ -0,0 +1,86 @@
1
+ import { spawn } from 'node:child_process';
2
+ import WebSocket from 'ws';
3
+ import { sleep } from '@mobilewright/core';
4
+ import { DEFAULT_URL, resolveMobilecliBinary } from '@mobilewright/driver-mobilecli';
5
+ import { MobilewrightError } from './errors.js';
6
+ const HEALTH_CHECK_TIMEOUT = 5_000;
7
+ const SERVER_START_TIMEOUT = 10_000;
8
+ const SERVER_POLL_INTERVAL = 500;
9
+ // ─── URL helpers ───────────────────────────────────────────────
10
+ export function isLocalUrl(url) {
11
+ try {
12
+ const host = new URL(url).hostname;
13
+ return host === 'localhost' || host === '127.0.0.1' || host === '::1';
14
+ }
15
+ catch {
16
+ return true;
17
+ }
18
+ }
19
+ export async function startMobilecliServer(opts) {
20
+ const binary = opts?.binaryPath ?? 'mobilecli';
21
+ const port = opts?.port ?? 12000;
22
+ const proc = spawn(binary, ['server', 'start', '--listen', `localhost:${port}`], {
23
+ stdio: 'pipe',
24
+ detached: false,
25
+ });
26
+ const wsUrl = `ws://localhost:${port}/ws`;
27
+ const deadline = Date.now() + SERVER_START_TIMEOUT;
28
+ while (Date.now() < deadline) {
29
+ if (await checkWebSocket(wsUrl, 1_000)) {
30
+ return {
31
+ process: proc,
32
+ kill: async () => {
33
+ proc.kill('SIGTERM');
34
+ await new Promise((resolve) => {
35
+ const timer = setTimeout(() => { proc.kill('SIGKILL'); resolve(); }, 3_000);
36
+ proc.on('exit', () => { clearTimeout(timer); resolve(); });
37
+ });
38
+ },
39
+ };
40
+ }
41
+ await sleep(SERVER_POLL_INTERVAL);
42
+ }
43
+ proc.kill('SIGTERM');
44
+ throw new MobilewrightError(`mobilecli server did not become ready within ${SERVER_START_TIMEOUT / 1000}s.\n` +
45
+ `Try starting it manually with: ${binary} server start`);
46
+ }
47
+ // ─── Health check ──────────────────────────────────────────────
48
+ export async function ensureMobilecliReachable(url = DEFAULT_URL, opts) {
49
+ if (await checkWebSocket(url, HEALTH_CHECK_TIMEOUT))
50
+ return {};
51
+ if (!isLocalUrl(url)) {
52
+ throw new MobilewrightError(`Cannot reach mobilecli server at ${url}.\n\n` +
53
+ `Ensure the remote server is running and accessible.`);
54
+ }
55
+ let binaryPath;
56
+ try {
57
+ binaryPath = resolveMobilecliBinary();
58
+ }
59
+ catch {
60
+ binaryPath = null;
61
+ }
62
+ if (opts?.autoStart && binaryPath) {
63
+ let port = 12000;
64
+ try {
65
+ port = Number(new URL(url).port) || 12000;
66
+ }
67
+ catch { /* default */ }
68
+ const handle = await startMobilecliServer({ binaryPath, port });
69
+ return { serverProcess: handle };
70
+ }
71
+ const hint = binaryPath
72
+ ? `Start it with:\n mobilecli server start`
73
+ : `Install mobilecli from:\n https://github.com/mobile-next/mobilecli\n\n` +
74
+ `Then start the server with:\n mobilecli server start`;
75
+ throw new MobilewrightError(`mobilecli server is not running at ${url}.\n\n${hint}`);
76
+ }
77
+ // ─── Helpers ───────────────────────────────────────────────────
78
+ function checkWebSocket(url, timeout) {
79
+ return new Promise((resolve) => {
80
+ const ws = new WebSocket(url);
81
+ const timer = setTimeout(() => { ws.terminate(); resolve(false); }, timeout);
82
+ ws.on('open', () => { clearTimeout(timer); ws.close(); resolve(true); });
83
+ ws.on('error', () => { clearTimeout(timer); resolve(false); });
84
+ });
85
+ }
86
+ //# sourceMappingURL=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C,CAAC,CAAC,CAAC;QACzE,EAAE,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,12 +1,45 @@
1
1
  {
2
2
  "name": "mobilewright",
3
- "version": "0.0.1",
4
- "description": "mobilewright",
5
- "main": "index.js",
6
- "types": "index.d.ts",
3
+ "version": "0.0.10",
4
+ "description": "Mobile device automation framework inspired by Playwright",
5
+ "homepage": "https://mobilewright.dev",
7
6
  "license": "Apache-2.0",
7
+ "engines": {
8
+ "node": ">=18"
9
+ },
10
+ "type": "module",
11
+ "main": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "default": "./dist/index.js"
17
+ }
18
+ },
19
+ "scripts": {
20
+ "build": "tsc -b",
21
+ "prepublishOnly": "tsc -b"
22
+ },
23
+ "bin": {
24
+ "mobilewright": "./dist/cli.js"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/mobile-next/mobilewright",
29
+ "directory": "packages/mobilewright"
30
+ },
8
31
  "files": [
9
- "index.js",
10
- "index.d.ts"
11
- ]
32
+ "dist"
33
+ ],
34
+ "dependencies": {
35
+ "@mobilewright/core": "^0.0.10",
36
+ "@mobilewright/driver-mobilecli": "^0.0.10",
37
+ "@mobilewright/protocol": "^0.0.10",
38
+ "commander": "^14.0.3",
39
+ "playwright": "^1.58.2",
40
+ "ws": "^8.18.0"
41
+ },
42
+ "devDependencies": {
43
+ "@types/ws": "^8.5.0"
44
+ }
12
45
  }
package/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/index.js DELETED
@@ -1,2 +0,0 @@
1
- // mobilewright
2
- module.exports = {};