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 checkVersion option for mobile:installApp #915

Merged
merged 3 commits into from
Feb 8, 2024

Conversation

KazuCocoa
Copy link
Member

@KazuCocoa KazuCocoa commented Feb 8, 2024

As same as appium/appium-xcuitest-driver#2322 , so app installation will be skipped if the installed app is equal or greater than the installed app

appium/appium#19754

e.g. with uia2

  • driver.execute_script "mobile: installApp", {appPath: "https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip", checkVersion: false}
  • driver.execute_script "mobile: installApp", {appPath: "https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip", checkVersion: true}
[HTTP] --> POST /session/f8146e45-e10b-4e8e-abe4-6eb9d8f927ef/execute/sync
[HTTP] {"script":"mobile: installApp","args":[{"appPath":"https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip"}]}
[debug] [AndroidUiautomator2Driver@719d (f8146e45)] Calling AppiumDriver.execute() with args: ["mobile: installApp",[{"appPath":"https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip"}],"f8146e45-e10b-4e8e-abe4-6eb9d8f927ef"]
[AndroidUiautomator2Driver@719d (f8146e45)] Executing method 'mobile: installApp'
[debug] [BaseDriver] Cached app data: {
[debug] [BaseDriver]   "lastModified": null,
[debug] [BaseDriver]   "immutable": false,
[debug] [BaseDriver]   "maxAge": 300,
[debug] [BaseDriver]   "etag": "W/\"d8f6c539b8657abd111a46ea257f9240b353b09c95eaed74fb322dd1b4898482\"",
[debug] [BaseDriver]   "timestamp": 1707376209263,
[debug] [BaseDriver]   "packageHash": "01b778aa2e0e3c91e6a5219de9cfd8fea1757805",
[debug] [BaseDriver]   "integrity": {
[debug] [BaseDriver]     "file": "e5d5451e0d5300e78bff059460313425fb344b5c"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "fullPath": "/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk"
[debug] [BaseDriver] }
[BaseDriver] Using downloadable app 'https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip'
[debug] [BaseDriver] Etag: W/"d8f6c539b8657abd111a46ea257f9240b353b09c95eaed74fb322dd1b4898482"
[debug] [BaseDriver] Last-Modified: undefined
[debug] [BaseDriver] Cache-Control: max-age=300
[BaseDriver] Reusing previously downloaded application at '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk'
[ADB] The application at '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk' will not be cached, because the device under test has confirmed the support of streamed installs
[debug] [ADB] Running '/Users/kazu/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 install -r /var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk'
[ADB] The installation of 'api.apk' took 201ms
[debug] [ADB] Install command stdout: Performing Streamed Install
[debug] [ADB] Success
[debug] [AndroidUiautomator2Driver@719d (f8146e45)] Responding to client with driver.execute() result: null
[HTTP] <-- POST /session/f8146e45-e10b-4e8e-abe4-6eb9d8f927ef/execute/sync 200 435 ms - 14
[HTTP]
[HTTP] --> POST /session/f8146e45-e10b-4e8e-abe4-6eb9d8f927ef/execute/sync
[HTTP] {"script":"mobile: installApp","args":[{"appPath":"https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip","checkVersion":true}]}
[debug] [AndroidUiautomator2Driver@719d (f8146e45)] Calling AppiumDriver.execute() with args: ["mobile: installApp",[{"appPath":"https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip","checkVersion":true}],"f8146e45-e10b-4e8e-abe4-6eb9d8f927ef"]
[AndroidUiautomator2Driver@719d (f8146e45)] Executing method 'mobile: installApp'
[debug] [BaseDriver] Cached app data: {
[debug] [BaseDriver]   "lastModified": null,
[debug] [BaseDriver]   "immutable": false,
[debug] [BaseDriver]   "maxAge": 300,
[debug] [BaseDriver]   "etag": "W/\"d8f6c539b8657abd111a46ea257f9240b353b09c95eaed74fb322dd1b4898482\"",
[debug] [BaseDriver]   "timestamp": 1707376209263,
[debug] [BaseDriver]   "packageHash": "01b778aa2e0e3c91e6a5219de9cfd8fea1757805",
[debug] [BaseDriver]   "integrity": {
[debug] [BaseDriver]     "file": "e5d5451e0d5300e78bff059460313425fb344b5c"
[debug] [BaseDriver]   },
[debug] [BaseDriver]   "fullPath": "/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk"
[debug] [BaseDriver] }
[BaseDriver] Using downloadable app 'https://github.com/appium/ruby_lib_core/raw/master/test/functional/app/api.apk.zip'
[debug] [BaseDriver] Etag: W/"d8f6c539b8657abd111a46ea257f9240b353b09c95eaed74fb322dd1b4898482"
[debug] [BaseDriver] Last-Modified: undefined
[debug] [BaseDriver] Cache-Control: max-age=300
[BaseDriver] Reusing previously downloaded application at '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk'
[debug] [ADB] Getting package info for 'io.appium.android.apis'
[debug] [ADB] Running '/Users/kazu/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys package io.appium.android.apis'
[debug] [ADB] The version name of the installed 'io.appium.android.apis' is greater or equal to the application version name ('4.1.1' >= '4.1.1')
[debug] [ADB] There is no need to install/upgrade '/var/folders/xt/hbb7vf_d2_g6ks5b765c890c0000gn/T/202417-40758-iek5w2.42nf/api.apk'
[debug] [AndroidUiautomator2Driver@719d (f8146e45)] Responding to client with driver.execute() result: null
[HTTP] <-- POST /session/f8146e45-e10b-4e8e-abe4-6eb9d8f927ef/execute/sync 200 340 ms - 14

@@ -223,6 +223,13 @@ export async function installApp(appPath, opts) {
*/
export async function mobileInstallApp(opts) {
const {appPath} = requireArgs('appPath', opts);
const {checkVersion} = opts;
Copy link
Contributor

Choose a reason for hiding this comment

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

use const {appPath, checkVersion} = requireArgs( ... instead

@KazuCocoa KazuCocoa merged commit cec1de7 into master Feb 8, 2024
10 checks passed
@KazuCocoa KazuCocoa deleted the add-version-check branch February 8, 2024 07:45
github-actions bot pushed a commit that referenced this pull request Feb 8, 2024
## [8.4.0](v8.3.0...v8.4.0) (2024-02-08)

### Features

* add checkVersion option for mobile:installApp ([#915](#915)) ([cec1de7](cec1de7))
Copy link

github-actions bot commented Feb 8, 2024

🎉 This PR is included in version 8.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants