Running functional tests on firebase - android

I will want to run a functional tests on firebase on various devices. Does firebase support functional testing in android?
Their testlab has three types of tests:
Robo test
Instrumentation test
Gameloop
Robo test is ruled out as it is just a stress test and a load test like a money runner
When it comes to instrumentation test, first thing I want to be clear on whether it is a functional test written in expresso, UIautomator and ranorex?
If yes, I see that I have to upload two .apk's in there, one is AppApk and TestApk. I would like to know if AppApk is the application under test and TestApk is the apk that is created to test the application?
If yes, I found uiautomator tests are bundled inside the src folder and is a java file. I also found that, there is a python wrapper for uiautomator that can be coded to write tests for android.
Now there is kivy.org to bundle python file into an .apk since android studio does not support python.
Now, How do i run Android uiautomator tests in python? Is there a way, to run python scripts inside the android studio?
And How to run functional tests in firebase? Do they support?

Related

Android: configuring CICD pipeline to support/ run Integration or UI Tests on Bitrise

I am working on an Android project. I am trying to build a CICD pipeline for my application on the Bitrise. I am following an example on the Bitrise official page, https://devcenter.bitrise.io/testing/device-testing-for-android/. So I added Android Build and [Beta] Virtual Device Testing steps into the workflow in my Bitrise Dashboard.
But when I build the app, it is only running the tests within the app/src/test folder. I have also written UI Tests using the Expresso framework in the app/src/androidTest folder. But the ones in the app/src/androidTest are not run. What changes do I have to make in order to run those tests?
There are three types of Android tests that can be run with the Virtual Device Testing step:
Robo, the testing monkey that can be configured for end-to-end testing.
Game Loop, which I suppose you would use if your app was a game.
Instrumentation, this will run tests written in androidTest/
In order to run instrumentation tests you will need to build both an app.apk and appTest.apk, conveniently Bitrise has a step called Android Build for UI Testing
Make sure to change the Test type input variable.

How can I run an automatic robo test on Android app? like the one on Firebase Test Lab

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

What is the best location to store Appium tests? Same Android repo? separated automation repository?

I am developing an automation framework using Appium and Webdriver. I have a bunch of classes for the framework and JUnit tests. Everything is working in a separated repository in which the appium server is initialized, the tests run and then the server is terminated.
My question is if I should move those tests into the Android app repo, in order for the developers to have a more confortable access to them and run the tests against a dev or debug apk.
Some questions:
1) Should these appium tests be located on the test folder (unit tests) or androidTest (instrumented tests)?
2) How is the best way to execute test tasks in gradle in order to generate an apk (with different flavors/environments), install it in a phone or emulator and run the tests?
I haven't found a lot of examples answering these questions in the web.
Thanks!

Unit test for AOSP code?

Are unit test cases provided for any app in AOSP(Android Open Source Project)in android? Suppose take Gallery App, which is a system app. If I download the AOSP, Is complete test suite available for Gallery App. I meant to say both unit tests and Instrumentation test suites?
From my experience in working with AOSP, there is a python script called runtest.py in platform development/testrunner/runtest.py to run every available unit tests on each module in AOSP. It is a good starting point to look for what you want, but beware some unit tests are outdated and obsoleted.
You can add tests and then be include into runtest.py to form a test suite. runtest.py will help you compile, deploy then run the unit test suite on the target device.

Using Appium and Espresso together a bad idea?

I'm a fanboy of Test-pyramid application in software development and want the same to be applied in Mobile software development as well.
For this, I'm desiring to leverage both Appium (for functional tests) and Espresso (for Integration Tests), and have the following questions:
The structure of my tests in Android Studio with Gradle has only 2 folders: app/src/test and app/src/androidTest.
The former test is meant for writing Unit tests with JUnit. The later for functional tests; and I'm using espresso tests for integration-testing making use of the latter directory.
I know I can create a separate project for Appium and write functional tests. But prefer to have those as part of the project in separate test source directory, so that it can be run at different intervals in my CI pipeline. How do I go about doing this? Is it possible to create another source test directory like app/src/functionalTest? Pointers to sample projects in github or resources is well appreciated.

Categories

Resources