- Test tasks management
- Test report generator (junit test report format compatible with Jenkins)
- Test helper tasks
- In
AndroidTestCI/app/XXXTest.gradle
- Seperate each test task as a gradle script
- Maintain test steps in single gradle(setup, teardown and generate report...)
- Generated by ant written in
AndroidTestCI/app/globalTasks.gradle
- xml/html reports are generated in
reports/
on device - html report format in
junit-style/junit-noframes.xsl
- In
AndroidTestCI/app/globalTasks.gradle
,AndroidTestCI/app/taskHelper.gradle
andAndroidTestCI/app/utils.gradle
- downloadTestAppApks, installTestApps, pushTestAppApks...
- getGrantAppPermissionsFromFileTask, getGrantHCFSFileSystemPermTask, getGrantSmartCacheMTPFileSystemPermTask...
- adb shell command
-
oracle java 8:
- To install, please refer to: http://www.wikihow.com/Install-Oracle-Java-on-Ubuntu-Linux
-
adb:
- To install, please refer to: http://www.droidviews.com/setup-adb-usb-drivers-ubuntu-easily/
- 14.04 refer to : http://bernaerts.dyndns.org/linux/74-ubuntu/328-ubuntu-trusty-android-adb-fastboot-qtadb
-
SDK:
- export SDK path as environment variable ANDROID_HOME or call setup_android.sh before run gradle script
-
gradle
-
Others
- C++ libs (may cause gradle build fail when uninstalled these libs)
sudo apt-get install lib32stdc++6 lib32z1
- Need 'su' command by push 'su' into phone(need userdebug boot.img)
- Terminal: Execute the following command to run instrumentation test on device:
cd AndroidTestCI
./gradlew XXXTest -PspecifyDevice=device_serial_num
Execute the following command to run local unit test for test program self(or use android studio):
cd test/api_test/HCFS_API_Test
./gradlew test
-
After you run instrumented test on device, ther should be test reports in
reports/
- reports/junit-noframes.html: merge all tests into html
- reports/TESTS-TestSuites.xml: merge all tests into xml
-
ps : html format in
junit-style/
- test in docker (there is an adb usb connective problem in docker)
- Rewrite with
adb root
-
gradle:
- Execution failed for task ':lintVitalRelease'. > java.lang.NullPointerException (no error message) - local.properties, which should fix this error in the cases where the NDK is not installed
- Cannot run program "/usr/local/android-sdk-linux/build-tools/19.0.3/aapt": error=2, No such file or directory - sudo apt-get install lib32stdc++6 lib32z1
- Incorrect JAVA_HOME setting : - Remove /usr/bin/gradle line 70
-
VirtualBox :
- VM 設定 USB 自動連接感應 : 步驟 : USB 接上測試手機 ->「USB設定」->「USB裝置篩選器」-> 點選右邊「+」按鈕選取該手機 -> 點選右邊「o」按鈕編輯該手機設定 -> 「遠端」值改為「任何」