Skip to content

Commit

Permalink
feat: Add helpers to control bluetooth and nfc adapters (#779)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored May 11, 2024
1 parent 67063f5 commit a9403ff
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1503,6 +1503,30 @@ Name | Type | Required | Description | Example
--- | --- | --- | --- | ---
payload | string | yes | A valid base64-encoded .PNG image payload. Other image formats are not supported. This image will be shown on the virtual scene foreground as soon as you open a camera client app. | iVBORw0KGgoAAAANSUh...

### mobile: bluetooth

Allows to control the bluetooth adapter in the device under test.
An error is thrown if the device has no default bluetooth adapter.
Available since driver version 3.4.0

#### Arguments

Name | Type | Required | Description | Example
--- | --- | --- | --- | ---
action | string | yes | The action to execute on the bluetooth adapter. The following actions are supported: `enable`, `disable`, `unpairAll`. Calling the same action more than once is a noop. | disable

### mobile: nfc

Allows to control the NFC adapter in the device under test.
An error is thrown if the device has no default NFC adapter.
Available since driver version 3.4.0

#### Arguments

Name | Type | Required | Description | Example
--- | --- | --- | --- | ---
action | string | yes | The action to execute on the NFC adapter. The following actions are supported: `enable`, `disable`. Calling the same action more than once is a noop. | disable

## Applications Management

UiAutomator2 driver supports Appium endpoints for applications management:
Expand Down
16 changes: 15 additions & 1 deletion lib/execute-method-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,21 @@ export const executeMethodMap = {
params: {
optional: ['opts'],
}
}
},

'mobile: bluetooth': {
command: 'mobileBluetooth',
params: {
optional: ['opts'],
}
},

'mobile: nfc': {
command: 'mobileNfc',
params: {
optional: ['opts'],
}
},
} as const;

export type Uiautomator2ExecuteMethodMap = typeof executeMethodMap;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
},
"dependencies": {
"appium-adb": "^12.2.0",
"appium-android-driver": "^9.3.0",
"appium-android-driver": "^9.5.0",
"appium-chromedriver": "^5.6.28",
"appium-uiautomator2-server": "^7.0.1",
"asyncbox": "^3.0.0",
Expand Down

0 comments on commit a9403ff

Please sign in to comment.