Skip to content

Commit

Permalink
feat: Add mobile wrappers for GPS and notification helpers (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Apr 30, 2023
1 parent 2d3f64e commit 97c2989
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -548,6 +548,10 @@ The example output is:
}
```

### mobile: openNotifications

Opens notifications drawer on the device under test. Does nothing if the drawer is already opened. Available since driver version 2.23

### mobile: listSms

Retrieves the list of the most recent SMS properties list via Appium Settings helper. Messages are sorted by date in descending order.
Expand Down Expand Up @@ -1254,6 +1258,14 @@ Name | Type | Required | Description | Example
elementId | string | yes | Hexadecimal identifier of the destination text input | 123456-3456-3435-3453453
text | string | yes | The text to enter. It could also contain Unicode characters. If the text ends with `\\n` (the backslash must be escaped, so the char is NOT translated into `0x0A`) then the Enter key press is going to be emulated after it is entered (the `\\n` substring itself will be cut off from the typed text). | yolo

### mobile: toggleGps

Switches GPS setting state. This API only works reliably since Android 12 (API 31). Available since driver version 2.23

### mobile: isGpsEnabled

Returns `true` if GPS is enabled on the device under test. Available since driver version 2.23


## Applications Management

Expand Down
3 changes: 3 additions & 0 deletions lib/commands/general.js
Expand Up @@ -96,6 +96,7 @@ extensions.executeMobile = async function (mobileCommand, opts = {}) {
stopScreenStreaming: 'mobileStopScreenStreaming',

getNotifications: 'mobileGetNotifications',
openNotifications: 'openNotifications',

listSms: 'mobileListSms',

Expand Down Expand Up @@ -141,6 +142,8 @@ extensions.executeMobile = async function (mobileCommand, opts = {}) {

getConnectivity: 'mobileGetConnectivity',
setConnectivity: 'mobileSetConnectivity',
toggleGps: 'toggleLocationServices',
isGpsEnables: 'isLocationServicesEnabled',

hideKeyboard: 'mobileHideKeyboard',
isKeyboardShown: 'isKeyboardShown',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -58,7 +58,7 @@
"dependencies": {
"@babel/runtime": "^7.0.0",
"appium-adb": "^9.11.0",
"appium-android-driver": "^5.11.0",
"appium-android-driver": "^5.11.1",
"appium-chromedriver": "^5.3.1",
"appium-uiautomator2-server": "^5.7.2",
"asyncbox": "^2.3.1",
Expand Down

0 comments on commit 97c2989

Please sign in to comment.