Skip to content

Commit

Permalink
feat: Add doctor checks (#711)
Browse files Browse the repository at this point in the history
  • Loading branch information
mykola-mokhnach authored Jan 5, 2024
1 parent 781827a commit 0e6c8fe
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
pushd "$cwd"
cd ~
CHROMEDRIVER_VERSION="${{ matrix.chromedriverVersion }}" appium driver install --source=local "$cwd"
appium driver doctor uiautomator2
nohup appium server \
--port=$APPIUM_TEST_SERVER_PORT \
--address=$APPIUM_TEST_SERVER_HOST \
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ On top of standard Appium requirements UiAutomator2 driver also expects the foll
- Real Android devices must have [USB debugging enabled](https://developer.android.com/studio/debug/dev-options) and should be visible as `online` in `adb devices -l` output.
- The minimum version of Android API must be 5.0 (API level 21) (6.0 is recommended as version 5 has some known compatibility issues).

### Doctor

Since driver version 2.39.0 you can automate the validation for the most of the above
requirements as well as various optional ones needed by driver extensions by running the
`appium driver doctor uiatomator2` server command.

## Capabilities

Expand Down
5 changes: 5 additions & 0 deletions lib/doctor/optional-checks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { doctor } from 'appium-android-driver';

export const optionalBundletoolCheck = doctor.optionalBundletoolCheck;
export const optionalGstreamerCheck = doctor.optionalGstreamerCheck;
export const optionalFfmpegCheck = doctor.optionalFfmpegCheck;
6 changes: 6 additions & 0 deletions lib/doctor/required-checks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { doctor } from 'appium-android-driver';

export const androidHomeCheck = doctor.androidHomeCheck;
export const javaHomeCheck = doctor.javaHomeCheck;
export const javaHomeValueCheck = doctor.javaHomeValueCheck;
export const androidSdkCheck = doctor.androidSdkCheck;
12 changes: 9 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
},
"dependencies": {
"appium-adb": "^11.0.1",
"appium-android-driver": "^7.4.0",
"appium-android-driver": "^7.5.1",
"appium-chromedriver": "^5.6.5",
"appium-uiautomator2-server": "^6.0.0",
"asyncbox": "^3.0.0",
Expand All @@ -80,7 +80,7 @@
"@appium/docutils": "^1.0.1",
"@appium/eslint-config-appium": "^8.0.3",
"@appium/eslint-config-appium-ts": "^0.x",
"@appium/support": "^4.0.1",
"@appium/support": "^4.2.0",
"@appium/test-support": "^3.0.0",
"@appium/tsconfig": "^0.x",
"@appium/types": "^0.x",
Expand Down Expand Up @@ -132,7 +132,7 @@
"xpath": "^0.x"
},
"peerDependencies": {
"appium": "^2.0.0"
"appium": "^2.4.1"
},
"engines": {
"node": ">=14",
Expand All @@ -147,6 +147,12 @@
"mainClass": "AndroidUiautomator2Driver",
"scripts": {
"reset": "scripts/reset.js"
},
"doctor": {
"checks": [
"./build/lib/doctor/required-checks.js",
"./build/lib/doctor/optional-checks.js"
]
}
},
"typedoc": {
Expand Down

0 comments on commit 0e6c8fe

Please sign in to comment.