Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Android espresso test script

Niral Bhavsar September 7, 2022

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
Atlassian Team members are employees working across the company in a wide variety of roles.
September 8, 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

Niral Bhavsar September 9, 2022

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 

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 13, 2022

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
AUG Leaders

Atlassian Community Events