2.Installing Visual Studio for Mac

From the dock, select “Downloads” and then select “VisualStudioforMacPreviewInstaller.dmg”

Double-click”Install Visual Studio for Mac Preview”

Select “Open”

Select “I accept the License Terms and the Privacy Statement” and then select “Accept”

Select “Continue”

Select “Continue”

Select “Install”

Select “I agree to the license terms” and then select “Continue”

(If prompted) Enter your credentials and then select “OK”

You may be prompted multiple times throughout the installation

Select “Continue”

Select “Quit”

Close the installer launcher

You can now eject and delete the .dmg

3.Installing XCode

Open the App Store

Search for XCode

Select “Get”

Select “INSTALL APP”

Select “OPEN”

Select “Agree”

(If prompted) Enter your credentials

Select “Xcode” → “Open Developer Tool” → “Simulator”

Tip: Change the scaling to 50%

Select “Window” → “Scale” → “50%”

Right-click on the Simulator icon in the dock and then select “Options” → “Keep in Dock”

Close all windows/applications

4.Creating the Framework

The framework will contain the code that is common to all of our test projects. In this way we limit the amount of copy+paste and redundancy.

Open Visual Studio

Select “New Project…”

Select “Tests” from the template pane

Select “UI Test App” and then “Next”

Enter AutomationFramework for both the Project and Solution name and then select “Create”

Select “Project” → “Update NuGet Packages”

Expand the Project in the Solution Explorer, right-click on Tests.cs, and then select “Remove”

In the prompt, select “Delete”

4.1.Creating a Base Class for Tests

In this framework, we will create a class that our tests will inherit from. Inheritance will allow all of out test classes to share some base functionality or properties without a lot of copy paste. Its purpose in this framework is to define the [Setup] for every test in a [TestFixture].

4.2.Creating an App Wrapper

In the Solution Explorer, right-click on the “AutomationFramework” project and then select “Add” → “New File…”

Select “General” → “Empty Class”

Name the class App and then select “New”

Delete the App() method in the App class

In the class, paste in the following code

Right-click the text “IApp” and then select “Quick Fix”

Select “using Xamarin.UITest;”

Right-click on the text “FileInfo” and then select “Quick Fix”

Select “using System.IO;”

4.3.Creating a Native Element Wrapper

In the Solution Explorer, right-click on the “AutomationFramework” project and then select “Add” → Add File…”

Select “General” → “Empty Class”

Name the class AppControl and then select “New”

Delete the AppControl() method in the AppControl class

In the class, paste the following code:

Right-click the text “AppQuery” and then select “Quick Fix”

Select “using Xamarin.UITest.Queries”

Right-click on the text “StringBuilder” and then select “Quick Fix”

Select “using System.Text;”

4.4.Creating a WebView Element Wrapper

In the Solution Explorer, right-click on the “AutomationFramework” project and then select “Add” → “Add File…”

Select “General” → “Empty Class”

Name the class AppWebControl and the select “New”

Remove the AppWebControl() method from the AppWebControl class

In the class, paste the following code:

Fix the missing using directives:

AppQuery/AppWebQuery – using Xamarin.UITest.Queries;

StringBuilder – using System.Text;

Save and close all tabs

5.Creating a Test Suite

A Test Suite is a collection of tests cases intended to test an application. In our paradigm, we will create a new Visual Studio solution that references the AutomationFramework. This allows us to test multiple web applications using the same framework. The Test Suite will contain the tests and necessary page object models (POMs).

Select “File” → “New Solution”

Select “iOS” → “Tests” → “UI Test App” and then select “Next”

Enter “TimothyCopeIos” for the Project and Solution name and then select “Create”

Right-click on Tests.cs and select “Remove”

In the prompt, select “Delete”

Update your NuGet pacakages like you did with the AutomationFramework.

5.1.Referencing the Framework

Right-click on the Solution and then select “Add” → “Add Existing Project…”

Navigate to and select the .csproj file for the AutomationFramework and then select “Open”

Right-click on the “References” for the test project and then select “Edit References…”

Select the “Projects” tab

Select the checkbox next to “AutomationFramework” and then select “OK”