From b2821f62126f54745bbd7eddb15ad13ecc4165e3 Mon Sep 17 00:00:00 2001 From: "kristof.muhi" Date: Sun, 29 Mar 2026 19:09:12 +0200 Subject: [PATCH 1/4] docs: add doctor and init to README prerequisites and CLI sections --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 0d00934..0115058 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,14 @@ await device.close(); - Node.js >= 18 - A booted iOS simulator, Android emulator, or connected real device +Run `mobilewright doctor` to verify your environment is ready: + +```bash +npx mobilewright doctor +``` + +It checks Xcode, Android SDK, simulators, ADB, and other dependencies — and tells you exactly what's missing and how to fix it. Add `--json` for machine-readable output. + ## Packages | Package | Description | @@ -275,6 +283,14 @@ The `device` fixture connects once per worker (reading from `mobilewright.config ## CLI ```bash +# Scaffold a mobilewright.config.ts and example test in the current directory +npx mobilewright init + +# Check your environment for mobile development readiness +npx mobilewright doctor +npx mobilewright doctor --json # machine-readable output +npx mobilewright doctor --category ios # system | ios | android + # List all connected devices, simulators, and emulators npx mobilewright devices ``` From ac9d9133736900b03039424a8df0da6741392473 Mon Sep 17 00:00:00 2001 From: "kristof.muhi" Date: Sun, 29 Mar 2026 19:13:55 +0200 Subject: [PATCH 2/4] docs: restructure CLI section with per-command subsections and examples --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 48 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 0115058..db699a6 100644 --- a/README.md +++ b/README.md @@ -282,21 +282,37 @@ The `device` fixture connects once per worker (reading from `mobilewright.config ## CLI +### `mobilewright init` + +Scaffold a `mobilewright.config.ts` and `example.test.ts` in the current directory. Skips files that already exist. + ```bash -# Scaffold a mobilewright.config.ts and example test in the current directory npx mobilewright init +``` + +``` +created mobilewright.config.ts +created example.test.ts +``` -# Check your environment for mobile development readiness +### `mobilewright doctor` + +Check your environment for mobile development readiness — Xcode, Android SDK, simulators, ADB, and more. + +```bash npx mobilewright doctor -npx mobilewright doctor --json # machine-readable output -npx mobilewright doctor --category ios # system | ios | android +npx mobilewright doctor --category ios # system | ios | android +npx mobilewright doctor --json # machine-readable output for AI agents +``` + +### `mobilewright devices` + +List all connected devices, simulators, and emulators. -# List all connected devices, simulators, and emulators +```bash npx mobilewright devices ``` -Example output: - ``` ID Name Platform Type State ------------------------------------------------------------------------------------------------- @@ -304,10 +320,33 @@ ID Name Platform Type 5A5FCFCA-27EC-4D1B-B412-BAE629154EE0 iPhone 17 Pro ios simulator booted ``` -## Tests +### `mobilewright test` + +Run your tests. Auto-discovers `mobilewright.config.ts` in the current directory. + +```bash +npx mobilewright test +npx mobilewright test login.test.ts # run a specific file +npx mobilewright test --grep "sign in" # filter by test name +npx mobilewright test --reporter html # generate HTML report +npx mobilewright test --retries 2 # retry flaky tests +npx mobilewright test --workers 4 # parallel workers +npx mobilewright test --list # list tests without running +``` + +### `mobilewright show-report` + +Open the HTML report generated by `--reporter html`. + +```bash +npx mobilewright show-report +npx mobilewright show-report mobilewright-report/ +``` + +## Contributing ```bash -# Run all unit tests +# Run the repository's own unit tests npm test ``` From a32e411a1726e91fed228b8e4a465c19a45bf0f4 Mon Sep 17 00:00:00 2001 From: Kris Date: Sun, 29 Mar 2026 19:19:51 +0200 Subject: [PATCH 3/4] Update README.md --- README.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/README.md b/README.md index db699a6..152c0fb 100644 --- a/README.md +++ b/README.md @@ -295,16 +295,6 @@ created mobilewright.config.ts created example.test.ts ``` -### `mobilewright doctor` - -Check your environment for mobile development readiness — Xcode, Android SDK, simulators, ADB, and more. - -```bash -npx mobilewright doctor -npx mobilewright doctor --category ios # system | ios | android -npx mobilewright doctor --json # machine-readable output for AI agents -``` - ### `mobilewright devices` List all connected devices, simulators, and emulators. From 0e46a3e8ed99c000ab00b02e96ce06b28c3a0c16 Mon Sep 17 00:00:00 2001 From: "kristof.muhi" Date: Sun, 29 Mar 2026 19:22:08 +0200 Subject: [PATCH 4/4] docs: add screenshot call to quick start example --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 152c0fb..0b220f8 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ await screen.getByLabel('Password').fill('password123'); await screen.getByRole('button', { name: 'Sign In' }).tap(); await expect(screen.getByText('Welcome back')).toBeVisible(); +const screenshot = await screen.screenshot(); await device.close(); ```