Skip to content

Commit

Permalink
feat: Add mobile extensions for on-screen keyboard (#594)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach committed Apr 20, 2023
1 parent 95c75c9 commit 09e839e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
18 changes: 18 additions & 0 deletions README.md
Expand Up @@ -1059,6 +1059,24 @@ language | string | no | The language abbreviation to fetch app strings mapping

App strings map, where keys are resource identifiers.

### mobile: hideKeyboard

Tries to hide the on-screen keyboard. Throws an exception if the keyboard cannot be hidden.
Does nothing if the keyboard is already hidden.

#### Returned Result

`true` if the keyboard was successfully hidden or `false` if it was already invisible.

### mobile: isKeyboardShown

Checks if the system on-screen keyboard is visible.

#### Returned Result

`true` if the keyboard is visible


## Applications Management

UiAutomator2 driver supports Appium endpoints for applications management:
Expand Down
3 changes: 3 additions & 0 deletions lib/commands/general.js
Expand Up @@ -136,6 +136,9 @@ extensions.executeMobile = async function (mobileCommand, opts = {}) {

getConnectivity: 'mobileGetConnectivity',
setConnectivity: 'mobileSetConnectivity',

hideKeyboard: 'mobileHideKeyboard',
isKeyboardShown: 'isKeyboardShown',
};

if (!_.has(mobileCommandsMapping, mobileCommand)) {
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.9.0",
"appium-android-driver": "^5.10.0",
"appium-chromedriver": "^5.3.1",
"appium-uiautomator2-server": "^5.7.2",
"asyncbox": "^2.3.1",
Expand Down

0 comments on commit 09e839e

Please sign in to comment.