Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add helpers to control bluetooth and nfc adapters #779

Merged
merged 1 commit into from
May 11, 2024
Merged
Show file tree
Hide file tree
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
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'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be required: ['action'] to follow the README's required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently the validation of execute method parameters in this driver does not really work (and never worked). Would you have time to fix it?

}
},

'mobile: nfc': {
command: 'mobileNfc',
params: {
optional: ['opts'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be required: ['action'] to follow the README's required?

}
},
} 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
Loading