Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a26015a
feat(app): grant every permission with app.permissions: 'all'
imranbarbhuiya Nov 18, 2026
1332ab2
fix(mobile): grant each permission for 'all' on iOS, and test it on t…
imranbarbhuiya Nov 18, 2026
6dc0c78
docs(app): name the iOS notifications gap and the Android-only Appium…
imranbarbhuiya Nov 18, 2026
9f48e8e
fix(mobile): skip an iOS service the runtime refuses under permission…
imranbarbhuiya Nov 18, 2026
06114c2
docs(app): describe permissions 'all' in the ja and zh config referen…
imranbarbhuiya Nov 18, 2026
68bd1b5
fix(app): require core and e2e 0.24.1 in web and mobile for permissio…
imranbarbhuiya Nov 19, 2026
cafe9d8
refactor(mobile): grant permissions 'all' on iOS in one agent-device all
imranbarbhuiya Nov 20, 2026
7408ddd
docs(mobile): say Android 'all' grants runtime permissions, and fails…
imranbarbhuiya Nov 20, 2026
b4d9419
docs(mobile): name the Android no-permissions caveat in the Maestro r…
imranbarbhuiya Nov 20, 2026
b8a1d9d
docs(mobile): put the Android no-permissions caveat next to the Andro…
imranbarbhuiya Nov 20, 2026
8d45ea7
fix(app): require core and e2e 0.25.0 in web and mobile, the release …
imranbarbhuiya Nov 21, 2026
4232678
Merge remote-tracking branch 'upstream/main' into feat/app-permission…
imranbarbhuiya Nov 21, 2026
04a09fe
Merge remote-tracking branch 'upstream/main' into feat/app-permission…
imranbarbhuiya Nov 23, 2026
a91d0a6
fix(app): engines opt in to permissions 'all' with grantsAllPermissio…
imranbarbhuiya Nov 23, 2026
aec6eae
docs(changeset): engines receive allPermissions: true, not the string…
imranbarbhuiya Nov 23, 2026
cca7544
docs(web): say which refused permission types 'all' can skip
imranbarbhuiya Nov 23, 2026
7109ff9
Merge remote-tracking branch 'upstream/main' into feat/app-permission…
imranbarbhuiya Nov 24, 2026
33a4655
docs(mobile): drop the caveat that an Android app declaring no permis…
imranbarbhuiya Nov 24, 2026
284d6b7
Merge remote-tracking branch 'upstream/main' into feat/app-permission…
imranbarbhuiya Nov 25, 2026
91ed24a
fix(app): stop the 'all' config error at what the engine does not take
imranbarbhuiya Nov 25, 2026
8ab64a1
docs(web): name the three permissions an older Chrome may skip under …
imranbarbhuiya Nov 25, 2026
44fa590
test(web): start an attempt under 'all' on a browser that refuses one…
imranbarbhuiya Nov 25, 2026
fa55221
test(mobile): check the app as config load hands it under 'all'
imranbarbhuiya Nov 25, 2026
f9c9893
test(protocol): carry allPermissions into prepare, and compare grants…
imranbarbhuiya Nov 25, 2026
42cf888
docs(core): say launch() takes permissions 'all', linking the config …
imranbarbhuiya Nov 25, 2026
fde8611
docs(mobile): drop SYSTEM_ALERT_WINDOW from permissions 'all' docs
KrzysztofMoch Nov 25, 2026
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
10 changes: 10 additions & 0 deletions .changeset/app-permissions-all.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'e2e': patch
'@e2e-dev/core': patch
'@e2e-dev/mobile': patch
'@e2e-dev/web': patch
---

Accept `app.permissions: 'all'` to grant every permission the target's engine can grant before each fresh launch: on Android every runtime permission the app declares, on an iOS simulator every privacy service its runtime can set, with location `always` (the simulator refuses notifications, so accept that prompt with `device.alert('accept')`), and on the web every permission the browser grants. `device.openApp(app, { relaunch: true, permissions: 'all' })` does the same for one launch.

An engine opts in with `grantsAllPermissions: true` and receives `EngineAppInfo.allPermissions: true`, so `EngineAppInfo.permissions` stays a map of names. For an engine that does not declare it, including a `@e2e-dev/web` or `@e2e-dev/mobile` released before this change, config load refuses `'all'` with `INVALID_CONFIG`.
11 changes: 11 additions & 0 deletions apps/mobile-benchmark/tests/device.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ test.describe('permission prompt', () => {
});
});

