You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: it-android/README.md
+30-9Lines changed: 30 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,22 @@
1
1
# Android integration tests
2
2
3
3
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
5
13
6
14
## Restrictions
7
15
8
16
### Rhino runtime
9
-
-
10
17
11
18
- minSdk is 26 (see #1785 for background)
12
-
- runs only in intermreted mode
19
+
- runs only in interpreted mode
13
20
- not all features may be available (JavaAdapter, ...)
14
21
15
22
### Emulator
@@ -27,30 +34,44 @@ These are simple javascript tests.
27
34
28
35
### Running tests on github
29
36
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.
31
38
32
39
### Running tests locally
33
40
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
35
44
36
45
- Either install Android-Studio with SDK https://developer.android.com/about/versions/14/setup-sdk
37
46
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`
40
49
41
50
This will install the SDK in `<RHINO_ROOT>/android-sdk` and register it in the `local.properties` for this gradle
42
51
build only. (This is the best option, if you do not want to mess up your system)
43
52
44
53
<b>Note:</b> The script will automatically accept all license terms!
45
54
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.
48
58
49
59
This will download an emulator based on https://github.com/budtmo/docker-android and you can access the emulated phone
50
60
on http://localhost:6080
51
61
52
62
<b>Note:</b> The emulator will not terminate automatically. You will need to remove it from your docker/podman manually
53
63
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
+
54
75
### Debugging and troubleshooting
55
76
56
77
-`./gradlew it-android:connectedAndroidTest` will try to run the tests automatically on the connected android device
0 commit comments