-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Add an explanation about running tests against Android App Bundle module #11601
Add an explanation about running tests against Android App Bundle module #11601
Conversation
Google has released [Android App Bundle](https://developer.android.com/platform/technology/app-bundle/) feature. | ||
`.aab` file is generated by the feature. We must upload the file to Google Play Store. | ||
|
||
We can get distributed apk files from the `.aab` file via [bundletool](https://github.com/google/bundletool). Using the generated files, we can test against release module. After [1](https://github.com/appium/appium-adb/pull/367) and [2](https://github.com/appium/appium-base-driver/pull/271), you can run Appium tests against `.apks` file. The commits are available over Appium 1.9.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The support for apks is currently only present in UIA2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, we can test against the release module.
...
Since Appium 1.9.2, you can run Appium tests against an .apks
file.
@@ -0,0 +1,51 @@ | |||
## How To Test Android App Bundle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it makes sense to also add https://developer.android.com/studio/command-line/bundletool link into this article
|
||
1. Export `bundletool.jar` in your path | ||
- Appium search the `bundletool.jar` in your local. Make sure you can find the path with `which 'bundletool.jar'`. If you can't find it, please set the path correctly. | ||
2. Generate `.apks` from `.aab` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this might be also possible with Android Studio UI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since version 3.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate the .apks
file from the .aab
file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some wording suggestions
@@ -0,0 +1,51 @@ | |||
## How To Test Android App Bundle | |||
|
|||
Google has released [Android App Bundle](https://developer.android.com/platform/technology/app-bundle/) feature. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Google has released the Android App Bundle feature.
## How To Test Android App Bundle | ||
|
||
Google has released [Android App Bundle](https://developer.android.com/platform/technology/app-bundle/) feature. | ||
`.aab` file is generated by the feature. We must upload the file to Google Play Store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An .aab
file is generated by the feature, which we are supposed to upload to the Google Play Store
Google has released [Android App Bundle](https://developer.android.com/platform/technology/app-bundle/) feature. | ||
`.aab` file is generated by the feature. We must upload the file to Google Play Store. | ||
|
||
We can get distributed apk files from the `.aab` file via [bundletool](https://github.com/google/bundletool). Using the generated files, we can test against release module. After [1](https://github.com/appium/appium-adb/pull/367) and [2](https://github.com/appium/appium-base-driver/pull/271), you can run Appium tests against `.apks` file. The commits are available over Appium 1.9.2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
, we can test against the release module.
...
Since Appium 1.9.2, you can run Appium tests against an .apks
file.
## How to run tests | ||
|
||
1. Export `bundletool.jar` in your path | ||
- Appium search the `bundletool.jar` in your local. Make sure you can find the path with `which 'bundletool.jar'`. If you can't find it, please set the path correctly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appium looks for bundletool.jar
in your local environment.
|
||
1. Export `bundletool.jar` in your path | ||
- Appium search the `bundletool.jar` in your local. Make sure you can find the path with `which 'bundletool.jar'`. If you can't find it, please set the path correctly. | ||
2. Generate `.apks` from `.aab` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate the .apks
file from the .aab
file
--ks-pass pass:kazucocoa \ # Password of the keystore | ||
--overwrite # Everytime, you can override the apks | ||
``` | ||
3. Set the `.apks` in your `app` capability. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the path to the .apks
file as your app
capability
|
||
## Tips | ||
|
||
### Test with differnet languages |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
different
|
||
### Test with differnet languages | ||
|
||
Set `fullReset: true` if you would like to test against different languages resources in every creating session. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you would like to test against the app using different languages' resources.
|
||
Set `fullReset: true` if you would like to test against different languages resources in every creating session. | ||
|
||
Appium installs minimal resources following appbundle feature. For example, if a device environment is English, Appium installs only `en` resource. The installed apk has no Japanese resource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appium only installs the minimum set of resources, following the behavior of the appbundle feature. For example, if a device's language is set to English, Appium will only install the en
resource. The installed apk will have no Japanese language resources.
|
||
Appium installs minimal resources following appbundle feature. For example, if a device environment is English, Appium installs only `en` resource. The installed apk has no Japanese resource. | ||
|
||
Appium decides which resource must install in the installation phase. We should specify `fullReset: true` to force re-installation call. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In order to force re-installation with a different set of language resources, specify fullReset: true
@jlipps Could you take a look again? |
will update later if we have any update for this doc |
…ule (#11601) * add tutorial for app bundle * tweak a description * remove redundant lines * apply grateful reviews
Proposed changes
We can run test a
.apks
file which is generated by Android App Bundle feature after appium/appium-base-driver#271I'd leave a hint to run
.apks
.Types of changes
What types of changes does your code introduce to Appium?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did and what alternatives you considered, etc...