// `permissions: 'all'` grants the microphone before the launch, so the
// request resolves without a system dialog: a dialog left up would keep the
// scenario on its prompt and fail the check.
test('permissions all grants the microphone without a system dialog', async ({ app, device, screen }) => {
await device.setPermission('microphone', 'reset');
await device.openApp('dev.e2e.benchmark', { relaunch: true, permissions: 'all' });
await openScenario({ app, device, screen }, 'Permission Prompt');
await screen.getByTestId('request-permission').tap();
await expect(screen.getByTestId('success-message')).toHaveText('Microphone enabled');
});

// Every step auto-focuses its field and keeps the keyboard up on Return
// (`submitBehavior="submit"`), so the keyboard covers Continue from the start
// and `device.dismissKeyboard()` is the way past it: Android hides the
Expand Down
6 changes: 3 additions & 3 deletions docs/ja/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ targets: [
| [`identity`](#identity) | `string` | アプリから導出 |
| [`environment`](#environment) | `'test' \| 'staging' \| 'production'` | `'test'` または `'production'` |
| [`launchArguments`](#launcharguments) | `string[] \| Record<string, LaunchArgumentValue>` | - |
| [`permissions`](#permissions) | `Record<string, AppPermissionState>` | - |
| [`permissions`](#permissions) | `Record<string, AppPermissionState> \| 'all'` | - |
| [`command`](#command) | `CommandConfig` | - |
| [`readyUrl`](#readyurl) | `string` | `url` |

Expand Down Expand Up @@ -436,10 +436,10 @@ type LaunchArguments = readonly string[] | Readonly<Record<string, LaunchArgumen
permissions: { camera: 'grant' },
```

各値は `'grant'`、`'deny'`、`'reset'` のいずれかです。
各値は `'grant'`、`'deny'`、`'reset'` のいずれかです。`permissions: 'all'` は、ターゲットのエンジンが付与できるすべての権限を付与します。

- `mobile()` ターゲットは、新規起動のたびに各権限を設定します。[権限](/reference/mobile#engine)を参照してください。
- `web()` ターゲットが受け付けるのは `'grant'` だけで、試行中の全ページに、オリジンを問わず付与します。ヘッドレス Chromium は、指定していない権限を拒否します。[ブラウザの権限を付与する](/web#granting-browser-permissions)を参照してください。
- `web()` ターゲットが受け付けるのは `'grant'` だけで、試行中の全ページに、オリジンを問わず付与します。ヘッドレス Chromium は、指定していない権限を拒否します。[ブラウザの権限を付与する](/web#granting-browser-permissions)を参照してください。`'all'` は、下の表にあるそのブラウザの名前をすべて付与します。

| ブラウザ | 名前 |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/ja/reference/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const shop = await launch(web(), {
| `linkBase` | `mobile()` | `app.open(path)` がパスを結合し、リンクとして開く際のベース。[設定](/reference/config#linkbase)を参照してください。 |
| `identity` | 両方 | 保存済みの状態や録画で使うアプリ名。デフォルトは URL またはバンドル ID。 |
| `launchArguments` | `mobile()` | アプリの起動引数。 |
| `permissions` | 両方 | 許可または拒否する権限。 |
| `permissions` | 両方 | 許可または拒否する権限。`'all'` は、エンジンが付与できるすべての権限を付与します。[設定](/reference/config#permissions)を参照してください。 |

<a id="timeout" />

Expand Down
2 changes: 2 additions & 0 deletions docs/ja/reference/engine-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ export interface EngineManifest {
readonly tapModifiers?: boolean;
/** Requires `lifecycle/prepare`: `prepare` binds the device `e2e run --device` names. */
readonly selectsDevice?: boolean;
/** See `Engine.grantsAllPermissions`. */
readonly grantsAllPermissions?: boolean;
/** See `Engine.isolation`; left out for `attempt`. */
readonly isolation?: 'worker';
}
Expand Down
15 changes: 15 additions & 0 deletions docs/ja/reference/engine.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface EngineHandle<Fixtures extends object = {}> extends Engine {
| `performAt`, `pointerActions` | 片方しかない。`pointerActions` が空、種類が重複、または `POINTER_ACTION_KINDS` にない種類を含む。 |
| `tapModifiers` | 真偽値でない、または `perform` がないのに `true`。 |
| `selectsDevice` | 真偽値でない、または `prepare` がないのに `true`。 |
| `grantsAllPermissions` | 真偽値でない。 |
| `isolation` | `'attempt'` と `'worker'` 以外の値。 |
| `keyboard`, `state`, `artifacts`, `session` | 未知のキーや関数でないメンバーがある。`keyboard` に `type` と `press` がない、`state` に `capture` と `restore` の両方がない、`artifacts` に `screenshot` がない、`startVideo` と `stopVideo` の片方しかない。 |
| `secrets` | `secrets.get()` ハンドルの配列でない。 |
Expand Down Expand Up @@ -120,6 +121,7 @@ export interface EngineHandle<Fixtures extends object = {}> extends Engine {
| [`performAt`, `pointerActions`](#pointer-actions) | メソッド、種類 |
| [`tapModifiers`](#capabilities) | `boolean` |
| [`selectsDevice`](#capabilities) | `boolean` |
| [`grantsAllPermissions`](#capabilities) | `boolean` |
| [`keyboard`](#keyboard) | `EngineKeyboard` |
| [`fixtures`](#contributed-fixtures) | ファクトリー |
| [`isolation`](#fixture-isolation) | `'attempt' \| 'worker'` |
Expand Down Expand Up @@ -227,6 +229,12 @@ export interface Engine {
* for the target before anything is prepared.
*/
readonly selectsDevice?: boolean;
/**
* The engine grants `app.permissions: 'all'`, which reaches it as
* `EngineAppInfo.allPermissions`. Without it the harness refuses `'all'` at
* config load, so an engine that predates the value never receives it.
*/
readonly grantsAllPermissions?: boolean;
/**
* The engine reads the object form of `app.launchArguments` from
* `EngineAppInfo.launchArgumentValues`. Without it the harness refuses an
Expand Down Expand Up @@ -376,6 +384,7 @@ export interface OperationContext {
| `locate` | `location` | `observe` | `screen`、`Locator`、`expect(locator)`。 |
| `tapModifiers: true` | - | `perform` | `tap`、`doubleTap`、`multiTap`、`secondaryTap` の `modifiers`。 |
| `selectsDevice: true` | - | `prepare` | `e2e run --device`。`prepare` が指定のデバイスを割り当てます。 |
| `grantsAllPermissions: true` | - | - | `app.permissions: 'all'`。エンジンは `EngineAppInfo.allPermissions` として受け取ります。宣言がなければ設定の読み込みで `'all'` を拒否するため、これより前のエンジンがこの文字列を受け取ることはありません。 |
| `performAt` + `pointerActions` | `pointer` | `observe` | 対応するノードのないビューポート座標でのポインター操作。 |
| `keyboard.{type,press,dismiss?}` | `keyboard` | `observe` | フォーカス中の対象への入力。 |
| `fixtures.<name>` | `<name>` | - | エンジンが提供するフィクスチャ。 |
Expand Down Expand Up @@ -1405,6 +1414,12 @@ export interface EngineAppInfo {
readonly launchArgumentValues?: LaunchArgumentValues;
/** Permissions the app holds, by name; what each state means is the engine's (a device sets them before every fresh launch). */
readonly permissions?: Readonly<Record<string, AppPermissionState>>;
/**
* `app.permissions: 'all'`: grant every permission the engine can grant,
* in place of `permissions`. Only an engine that declares
* `grantsAllPermissions` receives it; for any other, the config is refused.
*/
readonly allPermissions?: true;
}
```

Expand Down
14 changes: 10 additions & 4 deletions docs/ja/reference/mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,14 @@ await agent.act('Open About and read the iOS version');
/** A permission's state: held, refused, or not asked for yet, so the OS asks again. */
export type PermissionState = 'grant' | 'deny' | 'reset';

/** Permissions an app holds when it launches, by name. */
export type LaunchPermissions = Readonly<Partial<Record<DevicePermission, PermissionState>>>;
/**
* Permissions an app holds when it launches, by name, or `'all'` to grant
* every one the platform can. On Android that is each runtime permission the
* app declares; the rest are skipped. On an iOS simulator it is each privacy
* service the runtime can set, location `always` included. The simulator
* refuses to set notifications.
*/
export type LaunchPermissions = Readonly<Partial<Record<DevicePermission, PermissionState>>> | 'all';
```

### device フィクスチャ
Expand All @@ -1173,8 +1179,8 @@ export interface OpenAppOptions {
readonly launchArguments?: LaunchArguments;
/**
* Permissions the app holds before this launch, each granted, denied, or
* reset. Replaces the target's `app.permissions` for a relaunch of the
* pinned app.
* reset, or `'all'` to grant every one the platform can. Replaces the
* target's `app.permissions` for a relaunch of the pinned app.
*/
readonly permissions?: LaunchPermissions;
}
Expand Down
3 changes: 2 additions & 1 deletion docs/migrate/appium.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ For a migration that spans several sessions, the [`migrate-to-e2e` skill](/codin
| `appium:bundleId`, `appium:appPackage` | `app: { bundleId }`, the app `app.open()` launches |
| `appium:processArguments`, `appium:optionalIntentArguments` | `app.launchArguments`, a list of strings or an object of argument name to value |
| `appium:permissions` | `app.permissions: { camera: 'grant' }`. Each [`DevicePermission`](/reference/mobile#device-fixture) name takes `grant`, `deny`, or `reset` |
| `appium:autoGrantPermissions` (Android) | `app.permissions: 'all'`, which grants every runtime permission the app declares |
| `appium:noReset` | `true` is the default, so nothing clears the app's data. For `false`, call `app.clearState()` at the start of the test |
| `appium:fullReset` | `device.installApp(path, { reinstall: true })` |
| `appium:newCommandTimeout`, WebDriverAgent timeouts | Not needed. Actions use `actionTimeout`, assertions `assertionTimeout`, and tests `timeout` |
Expand Down Expand Up @@ -295,7 +296,7 @@ is not a step, so it skips the report and secret redaction.

| Appium | Use today |
| --- | --- |
| `appium:autoGrantPermissions`, Android permissions off the list, iOS location `always` | List each permission in `app.permissions`, or run `adb shell pm grant` before the run. For iOS location `always`, tap the prompt's button |
| Android permissions off the list, iOS location `always` | `app.permissions: 'all'` grants every runtime permission an Android app declares, and location `always` on an iOS simulator. Or run `adb shell pm grant` before the run, and on a physical iPhone tap the prompt's button |
| Device settings and alerts on a `browserstack()` or `testmu()` device | Tap the prompt as UI. Run those tests on a local device |
| `bstack:options.local`, `lt:options.tunnel` | Point the app at a backend the hosted device can reach |
| `appium:appActivity`, `appWaitActivity`, `startActivity()` | `device.openLink(url)`, or `client.apps.open` through [`unstable_raw`](/reference/mobile#unstable_raw) |
Expand Down
10 changes: 7 additions & 3 deletions docs/migrate/maestro.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Calls on `device` run only on a device, so a test that uses it declares
| `launchApp: { stopApp: false }` | `device.openApp(id)` without `relaunch` |
| `launchApp: { arguments }` | `app.launchArguments` on the target, with the same keys, or a list of strings for an iOS app that reads `ProcessInfo.processInfo.arguments` (an object is spelled for `UserDefaults`: `NO` for `false`, quotes around `a b` or `-1`); `device.openApp(app, { relaunch: true, launchArguments })` for one launch |
| `launchApp: { permissions }`, `setPermissions` | `app.permissions` on the target, or `device.openApp(app, { relaunch: true, permissions })` for one launch; `grant`, `deny`, `reset` for `allow`, `deny`, `unset`. `device.setPermission(name, state)` before `app.open()` |
| `permissions: { all: allow }` | `app.permissions: 'all'` |
| `stopApp`, `killApp` | `device.closeApp()`, a force stop; `app.restart()` to stop the app and launch it again |
| `clearKeychain`, `openLink`, `setLocation`, `setAirplaneMode`, `setOrientation`, `setClipboard` | the same on `device`, such as `device.openLink(url)`. `clearKeychain` is iOS simulator only, `setAirplaneMode(true)` Android 11 or newer. For `travel`, loop `device.setLocation` |
| `back`, `pressKey: Home`, `hideKeyboard`, `setDarkMode` | `app.back()`, `device.home()`, `device.dismissKeyboard()`, `device.setAppearance('dark')` |
Expand Down Expand Up @@ -169,7 +170,7 @@ on purpose.

| Maestro | Use today |
| --- | --- |
| `permissions: { all }`, the grant-all default, names such as `bluetooth` and `storage` | Name each permission in `app.permissions`, or accept the prompt with `device.alert('accept')` |
| The grant-all default, names such as `bluetooth` and `storage` | `app.permissions: 'all'`, which on Android grants every runtime permission the app declares, or accept the prompt with `device.alert('accept')` |
| `inputText` and `pressKey: Enter` with no field, `eraseText: N`, `pressKey: backspace`, `tab` | `fill` or `press` on the field's locator; `fill` a shortened `inputValue()` to erase; tap the next field for Tab |
| `addMedia` | On an iOS simulator, `xcrun simctl addmedia` before `app.open()`; Android is unchecked. See "Photos for a picker test" under [The device fixture](/mobile#the-device-fixture) |
| `label` on a command | `-`. The call names each step |
Expand Down Expand Up @@ -208,8 +209,11 @@ on purpose.

- Maestro grants every permission when it launches the app. e2e grants none
unless you name it, so a ported flow meets system prompts Maestro never
showed. Name each one in [`app.permissions`](/mobile#launch-arguments-and-permissions),
with `grant`, `deny`, and `reset` for Maestro's `allow`, `deny`, and `unset`.
showed. Set [`app.permissions: 'all'`](/mobile#launch-arguments-and-permissions),
or name each one with `grant`, `deny`, and `reset` for Maestro's `allow`,
`deny`, and `unset`. On an iOS simulator `'all'` leaves out notifications,
which the simulator refuses to set: accept that prompt with
`device.alert('accept')`.
- Calls through [`device.unstable_raw`](/reference/mobile#unstable_raw)
aren't steps. The report, the trace, the agent cache, and redaction skip them.
- A device has no `test.setup` or `{ session }`, see
Expand Down
6 changes: 6 additions & 0 deletions docs/mobile.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ app: {
`app.clearState()` resets them with the data, then sets them again.
- `deny` on iOS tells the app no without a prompt. On Android it revokes
the permission, so the OS asks again.
- `permissions: 'all'` grants every permission the platform can set: each
runtime permission the app declares on Android, and each privacy service
the runtime can set on an iOS simulator, with location `always`. Android
skips permissions it grants at install, such as `INTERNET`. The simulator
refuses to set notifications, so accept that prompt with
`device.alert('accept')`.
- The warm-up before the run passes neither, so start each test with
`app.open()`.
- Arguments that select a build mode change what the app is. Give each mode
Expand Down
8 changes: 5 additions & 3 deletions docs/reference/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ targets: [
| [`identity`](#identity) | `string` | derived from the app |
| [`environment`](#environment) | `'test' \| 'staging' \| 'production'` | `'test'` or `'production'` |
| [`launchArguments`](#launcharguments) | `string[] \| Record<string, LaunchArgumentValue>` | - |
| [`permissions`](#permissions) | `Record<string, AppPermissionState>` | - |
| [`permissions`](#permissions) | `Record<string, AppPermissionState> \| 'all'` | - |
| [`command`](#command) | `CommandConfig` | - |
| [`readyUrl`](#readyurl) | `string` | `url` |

Expand Down Expand Up @@ -560,13 +560,15 @@ Permissions the app holds, by name.
permissions: { camera: 'grant' },
```

Each is `'grant'`, `'deny'`, or `'reset'`.
Each is `'grant'`, `'deny'`, or `'reset'`. `permissions: 'all'` grants
every permission the target's engine can grant.

- A `mobile()` target sets each one before every fresh launch. See
[permissions](/reference/mobile#engine).
- A `web()` target takes `'grant'` only and grants it to every page of the
attempt, on any origin. Headless Chromium refuses a permission left out. See
[Granting browser permissions](/web#granting-browser-permissions).
[Granting browser permissions](/web#granting-browser-permissions). `'all'`
grants each name in the table below for its browser.

| Browser | Names |
| --- | --- |
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/core.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ What `app.open()` opens on a browser, or launches on a device.
| `linkBase` | `mobile()` | What `app.open(path)` joins the path to and opens as a link. See [config](/reference/config#linkbase). |
| `identity` | both | The app's name for saved states and recordings. Default: the URL or the bundle id. |
| `launchArguments` | `mobile()` | Arguments the app launches with, a list or an object. See [config](/reference/config#launcharguments). |
| `permissions` | both | Permissions to grant or deny. |
| `permissions` | both | Permissions to grant or deny, or `'all'` to grant every one the engine can. See [config](/reference/config#permissions). |

<a id="timeout" />

Expand Down
2 changes: 2 additions & 0 deletions docs/reference/engine-protocol.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ export interface EngineManifest {
readonly tapModifiers?: boolean;
/** Requires `lifecycle/prepare`: `prepare` binds the device `e2e run --device` names. */
readonly selectsDevice?: boolean;
/** See `Engine.grantsAllPermissions`. */
readonly grantsAllPermissions?: boolean;
/** The engine reads the object form of `app.launchArguments` from `EngineAppInfo.launchArgumentValues`. */
readonly launchArgumentValues?: boolean;
/** The engine opens an app whose `url` is a `file:` URL, read from the disk of the machine the harness runs on. */
Expand Down
Loading
Loading