Titanium
The TiTestFairy Module extends the Appcelerator Titanium Mobile framework with the TestFairy Android and iOS SDKs. By integrating TestFairy, you gain valuable insights into how your app performs on real devices, understand user behavior, and collect metrics to optimize your user experience and code.
Installation
To integrate TestFairy into your Titanium Mobile project, follow these steps:
-
Add the following lines to your
tiapp.xml
file:<modules>
<module platform="iphone">com.testfairy.titestfairy</module>
</modules> -
Download the latest release.
- Be sure to either download either the Android (com.testfairy.titestfairy-android-2.1.3.zip) or the iOS (com.testfairy.titestfairy-iphone-2.1.3.zip) depending on the platform you're targeting.
-
Add the module to your Titanium Mobiles
- “Help” -> "Install Mobile Module..."
- or by unzipping the contents of the module zip file into your
Titanium/modules/iphone
orTitanium/modules/android
folders.
-
Include the module in your code and use it:
var TiTestFairy = require('com.testfairy.titestfairy');
TiTestFairy.begin("<APP TOKEN>");noteReplace 'APP TOKEN' with your token, which can be found in the user preferences page.
For more detailed code examples take a look at our example app.
Identifying Your Users
To learn how to identify users and set session attributes using the TestFairy SDK in Titanium, refer to the identifying users section in the SDK Documentation.
Session Attributes
For information on how to set session attributes using the TestFairy Titanium SDK, please refer to the SDK Documentation on session attributes.
Remote Logging
To understand how to perform remote logging with the TestFairy SDK in Titanium, refer to the remote logging section in the SDK Documentation.
Reference
The TestFairy Titanium module exposes the following methods:
TiTestFairy.version;
- Returns the version of the TestFairy SDK.
TiTestFairy.setCorrelationId(correlationId)
- Sets an identifier that can be looked up through dashboard.
TiTestFairy.pushFeedbackController()
- Present a feedback dialog to the user.
TiTestFairy.sendUserFeedback(string)
- Send a feedback on behalf of the user. Call when using a in-house feedback view controller with a custom design and feel. Feedback will be associated with the current session.
TiTestFairy.updateLocation(locations)
- Mark geo location at this point (to be used with navigator.geolocation.getCurrentPosition
).
TiTestFairy.checkpoint(checkpointName)
- Mark a checkpoint in session.
TiTestFairy.pause()
- Pauses the current session until resume() is called.
TiTestFairy.resume()
- Resumes a paused session.
TiTestFairy.sessionUrl()
- Returns the address of the recorded session on TestFairy's developer portal. Will return nil if recording has not started yet.
TiTestFairy.takeScreenshot()
- Takes a screenshot.