Running UITests within the Visual Studio for Mac IDE

In this section, we will take a look at how to run our Xamarin.UITests using the Visual Studio for Mac IDE. Prior to running your TrackMyWalks.UnitTests project, you will need to add your iOS and Android projects to the Test Apps node of the Unit Tests pane. If you don't do this, your Xamarin.UITests will continually fail until you add these projects to your TrackMyWalks.UITests project.

Let's take a look at how we can achieve this by performing the following steps:

  1. First, ensure that you have chosen the Debug option from the drop-down menu.
  2. Next, select the View|Unit Tests menu option, as shown in the following screenshot:

Running UITests within the Visual Studio for Mac IDE

  1. Then, right-click on the Test Apps node within the Unit Tests pane, and click on the Add App Project menu option, as shown in the following screenshot:

Adding a new App Project to run the UI Tests against
  1. Next, from the Select a project or solution dialog, select each of your projects for the various platforms, as shown in the following screenshot:

Selecting the TrackMyWalks.iOS Project to add to the list of UI Tests
  1. Then, click on the OK button to save your changes and close the dialog.

If you don't see your TrackMyWalks.iOS app project listed within the Select a project or solution dialog, you have have forgotten to add the Xamarin Test Cloud Agent NuGet package to your TrackMyWalks.iOS project.

  1. Finally, right-click on the TrackMyWalks.UITests node, located within the Unit Tests pane, and click on the Run Test menu option, as shown in the following screenshot:

Running the TrackMyWalks UITests within the Visual Studio for Mac IDE

When the TrackMyWalks application starts to run, the Xamarin.UITest framework will automatically deploy your app to the iOS Simulator and run through each of the steps that you have specified within your test methods which have the [Test] attribute. Once each of the tests have been completed, they will appear within the Unit Tests pane.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.66.156