Skip to content

Commit a64afc8

Browse files
authored
docs: add doctor and example commands to README
2 parents 51379ae + 0e46a3e commit a64afc8

1 file changed

Lines changed: 51 additions & 5 deletions

File tree

README.md

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ await screen.getByLabel('Password').fill('password123');
3636
await screen.getByRole('button', { name: 'Sign In' }).tap();
3737

3838
await expect(screen.getByText('Welcome back')).toBeVisible();
39+
const screenshot = await screen.screenshot();
3940

4041
await device.close();
4142
```
@@ -45,6 +46,14 @@ await device.close();
4546
- Node.js >= 18
4647
- A booted iOS simulator, Android emulator, or connected real device
4748

49+
Run `mobilewright doctor` to verify your environment is ready:
50+
51+
```bash
52+
npx mobilewright doctor
53+
```
54+
55+
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.
56+
4857
## Packages
4958

5059
| Package | Description |
@@ -280,12 +289,26 @@ The `device` fixture connects once per worker (reading from `mobilewright.config
280289

281290
## CLI
282291

292+
### `mobilewright init`
293+
294+
Scaffold a `mobilewright.config.ts` and `example.test.ts` in the current directory. Skips files that already exist.
295+
283296
```bash
284-
# List all connected devices, simulators, and emulators
285-
npx mobilewright devices
297+
npx mobilewright init
298+
```
299+
286300
```
301+
created mobilewright.config.ts
302+
created example.test.ts
303+
```
304+
305+
### `mobilewright devices`
306+
307+
List all connected devices, simulators, and emulators.
287308

288-
Example output:
309+
```bash
310+
npx mobilewright devices
311+
```
289312

290313
```
291314
ID Name Platform Type State
@@ -294,10 +317,33 @@ ID Name Platform Type
294317
5A5FCFCA-27EC-4D1B-B412-BAE629154EE0 iPhone 17 Pro ios simulator booted
295318
```
296319

297-
## Tests
320+
### `mobilewright test`
321+
322+
Run your tests. Auto-discovers `mobilewright.config.ts` in the current directory.
323+
324+
```bash
325+
npx mobilewright test
326+
npx mobilewright test login.test.ts # run a specific file
327+
npx mobilewright test --grep "sign in" # filter by test name
328+
npx mobilewright test --reporter html # generate HTML report
329+
npx mobilewright test --retries 2 # retry flaky tests
330+
npx mobilewright test --workers 4 # parallel workers
331+
npx mobilewright test --list # list tests without running
332+
```
333+
334+
### `mobilewright show-report`
335+
336+
Open the HTML report generated by `--reporter html`.
337+
338+
```bash
339+
npx mobilewright show-report
340+
npx mobilewright show-report mobilewright-report/
341+
```
342+
343+
## Contributing
298344

299345
```bash
300-
# Run all unit tests
346+
# Run the repository's own unit tests
301347
npm test
302348
```
303349

0 commit comments

Comments
 (0)