All Projects → gojuno → Composer

gojuno / Composer

Licence: apache-2.0
Reactive Android Instrumentation Test Runner. Archived. Marathon is recommended as an alternative (https://github.com/Malinskiy/marathon).

Programming Languages

kotlin
9241 projects

Projects that are alternatives of or similar to Composer

anyaudio-android-app
One Stop Music Application
Stars: ✭ 78 (-86.02%)
Mutual labels:  android-sdk
Rdvideoeditsdk For Android
Android Video Editing SDK; Android Video Edit SDK: Video Cut, Video Join, Video Watermark, Video Subtitle, Video Rotate...
Stars: ✭ 343 (-38.53%)
Mutual labels:  android-sdk
Androidaudit
Your Android app as a crime scene!!!
Stars: ✭ 474 (-15.05%)
Mutual labels:  android-sdk
BlowTorch
A tool for playing text based adventure games that communicate over Telnet. Features include simple alias replacement, triggers, timers, custom speedwalks, xterm256 color support, lua scripting, plugins and miniwindows.
Stars: ✭ 20 (-96.42%)
Mutual labels:  android-sdk
Togetherad
🔥持续更新。Android广告聚合:帮助 Android 开发者快速、便捷、灵活的接入国内多家主流安卓广告 SDK。广点通(优量汇)、穿山甲、百青藤(百度Mob)。开屏广告、Banner横幅广告、插屏广告、激励广告、原生信息流、全屏广告。
Stars: ✭ 305 (-45.34%)
Mutual labels:  android-sdk
Awesome Android Ui
😎 A curated list of awesome Android UI/UX libraries
Stars: ✭ 353 (-36.74%)
Mutual labels:  android-sdk
AndroidDevTools
收集整理Android开发所需的Android SDK、开发中用到的工具、Android开发教程、Android设计规范,免费的设计素材等。
Stars: ✭ 7,284 (+1205.38%)
Mutual labels:  android-sdk
Payandroid
Android端对微信App支付和支付宝App支付的SDK进行二次封装,对外提供一个较为简单的接口和支付结果回调
Stars: ✭ 508 (-8.96%)
Mutual labels:  android-sdk
Matomo Sdk Android
SDK for Android to measure your apps with Matomo. Works on Android phones, tablets, Fire TV sticks, and more!
Stars: ✭ 309 (-44.62%)
Mutual labels:  android-sdk
Yasea
RTMP live streaming client for Android
Stars: ✭ 4,557 (+716.67%)
Mutual labels:  android-sdk
AdaptivePlus-Android
Free forever Marketing SDK with a dashboard for in-app SplashScreen banners with built-in analytics
Stars: ✭ 16 (-97.13%)
Mutual labels:  android-sdk
Kotlin Android Boilerplate
Kotlin Android boilerplate project with MVVM architecture using RxJava, Dagger 2, and more!
Stars: ✭ 278 (-50.18%)
Mutual labels:  android-sdk
Edittext Mask
The custom masks for EditText. The solution for input phone numbers, SSN, and so on for Android
Stars: ✭ 413 (-25.99%)
Mutual labels:  android-sdk
android-jetpack
🚀 Road to Accelerate Android Development using Jetpack
Stars: ✭ 50 (-91.04%)
Mutual labels:  android-sdk
Android Blogs
Blogs about Android
Stars: ✭ 490 (-12.19%)
Mutual labels:  android-sdk
CustomFontView
Custom View classes for TextView, EditText & Buttons - to set custom fonts
Stars: ✭ 26 (-95.34%)
Mutual labels:  android-sdk
Androidproject
Android 技术中台,但愿人长久,搬砖不再有
Stars: ✭ 4,398 (+688.17%)
Mutual labels:  android-sdk
Android Arsenal.com
Source to android-arsenal.herokuapp.com
Stars: ✭ 541 (-3.05%)
Mutual labels:  android-sdk
Onesignal Android Sdk
OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native Android or Amazon app with OneSignal. https://onesignal.com
Stars: ✭ 503 (-9.86%)
Mutual labels:  android-sdk
Htmlnative
📃Use HTML/CSS to render Android View, Lua to control its logic (Not Webview)
Stars: ✭ 432 (-22.58%)
Mutual labels:  android-sdk

Composer — Reactive Android Instrumentation Test Runner.

Composer is a modern reactive replacement for square/spoon with following feature set:

  • Parallel test execution on multiple emulators/devices with test sharding support.
  • Logcat output capturing per test and for whole test run as well.
  • Screenshots and files pulling for each test reactively (with support for square/spoon folder structure).
  • JUnit4 report generation.

Demo

Table of Contents

Why we've decided to replace square/spoon

Problem 1: Our UI tests are stable, but we saw a lot of UI tests build failures. About ~50% of our CI builds were failing. All such failures of UI tests came from Spoon not being able to run tests on one or more emulators (device is red in the report and error message is …work/emulator-5554/result.json (No such file or directory), basically it timed out on installing the apk on a device, increasing adb timeout did not help, all emulators responded to adb commands and mouse/keyboard interactions, we suppose problem is in in ddmlib used by Spoon.

Solution: Composer does not use ddmlib and talks to emulators/devices by invoking adb binary.

Problem 2: Pretty often when test run finished, Spoon freezed on moving screenshots from one of the emulators/devices. Again, we blame ddmlib used in Spoon for that.

Solution: Composer invokes adb binary to pull files from emulators/devices, we haven't seen problems with that in more than 700 builds on CI.

Problem 3: Spoon pulled screenshots/files after finish of the whole test run on a device which slows down builds: test_run_time + pull_files_time.

Solution: Composer pulls screenshots/files reactively after each test which basically leads to: ~test_run_time.

Problem 4: If test sharding is enabled (which we do all the time), Spoon HTML report is very hard to look at, especially if you want to find some particular test(s) and it's not failed. You have to either hover mouse over each test to find out its name or go into html/xml source and find on which emulator/device test was sharded in order to click on correct device and then find test by CMD+F on the page.

Solution: HTML report we've built designed with usability and performance in mind.

Problem 5: Html report can be very slow to load if you have lots of screenshots (which we do) since it displays all the screenshots of tests that were run on a particular device on a single page — it can take up to minutes to finish while you effectively unable to scroll page since scroll is jumping up and down each time new screenshot loaded.

Solution: HTML report that we've built does not display screenshots on index and suite pages, screenshots are displayed only on the test page → fast page load.

With Composer we were able to make UI tests required part of CI for Pull Requests. It's fast, reliable and uses RxJava which means that it's relatively easy to add more features combining complex async transformations.

HTML Report

Our Frontend Team helped us build HTML Report for the Composer.

It's fast, small and designed in collaboration with our QAs and Developers who actually use it on daily basis to make it easy to use.

Here are few screenshots:

Suite Page Test PageTest Page

Usage

Composer shipped as jar, to run it you need JVM 1.8+: java -jar composer-latest-version.jar options.

Supported options

Required
  • --apk
    • Either relative or absolute path to application apk that needs to be tested.
    • Example: --apk myapp.apk
  • --test-apk
    • Either relative or absolute path to apk with tests.
    • Example: --test-apk myapp-androidTest.apk
Optional
  • --help, -help, help, -h
    • Print help and exit.
  • --test-runner
    • Fully qualified name of test runner class you're using.
    • Default: automatically parsed from --test-apk's AndroidManifest.
    • Example: --test-runner com.example.TestRunner
  • --shard
    • Either true or false to enable/disable test sharding which statically shards tests between available devices/emulators.
    • Default: true.
    • Example: --shard false
  • --output-directory
    • Either relative or absolute path to directory for output: reports, files from devices and so on.
    • Default: composer-output in current working directory.
    • Example: --output-directory artifacts/composer-output
  • --instrumentation-arguments
    • Key-value pairs to pass to Instrumentation Runner.
    • Default: empty.
    • Example: --instrumentation-arguments myKey1 myValue1 myKey2 myValue2.
  • --verbose-output
    • Either true or false to enable/disable verbose output for Composer.
    • Default: false.
    • Example: --verbose-output true
  • --keep-output-on-exit
    • Either true or false to keep/clean temporary output files used by Composer on exit.
    • Default: false.
    • Composer uses files to pipe output of external commands like adb, keeping them might be useful for debugging issues.
    • Example: --keep-output-on-exit true
  • --devices
    • Connected devices/emulators that will be used to run tests against.
    • Default: empty, tests will run on all connected devices/emulators.
    • Specifying both --devices and --device-pattern will result in an error.
    • Example: --devices emulator-5554 emulator-5556
  • --device-pattern
    • Connected devices/emulators that will be used to run tests against.
    • Default: empty, tests will run on all connected devices/emulators.
    • Specifying both --device-pattern and --devices will result in an error.
    • Example: --device-pattern "emulator.+"
  • --install-timeout
    • APK installation timeout in seconds.
    • Default: 120 seconds (2 minutes).
    • Applicable to both test APK and APK under test.
    • Example: --install-timeout 20
  • --fail-if-no-tests
    • Either true or false to enable/disable error on empty test suite.
    • Default: true.
    • False may be applicable when you run tests conditionally(via annotation/package filters) and empty suite is a valid outcome.
    • Example: --fail-if-no-tests false
  • --with-orchestrator
  • --extra-apks
    • Apks to be installed for utilities. What you would typically declare in gradle as androidTestUtil
    • Default: empty, only apk and test apk would be installed.
    • Works great with Orchestrator to install orchestrator & test services APKs.
    • Example: --extra-apks path/to/apk/first.apk path/to/apk/second.apk
Example

Simplest :

java -jar composer-latest-version.jar \
--apk app/build/outputs/apk/example-debug.apk \
--test-apk app/build/outputs/apk/example-debug-androidTest.apk

With arguments :

java -jar composer-latest-version.jar \
--apk app/build/outputs/apk/example-debug.apk \
--test-apk app/build/outputs/apk/example-debug-androidTest.apk \
--test-runner com.example.test.ExampleTestRunner \
--output-directory artifacts/composer-output \
--instrumentation-arguments key1 value1 key2 value2 \
--verbose-output false \
--keep-output-on-exit false \
--with-orchestrator false

Download

Composer is available on jcenter.

You can download it in your CI scripts or store it in your version control system (not recommended).

COMPOSER_VERSION=some-version
curl --fail --location https://jcenter.bintray.com/com/gojuno/composer/composer/${COMPOSER_VERSION}/composer-${COMPOSER_VERSION}.jar --output /tmp/composer.jar

All the releases and changelogs can be found on Releases Page.

3rd-party Composer Gradle Plugin

@trevjonez built 🎉 Gradle Plugin for Composer which allows you to configure and run Composer with Gradle.

Swarmer

Composer works great in combination with Swarmer — another tool we've built at Juno.

Swarmer can create and start multiple emulators in parallel. In our CI Pipeline we start emulators with Swarmer and then Composer runs tests on them.

How to build

All-in-one script (used in Travis build)

Dependencies: docker and bash.

ci/build.sh

Build Composer

Environment variable ANDROID_HOME must be set.

./gradlew build

Build HTML report module

Dependencies: npm and nodejs.

cd html-report
npm install
npm build

License

Copyright 2017 Juno, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].