Hi I am surya teja, I have presented in QA babble meetup. The main intension of this presentation is to explain how we can automate a native android app using Android espresso and run the tests on multiple devices using Spoon.
2. CURRENT FRAMEWORKS
Firstly we use Appium for automating a mobile app. It has compatibility to run tests
for both android and iOS devices.
Using
• Java
• JavaScript
• Python
• Ruby
• C#
4. DRAWBACKS
• Written outside the source code.
• Cannot able to handle the recycler views.
• To run on multiple devices and to generate reports when ran locally.
5. SOLUTION
SPOON:
It is a plugin to run the tests across the multiple devices and it also regenerate
reports. It is mainly used to do instrumentation testing using physical devices or
emulators, by running tests simultaneously or sequentially.
6. COMPATIBILITY
• It can be used to run test with Jenkins (CI)
• It can also be used along with Emma ( plugin to used to give the test coverage
report)
• To run as suits or a singleton test
8. EXECUTION
• Options:
• --apk Application APK
• --output Output path
• --sdk Path to Android SDK
• --test-apk Test application APK
• --title Execution title
• --class-name Test class name to run (fully-qualified)
• --method-name Test method name to run (must also use --class-name)
• --no-animations Disable animated gif generation
• --size Only run test methods annotated by testSize (small, medium, large)
• --adb-timeout Set maximum execution time per test in seconds (10min default)
• --fail-on-failure Non-zero exit code on failure
• --coverage Code coverage flag. For Spoon to calculate coverage file your app must have the `WRITE_EXTERNAL_STORAGE` permission.
• (This option pulls the coverage file from all devices and merge them into a single file `merged-coverage.ec`.)
• --fail-if-no-device-connected Fail if no device is connected
• --sequential Execute the tests device by device
• --init-script Path to a script that you want to run before each device
• --grant-all Grant all runtime permissions during installation on Marshmallow and above devices
• --e Arguments to pass to the Instrumentation Runner. This can be used
multiple times for multiple entries. Usage: --e <NAME>=<VALUE>.
The supported arguments varies depending on which test runner
you are using, e.g. see the API docs for AndroidJUnitRunner.
12. DRAWBACKS
• It can only be used for doing android automation testing.
• It cant be used for iOS.
• Tests are written inside the source code, hence there could be a possibility for the
increase of method count more that 64000