0
votes

My question is about UI testing for Xamarion.iOS and Xamarion.Android.

I have an app for Android and iOS built using Xamarin.Android and Xamarin.iOS with a PCL. These were not made using Xamarin.Forms.
I've been trying to start UI unit testing the apps and I've read over NUnit, NUnitLite, and Xamarin.UITest and looking through guides on how to get the testing started but have been unsuccessful at starting my app's UI.

When I build a project with Xamarin.UITest, the Platform class does not exist and when attempting to do an Android test while pointing the app to the apk file, it wasn't successful.

I have created test projects for NUnit 3 platform-specific testing following this guide: http://www.alteridem.net/2015/12/21/testing-xamarin-projects-using-nunit-3/ I can run the app, get to the page showing the tests passed/failed, but after that, I've been unable to wire up the UI.

I have not found any documentation on how to do UI testing in either Android or iOS. I've been over the MS's docs like on https://docs.microsoft.com/en-us/xamarin/ios/deploy-test/touch.unit?tabs=vswin

Can anyone shed some light on how I can start a simple UI test? Preferably with NUnit 3.

1

1 Answers

1
votes

Apparently, I was looking at this from the wrong point of view. I should be using NUnit for unit testing the code behind on a specific platform (Android/iOS) and using UITest for doing UI automation.

The downside of using UITest is the apparent issue that it needs to run on a Mac instead of on Windows connected to a Mac for iOS UI automation. Android UITest will run fine on a Windows machine. Unless you're doing cloud testing.