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

Add an explanation about running tests against Android App Bundle module #11601

Merged
merged 4 commits into from
Nov 8, 2018

Conversation

KazuCocoa
Copy link
Member

Proposed changes

We can run test a .apks file which is generated by Android App Bundle feature after appium/appium-base-driver#271
I'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 apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

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.

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

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...

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.
Copy link
Collaborator

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

Copy link
Member

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
Copy link
Collaborator

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`
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

since version 3.2

Copy link
Member

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

Copy link
Member

@jlipps jlipps left a 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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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`
Copy link
Member

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.
Copy link
Member

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
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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.
Copy link
Member

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

@KazuCocoa
Copy link
Member Author

@jlipps Could you take a look again?
Would like to include this into the next release (and set a link to this doc in the changelog)

@KazuCocoa KazuCocoa mentioned this pull request Nov 8, 2018
@KazuCocoa
Copy link
Member Author

will update later if we have any update for this doc

@KazuCocoa KazuCocoa merged commit 48a2958 into appium:master Nov 8, 2018
@KazuCocoa KazuCocoa deleted the add-explanation-of-appbundle branch November 8, 2018 23:57
imurchie pushed a commit that referenced this pull request Nov 19, 2018
…ule (#11601)

* add tutorial for app bundle

* tweak a description

* remove redundant lines

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

Successfully merging this pull request may close these issues.

None yet

3 participants