I have already finish most of the code of the robotium testing which is running on the android studio. I am just wondering which is the most effective way to make a release? To make a jar(how to do that)? Or make a interface? Because the QA team do not want to code so I have to make a platform which well organize without any code.
You always may launch your tests from the command line with adb
adb shell am instrument -w yourproject.com/android.test.InstrumentationTestRunner
However I would recommend you take a look on the Spoon project that may help with the test instrumentation and distribution.
Related
On the Play Store and on Firebase Test Lab I can run automated tests without writing any scripts, they just go through the app and try stuff for a few minutes.
How can I run this kind of test either from the command line or from Android Studio? I have about 10 different phones I would like to run it on.
Thanks.
Edit: just to be clear, I'm asking about the automatic robot test, where I don't tell it anything, it just tries stuff.
There are 2 options :
You can record Robo tests through Android Studio. Crawler is part of Jetpack
https://developer.android.com/training/testing/crawler
You can run Monkey tests through command line. Monkey is part
https://developer.android.com/studio/test/monkey
I tried to look around about how to launch an automated test in multiple devices, but I couldn't really find what I was looking for.
I have like 5 tests per class and I want to execute just one test in all my connected devices, like a End to End test to login.
I tried to use connected device but it doesn't launch only the test I want...
I'm using Espresso, UIAutomator, Gradle and AndroidStudio.
How can I run that single test in my devices using these tools?
Use gradle connectedCheck command
You can find an example app here from google
https://github.com/googlesamples/android-testing-templates/tree/master/AndroidTestingBlueprint
There you can also read how to run the example tests on multiple devices from the command line / terminal, or from within Android Studio
You can also take a look at Spoon if you want to use an external tool plugin:
https://github.com/square/spoon
good luck
I'm currently using ARC to manually test my app, but am hoping to move towards automation of the testing process.
Is it possible to use ARC to automate tests, something similar to what Selenium Webdriver does for FF/Chrome?
I know it's still early in the development process but something like this would be incredibly helpful.
Yes. ARC supports the Android adb "shell instrument" command, per the Android documentation
See the Getting Started document for starting adb.
If you create an .apk for the tests that is separate from the .apk being tested, you will need to bundle both .apk files together in the .crx package. It should be straightforward to incorporate doing that and launching the tests into any build/test environment.
I am doing a little research on how to setup Continuos delivery pipeline for Android apps. I am aware of existing approaches of using Jenkins and Ant scripts for making a build. What I'd really like to do is when I do a git push on say a development branch, I'd like Jenkins to do a build on bunch of emulators (With different resolutions) run my Robotium scripts and email me results.
I am looking for end-to-end setup preferably the server would run on Ubuntu.
Siddharth,
You may want to consider CloudMunch for this need. All you need to do is launch the emulators as part your pipeline to test various stacks and finally get an update over mail. Robotium scripts can be called over shell and reports will come to you as mail at the end of the test.
I have seen several post regarding making a build in Jenkins fail if the unit test execution fail (e.g. this one). It turns out that by default Jenkins reports builds with failing tests as unstable and some people do not like that. This, however, will be perfectly fine for me. I just want to be able to easily differentiate builds with passing tests from such with failing tests.
And here is the catch: I am developing for Android so my build is configured following this page. Basically the tests are run with the following command:
ant all clean emma debug install test
As result coverage report is generated and published in Jenkins.
All posts I have read about configuring the Jenkins result according to tests results
were dealing with ant task manipulation. However, if we look at the android build.xml the Android tests are run with adb command: adb shell am instrument .... I don't know how to configure this command to print the tests results. It can be configured to print the coverage report. I have already done that, but was never able to make the build fail according to the coverage report.
I hope somebody else also faced the same problem and managed to solve it. Any guidance will be most appreciated.
Consider using 'the-missing-android-xml-junit-test-runner' - the idea being to produce jUnit reports that Jenkins understands. Disclaimer: I do have no personal experience with adb. However, I do know from experience that Jenkins deals with properly generated jUnit reports very gracefully.
This is possible, configure the server using the following documentation:
https://wiki.jenkins-ci.org/display/JENKINS/Android+Emulator+Plugin
See "Parsing monkey output" in the link.
Addition, Jenkins can test instrumentation, below have a link of a good place to start in the learning of instrumentation:
http://developer.android.com/resources/tutorials/testing/helloandroid_test.html
I hope it is useful.