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: let check doctor only for Android, or iOS #681

Merged
merged 2 commits into from
Apr 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
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ Each client needs [each finder](finder) module to handle [Finders](#Finders). Ap
Since driver version 2.4.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 flutter` server command.
The check runs for Android for UIAutomator2 driver and iOS for XCUITest driver.

`SKIP_ANDROID` or `SKIP_IOS` environment variable helps to skip these checks.

```
# skip Android check
SKIP_ANDROID=1 appium driver doctor flutter
# skip iOS check
SKIP_IOS=1 appium driver doctor flutter
```

### Note
- Flutter context does not support page source
- Please use `getRenderTree` command instead
Expand Down
41 changes: 41 additions & 0 deletions driver/lib/doctor/checks.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { doctor as androidDoctor } from 'appium-android-driver';
import { doctor as iosDoctor } from 'appium-xcuitest-driver';

// shared
export const homeEnvVarCheck = iosDoctor.required.homeEnvVarCheck;

let androidHomeCheck;
let javaHomeCheck;
let javaHomeValueCheck;
let androidSdkCheck;
let optionalBundletoolCheck;
let optionalGstreamerCheck;
if (!process.env.SKIP_ANDROID) {
androidHomeCheck = androidDoctor.androidHomeCheck;
javaHomeCheck = androidDoctor.javaHomeCheck;
javaHomeValueCheck = androidDoctor.javaHomeValueCheck;
androidSdkCheck = androidDoctor.androidSdkCheck;
optionalBundletoolCheck = androidDoctor.optionalBundletoolCheck;
optionalGstreamerCheck = androidDoctor.optionalGstreamerCheck;
}

let xcodeCheck;
let xcodeToolsCheck;
let envVarAndPathCheck;
let optionalIdbCommandCheck;
let optionalApplesimutilsCommandCheck;
if (!process.env.SKIP_IOS) {
xcodeCheck = iosDoctor.required.xcodeCheck;
xcodeToolsCheck = iosDoctor.required.xcodeToolsCheck;
envVarAndPathCheck = iosDoctor.required.envVarAndPathCheck;
optionalIdbCommandCheck = iosDoctor.optional.optionalIdbCommandCheck;
optionalApplesimutilsCommandCheck = iosDoctor.optional.optionalApplesimutilsCheck;
}

// shared
export const optionalFfmpegCheck = androidDoctor.optionalFfmpegCheck;

export {
androidHomeCheck, javaHomeCheck, javaHomeValueCheck, androidSdkCheck, optionalBundletoolCheck, optionalGstreamerCheck,
xcodeCheck, xcodeToolsCheck, envVarAndPathCheck, optionalIdbCommandCheck, optionalApplesimutilsCommandCheck
};
8 changes: 3 additions & 5 deletions driver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,7 @@
"mainClass": "FlutterDriver",
"doctor": {
"checks": [
"./node_modules/appium-uiautomator2-driver/build/lib/doctor/required-checks.js",
"./node_modules/appium-uiautomator2-driver/build/lib/doctor/optional-checks.js",
"./node_modules/appium-xcuitest-driver/build/lib/doctor/required-checks.js",
"./node_modules/appium-xcuitest-driver/build/lib/doctor/optional-checks.js"
"./build/lib/doctor/checks.js"
]
}
},
Expand Down Expand Up @@ -77,8 +74,9 @@
},
"dependencies": {
"appium-ios-device": "^2.4.1",
"appium-android-driver": "^9.0.3",
"appium-uiautomator2-driver": "^3.0.0",
"appium-xcuitest-driver": "^6.0.1",
"appium-xcuitest-driver": "^7.11.1",
"bluebird": "^3.1.1",
"lodash": "^4.0.0",
"portscanner": "^2.2.0",
Expand Down
Loading