Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 51 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();
```
Expand All @@ -39,6 +40,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 |
Expand Down Expand Up @@ -274,12 +283,26 @@ 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
# List all connected devices, simulators, and emulators
npx mobilewright devices
npx mobilewright init
```

```
created mobilewright.config.ts
created example.test.ts
```

### `mobilewright devices`

List all connected devices, simulators, and emulators.

Example output:
```bash
npx mobilewright devices
```

```
ID Name Platform Type State
Expand All @@ -288,10 +311,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
```

Loading