Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,365,982
Community Members
 
Community Events
168
Community Groups

Android espresso test script

Edited

I am working on an Android project and also implementing CI/CD for the same. I have JUnit and Android Espresso with unitTest and androidTest packages.

I am able to perform unitTest through Bigbucket CI/CD with an example script but how i should perform it? Please suggest.

Using this script step 4 is getting failed

image: androidsdk/android-30
pipelines:
default:
- parallel:
- step:
name: Android Debug Application
caches:
- gradle
script:
- ./gradlew assembleDebug
artifacts:
- app/build/outputs/**
- step:
name: Lint
caches:
- gradle
script:
- ./gradlew lint
artifacts:
- app/build/reports/**
- step:
name: Unit Test
caches:
- gradle
script:
- ./gradlew :app:testProductionDebugUnitTest
artifacts:
- app/build/reports/**
- step:
name: UI Test
caches:
- gradle
script:
- ./gradlew :app:connectedProductionDebugAndroidTest
artifacts:
- app/build/reports/**

 

1 answer

0 votes
Patrik S Atlassian Team Sep 08, 2022

Hello @Niral Bhavsar ,

Thank you for reaching out to Atlassian Community!

Could you please share with us the logs from the step that is failing? 

Also, if you try running the same build locally in your machine, does the same error happens? If you are not sure how to run it locally in a docker container, please refer to the instructions in the following documentation : 

Kind regards,

Patrik S

Here is my Log file it says 

> com.android.builder.testing.api.DeviceException: No connected devices!

 

It is failed for Step 5  - UI Test

Pileline Logs 

Hello @Niral Bhavsar ,

The error you reported was most likely because there was no device started in the android emulator to run your UI tests.

The android emulator needs Hardware acceleration to properly work, and unfortunately, at this moment pipeline environment does not support Hardware acceleration. We already have a feature request to implement this functionality, which you can find in the link below: 

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Thank you, @Niral Bhavsar .

Kind regards,

Patrik 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS

Atlassian Community Events