CI/CD with Mobile UI Automation Testing
Asked by tarek_o:

Hi,

I am starting a new Android Project with Appium UI Automation Testing check after every push. My Appium project uses an APK file to run and is saved on a different repository than the Android Project (Stand-alone).

Question 1: Does anyone have any experiences with saving the newly built APK file after the new changes into another Repo?

Question 2: After saving the new APK file into the Appium Project, how can I run this project through the pipeline to ensure that the new changes haven't affected any previous functionalities/UI tests. This question includes how can I setup an Emulator in the pipeline so that my tests run on.

Thank you for any contribution.


Answers:
author: Mark C
body: Hi [@tarek_o](/t5/user/viewprofilepage/user-id/4488521)

Thank you for reaching out to the community.  

About your question #1, I believe what you can do is to save or upload the built APK file in your repository **Downloads** section via API and retrieve it via API as well.  
You can check out this [documentation for more information](https://support.atlassian.com/bitbucket-cloud/docs/deploy-build-artifacts-to-bitbucket-downloads/).

About your question #2, you can check out [this blog post](https://bitbucket.org/blog/automate-and-scale-your-android-deployment-with-bitbucket-pipelines) with detailed examples on how to set up Android deployment with Bitbucket Pipelines using Gradle.

Hope it helps and let me know how if you have further questions.

Regards,  
Mark C

comments: author: tarek_o
body: Hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823) ,

Thank you for your response. The blog post regarding Bitbucket's CI/CD is really helpful.

I have used similar blog to implement my CI/CD where I save the APK as an Artifact and used it in following steps in my Automation.

Best Regards,

Tarek O


author: Viraj Kanwade
body: Hi Mark C

- updating text to allow submit

Sorry for hijacking the thread.

I have followed the blog post you have referred. But it does not show how to run the AndroidTest.

I tried to run the emulator and I get this error:

+ emulator -avd test -no-window -no-audio  
handleCpuAcceleration: feature check for hvf  
emulator: ERROR: x86_64 emulation currently requires hardware acceleration!  
CPU acceleration status: KVM requires a CPU that supports vmx or svm  
More info on configuring VM acceleration on Linux:  
General information on acceleration .  
I have tried to run the emulator with steps listed on the dockerhub page for android-30 image.

Is there any detail on how to run the UI automation tests?

Posting a message here is so frustrating. First it won't allow me to tag Mark. Then it says I have posted the same thing elsewhere so I cannot post it.


author: tarek_o
body: Hi [@Viraj Kanwade](/t5/user/viewprofilepage/user-id/4582575) ,  
I faced the same issue with the hardware acceleration when I ran some images. Changing the image to a better one worked for me. This issue occurs when the image does not support running emulators. The only image I found helpful with running emulators in docker is : budtmo/docker-android.  

[ref: https://github.com/budtmo/docker-android](https://github.com/budtmo/docker-android)  

Best Regards,


author: papeomar_samb
body: Hi [@tarek_o](/t5/user/viewprofilepage/user-id/4488521) did you manage to set up the execution of an android test with a CI/CD and did you set up an emulator too ? if yes could you provide me the steps to do please ?


Tags: appium

automation

bitbucket-cloud

cloud

continuous-delivery

test