Skip to content

Commit 506afd9

Browse files
committed
Improve the README a bit
1 parent fd2e199 commit 506afd9

1 file changed

Lines changed: 30 additions & 9 deletions

File tree

it-android/README.md

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
# Android integration tests
22

33
Rhino runs with some restrictions on android platform. This project builds a very minimalistic app/testframework to run
4-
android tests either in an emulator or directly on your phone
4+
android tests either in an emulator or directly on your phone.
5+
6+
The goal of these tests is to catch over time the kinds of incompatibilities that
7+
arise when we use APIs that are not supported on every Android SDK version.
8+
9+
Android developers who want to ensure that specific cases work are encouraged to
10+
add new tests to the test case directory:
11+
12+
./it-android/src/main/assets/tests
513

614
## Restrictions
715

816
### Rhino runtime
9-
-
1017

1118
- minSdk is 26 (see #1785 for background)
12-
- runs only in intermreted mode
19+
- runs only in interpreted mode
1320
- not all features may be available (JavaAdapter, ...)
1421

1522
### Emulator
@@ -27,30 +34,44 @@ These are simple javascript tests.
2734

2835
### Running tests on github
2936

30-
This is done automatically on each PR (maybe changed as manual action, if it consumes too much resources)
37+
This is done automatically on each PR.
3138

3239
### Running tests locally
3340

34-
You need an Android SDK installed
41+
#### Setting up the SDK
42+
43+
You need an Android SDK installed in order for the tests to run
3544

3645
- Either install Android-Studio with SDK https://developer.android.com/about/versions/14/setup-sdk
3746

38-
make sure that your `ANDROID_HOME` enviroment is set up properly
39-
- Or use the provided script in `<RHINO_ROOT>/install-android-sdk`
47+
- make sure that your `ANDROID_HOME` enviroment is set up properly
48+
- Or, use the provided script in `<RHINO_ROOT>/install-android-sdk`
4049

4150
This will install the SDK in `<RHINO_ROOT>/android-sdk` and register it in the `local.properties` for this gradle
4251
build only. (This is the best option, if you do not want to mess up your system)
4352

4453
<b>Note:</b> The script will automatically accept all license terms!
4554

46-
Use `<RHINO_ROOT>/run-android-tests-locally.sh` to start an emulator in docker/podman, run the tests and install the
47-
APK.
55+
#### Starting an Emulator: Option 1
56+
57+
On some environments, you can use `<RHINO_ROOT>/run-android-tests-locally.sh` to start an emulator in docker/podman, run the tests and install the APK. This test may not work in every case, but is an option on Linux for sure.
4858

4959
This will download an emulator based on https://github.com/budtmo/docker-android and you can access the emulated phone
5060
on http://localhost:6080
5161

5262
<b>Note:</b> The emulator will not terminate automatically. You will need to remove it from your docker/podman manually
5363

64+
#### Starting the Emulator: Option 2
65+
66+
Once the SDK is installed, you can download Android Studio and use the "Device Manager" in the UI to
67+
start an emulator.
68+
69+
Once you have started the emulator, if you run:
70+
71+
./gradlew :it-android:connectedAndroidTest
72+
73+
it will connect to the emulator, install the test app, and run the tests.
74+
5475
### Debugging and troubleshooting
5576

5677
- `./gradlew it-android:connectedAndroidTest` will try to run the tests automatically on the connected android device

0 commit comments

Comments
 (0)