How can we have another apps installed in devices that is used in testing process( robotests , ...) , before starting testing our app?
I mean my app needs some other apps to be installed in the device to work completely and correctly .
Is it possible?
i'm using firebase test lab
You cannot upload additional APKs via the Firebase web console, but you can interact with Test Lab by using the gcloud command-line app too.
The "beta" version of the gcloud command-line has an option to add additional APKs. If you run
gcloud beta firebase test android run --help
You will find the following option that allows you to install more apks:
--additional-apks=APK,[APK,...]
A list of up to 100 additional APKs to install, in addition to those
being directly tested. The path may be in the local filesystem or in
Google Cloud Storage using gs:// notation.
Here's an example on how you would use this to start a test:
gcloud beta firebase test android run \
--app=build/outputs/apk/debug/app-debug.apk \
--test=build/outputs/apk/androidTest/debug/app-debug-androidTest.apk \
--device model=walleye,version=28 \
--additional-apks=path/to/another.apk
Related
I working on developing Android Instrumentation Tests written in Espresso. As part of the effort, I am uploading and running in Firebase Test Lab using the Firebase Console. It would save me a lot of time if I didn't have to upload the App APK every time I want to re-run a test.
Does anybody know if Firebase Test Lab stores uploaded App and Test APKs so that a test can be re-run without requiring APKs to be uploaded again? Or an option in the Firebase Test Lab console to access an App APK that was previously uploaded?
I tried to use Firebase Storage but I can't access the files from Test Lab.
Maybe using Cloud SDK command line interface it best option since the test run will be automatically initiated once the APKs load?
Files (and APKs) that you pass to gcloud firebase test android run can be both from the local file system, as well as files stored in Google Cloud Storage. E.g. see the official documentation for the --app argument.
If you don't want to pass these files for every test invocation, upload them first to GCS with gsutil:
gsutil cp myapp.apk gs://my-bucket/myapp.apk
Then, use them for every test run:
gcloud firebase test android run --app gs://my-bucket/myapp.apk
I'm interested in running some UIAutomator tests in the Firebase Test Lab: One of our tests we want to do involves functionality in 2 different apps.
So our process locally is:
Install app A
Install app B
Install the intrumentation apk
Run the instruentation step.
However, with the gcloud commands, it looks like we can only upload 1 app apk and 1 test apk.
Is there a way to do multiple apk testing in the Test Lab?
Installing additional APKs is supported in gcloud beta:
gcloud beta firebase test android run \
--app=path/to/app1.apk \
--test=path/to/test.apk \
--additional-apks=path/to/app2.apk,path/to/app3.apk \
...other options here...
You might need to install the beta component with gcloud components install beta or the package manager of your OS distribution.
I am using Firebase test labs along with Jenkins to run a Robo test after each build of my Android app. Currently I use a Yaml file to setup all the configurations I need. I supply a username and password using the Robo Directives. However, I now want to supply a Robo Script that controls the sign in process a little bit more than just supplying the login details. I have made the script in Android studio, but I don't see anywhere in the documentation that allows me to supply the location of the Robo Script from the Yaml file or command line, does anyone know if this is possible?
I have tried the documentation and various links from here - https://firebase.google.com/docs/test-lab/command-line
This feature is available today in beta, but not as a full release. You can use the --robo-script flag to specify a script to upload when using
gcloud beta firebase test android run
It is not available in the release version:
gcloud firebase test android run
After some time in beta, new features will be promoted to full release. See the CLI docs for the beta version here.
I know this is an old question but I was looking for the same thing and I find it :
https://cloud.google.com/sdk/gcloud/reference/beta/firebase/test/android/run#--robo-script
Using like this
gcloud firebase test android run --app app-release.apk --robo-script script.json
When setting up my buildserver to use Firebase Test Lab for espresso testing I keep running into the error.
ERROR: (gcloud.beta.test.android.run) Permission denied while fetching the default results bucket
(Error 403: Access Not Configured. Cloud Tool Results API has not been used in project CLOUD_PROJECT_ID before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/toolresults/overview?project=CLOUD_PROJECT_ID then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.).
Is billing enabled for project: [PROJECT_ID]?
When I try it on my own machine which is logged in via my own account, running the command below works correctly.
gcloud beta test android run \
--type instrumentation \
--app app-debug.apk \
--test app-debug-androidTest.apk \
--device-ids Nexus4,Nexus5 \
--os-version-ids 18,21,25 \
--locales en \
--orientations portrait
On my build server I want to use a service-account but when I execute the command I get the error mentioned earlier. Does anyone know what the correct way is to set this up? Does the service-account need some special role beside project editor?
In the build script I execute the commands below to authenticate and set the project before uploading the APK's
gcloud config set project PROJECT_ID
gcloud auth activate-service-account service-account#email.address --key-file ~/gcloud-service-key.json
Finally figured it out. If you want to use service accounts for Firebase Test Lab you have to enable Cloud Tool Results API which can only be enabled through Google Cloud Console and not the Firebase Console.
Also, you're probably using it from a CI/CD server and using Service Accounts for authentication... Don't do as I did, don't use a google cloud platform service account. Instead, use a Firebase Service Accounts json key from here
https://console.firebase.google.com/u/0/project/YOUR_PROJECT_ID/settings/serviceaccounts/
I am looking at ways to automate Android build deployment for Beta/QA Testers via Jenkins. Are there any solutions out there that will allow me to deploy my android apk via jenkins to a test harness of some sort, from where my QA and beta testers could download and install the application ?
Everything almost work out of the box for Android on Jenkins now. You can :
use the Android Emulator Plugin and perform your tests using ant debug test
get emma coverage and reporting (you must export the emma reports as artefacts) using ant emma installd test
you can even get your unit test reports inside jenkins (export the reports as artefacts as well) using a special test runner : either the missing Android Test Runner or Zutubi test runner.
you can get lint analysis and results thanks to the Lint Plugin for Jenkins as well.
Everything that can be done with ant will also work with maven for more industrial configurations.
We are actually working on a better integration of other testing technologies and a better intregration with Sonar, this topic should get some progress during 2013.
For distributing your APK to beta testers, you can try services like HockeyApp or Google Play alpha/beta distribution, both of which have Jenkins plugins to upload your builds.
By using those services and their SDKs in your app, you automatically get usage statistics and crash reports from your testers.