Using the Calabash Sandbox on Windows

Easily setting up a Calabash Environment on Windows 10

PDF for offline use
Related Links:

Let us know how you feel about this

Translation Quality


0/250

last updated: 2016-10

This guide describes how to install and use the Calabash Sandbox on Windows 10 to get started with creating and using Calabash scripts.

Overview

The Calabash Sandbox is the best way for a novice to get started with Calabash. This is a Bash script that will establish a pre-configured Ruby environment with everything necessarily to creating and running tests.

The Calabash installer script will setup the Calabash Sandbox with Ruby 2.1.6 (the same version of Ruby that is used in Xamarin Test Cloud) and the current gems for Calabash iOS, Calabash Android, and Xamarin Test Cloud. This will ensure maximum compatibility between a local test environment and the Xamarin Test Cloud environment.

Requirements

The Calabash Sandbox is a Powershell script that has been tested on Windows 10.

The use of Ruby environment managers such as rbenv or RVM in the Calabash Sandbox is not supported.

Usage

In an adminstrator Powershell terminal, temporarily change the Powershell execution policy:

PS C:\> set-executionpolicy unrestricted

Next, download and run the Windows Calabash sandbox installer script with the following command line:

PS C:\> (New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex

After the installation is complete, you should see something like the following in the Powershell terminal:

Done! Installed:
calabash-android:   0.5.15
xamarin-test-cloud: 1.1.2
Execute 'calabash-sandbox' to get started!

The calabash-cucumber gem will not be installed on Windows.

Finally, reset the execution policy by typing the following in the Powershell terminal:

PS C:\> set-executionpolicy restricted

At this point, you can execute calabash-sandbox in a Powershell session to initiate a sandbox environment. To leave the sandbox environment and return the Terminal session to its previous state, type exit.

Installing Gems

Any gems that are installed with the Calabash Sandbox is running will be kept in the Sandbox's GEM_HOME directory, isolated from and not available outside of the Sandbox.

Updating Gems

To update the gems, use the update command for the sandbox:

PS C:\>  calabash-sandbox update

Restoring the Sandbox

It is possible to reset the Sandbox environment to the original state by running the following commands in the Terminal:

PS C:\> rm -r -fo "${env:USERPROFILE}\.calabash\sandbox"
PS C:\> set-executionpolicy unrestricted
PS C:\> (New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex
PS C:\> set-executionpolicy restricted

Summary

This guide discussed how to install and use the Calabash Sandbox to get started with creating and running Calabash test scripts.

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.