Testing your hybrid mobild applications using Jasmine
This tutorial shows you how to test your hybrid mobile
applications using Jasmine.
This tutorial is divided into several exercises that must
be completed in sequence for the tutorial to work properly.
Learning objectives
In this tutorial, you will learn how to do the following things:- Create a test project
- Create test cases and add test logic
- Creating a test runner file
- Deploy the test on a mobile device emulator
Time required
This tutorial should take approximately 30 minutes to finish. If you explore other concepts related to this tutorial, it could take longer to complete.Skill level
IntermediateAudience
This tutorial is intended for users who want to become familiar with the tools for creating unit tests for the JavaScript codeSystem requirements
To complete this tutorial, you need to have the following things:- A supported version of WebSphere® Application Server installed.
- A clean workspace.
- An Internet connection.
- Android or iOS platform support MUST be added prior running the
application. See
Installing the SDK and Tools
- Download the Android SDK from Download Android SDK, and select DOWNLOAD
FOR OTHER PLATFORMS, and download the archive file from
the SDK tools only. Restriction: The Android SDK does not support Java™ 8; use Java 7 or Java 6. For more information, see: Get the Android SDK
- Extract the Android SDK to a directory in your workstation.
- Once you have installed the Android virtual device, you can Setting Cordova preferences, and point to the directory where you installed Android.
Creating an Android virtual device
- On Windows: Open the Android SDK folder, and navigate to the SDK Manager.exe. Double click SDK Manager.exe.
- On Linux: open a Terminal, change into the directory of the Android SDK tools (commmand: cd <your SDK Path>/tools ) and run the command ./android sdk or ./android avd.
- The Android SDK manager opens.

- Click Install <num> packages, and click Accept License, and then click Install.
- Once the installation is complete, select .
- Click New.
- In the AVD name field, type a name for your emulator.
- In the Device field, select the device you are using.
- In the Target field, select the target Android version.
- In the RAM memory field, type 768, and type OK.

- Highlight the Android virtual device you just created and click Start. Whenever you want to create and run a project using the Android virtual device, you must start it first.
- On the Launch options page, click Launch.

See also: Configuring the workspace with Android support - Download the Android SDK from Download Android SDK, and select DOWNLOAD
FOR OTHER PLATFORMS, and download the archive file from
the SDK tools only.
- This mobile application reuses the assets from LibraryjQueryOO and LibraryTest from the Testing your web applications using Jasmine project: see Import the sample project file