Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 5

Run Xamarin UI Tests for iOS and Android under Github Actions

Solved! Go to Solution.

I have written a mobile application using Xamarin Forms under Visual Studio 2019, this targets both Android and iOS.

 

As part of my development I have written some Xamarin.UITest based End to End tests using Specflow and NUnit.

 

I am now trying to get these to run as part of my CI workflow and I am having a bit of difficulty.

 

Mainly this is around the area of actually getting the Android and iOS emulators to fire up so the tests can be executed.

 

Is there something that I can add to my workflow that will start up the Android Emulator with a specified andoid version that my tests can be run against and then anotehr command to close down the emulator after my tests have finished running.

 

So far I have been running the whole workflow on a Windows OS as the code is Net Framework.

 

Ideally some way of running iOS based tests in a CI workflow would be helpful.

 

Regards,

 

Stuart

4 Replies
Highlighted
Solution
GitHub Partner
Message 2 of 5

Re: Run Xamarin UI Tests for iOS and Android under Github Actions

Hi @StuartFerguson ,

 

Is it resolved by action ‘malinskiy/action-android/emulator-run-cmd’ for your Xamarin UI test on macOS? To kill the emulator and finish the action, you can also try similar action ‘ReactiveCircus/android-emulator-runner’. Thanks.

Highlighted
Copilot Lvl 3
Message 3 of 5

Re: Run Xamarin UI Tests for iOS and Android under Github Actions

Hi @weide-zhou

 

Thanks for the reply.

 

I managed to get it working with the malinskiy/action-android/emulator-run-cmd action.

 

Regards,

 

Stuart

Highlighted
Copilot Lvl 3
Message 4 of 5

Re: Run Xamarin UI Tests for iOS and Android under Github Actions

@weide-zhou  another question on the above.

 

As part of my UI tests for Android and iOS I need to spin up a docker container and then communicate with that from my mobile application.

 

As part of the test background, I am posting data to the docker container from the hosting machine.  This scenario works fine on my windows development environment, however when running on the macos Github Agent these setup POST's are getting as connection refused from the docker container address:port.

 

Are you able to offer any advice on how I can get this working?

 

The workflow I am using is

https://github.com/StuartFerguson/MobileApplication/blob/master/.github/workflows/pullrequest.yml 

Highlighted
GitHub Partner
Message 5 of 5

Re: Run Xamarin UI Tests for iOS and Android under Github Actions

Hi @StuartFerguson ,

 

Much appreciate your mark!

Regarding the new problem, I didn't find the exact error but i notice the workflow passed on branch 'task/#3_loginscreen', is the problem resolved?

 

Thanks.