Xamarin UITest To Run On Cloud

Introduction

In the previous articles, we have gone through Xamarin.UITest and writing the test cases based on different scenarios. In the current article, we will set it up to execute on Cloud.

Setup

Install Brew using the below command,

(Refer :https://brew.sh/ ) /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)".

Then run the below command to check brew status whether it's updated or not.

brew update

Then run the below command to make sure your system is ready to brew. 

brew doctor

Install Node Js using the below command,

brew install node

Note
If the node is already installed and we want to uninstall and install it again refer to the below link to delete the node folder from your system.

https://www.positronx.io/how-to-uninstall-node-js-and-npm-from-macos/

After deleting the node folder again try to install the node using the below command,

brew install node

To make sure the node is installed run the below command to know the versions.

node -v
npm -v

Then install “App Center Command Line Interface(CLI)” using the below command.

npm install -g appcenter-cli

To make sure CLI is installed run the below command(Refer screenshot below),

appcenter help

Xamarin UITest to run on Cloud

Once CLI is installed we need to login to the app center and authenticate it with the token.

For logging in entering the following command,

appcenter login

It will ask to enable telemetry or not. Enter Y.

it will open up the app center page on the device browser where we need to log in.

After logging in we will get a success prompt with the Token as shown below screenshot.

Xamarin UITest to run on Cloud

Copy the access code from the browser and enter it as prompted in the command prompt.

Xamarin UITest to run on Cloud

With these steps, we have successfully authenticated to run our script from the command prompt.

Running the script on cloud

Android

Running the complete suite

appcenter test run uitest --app "name of the project created in app center" --devices a0500542 --app-path “path of apk on local”--test-series "master" --locale "en_US" --build-dir “path of test. Cloud exe on local”

Based on Categories

appcenter test run uitest --app "name of the project created in app center" --devices a0500542 --app-path “path of apk on local”--test-series "master" --locale "en_US" --build-dir “path of test. Cloud exe on local” --include-“category name”

Test-series and devices can be extracted as shown below,

  • Login to app center
  • Click on project.
  • Click on Test from the left panel.
  • Click on a new test run on the top right of the screen.
  • Select. Devices press next.
  • Select series and test framework as shown below.

Xamarin UITest to run on Cloud

Click next.

Select the command that appears in the running test section.

Xamarin UITest to run on Cloud

Copy the device and series name from the running test command.

IOS

Running the complete suite

appcenter test run uitest --app "name of the project created in app center" --devices a0500542 --app-path “path of ipa on local”--test-series "master" --locale "en_US" --build-dir “path of test. Cloud exe on local”

Based on Categories

appcenter test run uitest --app "name of the project created in app center" --devices a0500542 --app-path “path of ipa on local”--test-series "master" --locale "en_US" --build-dir “path of test. Cloud exe on local” --include-“category name”

Test-series and devices can be extracted in the same way we have done it for Android.

Pricing

Initially, 30 hours are free for every account.

There are 2 types of plans available.

Standard usage

  • 30 devices hours for execution on 1 device($99/month).
  • For adding parallel execution on more than 1 device we need to pay $99/month per device.

Enterprise usage

  • Unlimited hours for execution on 1 device. ($499/month).
  • For adding parallel execution on more than 1 device we need to pay $499/month per device.

Summary

With this article, we have learned how to set up our Xamarin.UITest on the cloud, different ways of executing it, and regarding the pricing and understanding which plan suits us best.

Happy learning.


Similar Articles