Suggest an edit

Adding TestFairy plugin to your Cordova or Phonegap project is simple. Cordova provides two workflows for development, either through the command line, or a platform-centered workflow. If your current development leverages the platform-centered workflow, then please refer to the iOS integration document for adding TestFairy to your project. Here, we'll walkthrough adding TestFairy to a new project through the command-line workflow.

For Ionic and Ionic 2 application, please check out the Ionic documentation.

Installation

Cordova

Make sure you have cordova installed on your machine, you can follow instructions here on getting started.

Once installed, we'll start with creating an new project. If you already have an existing project, then please skip to the next step

To add the plugin to your project via npm, simply run the following command from Terminal:

cordova plugin add com.testfairy.cordova-plugin

Alternatively, you could install it directly from GitHub:

cordova plugin add https://github.com/testfairy/testfairy-cordova-plugin

Upgrading

To upgrade your plugin, please run:

cordova plugin update com.testfairy.cordova-plugin

Usage

Initialize TestFairy with your App Token by calling TestFairy.begin. Your APP TOKEN is available at https://app.testfairy.com/settings/#apptoken.

It's recommended to invoke TestFairy.begin from onDeviceReady. For example, here's onDeviceReady from index.js:

  onDeviceReady: function() {
    app.receivedEvent('deviceready');
    TestFairy.begin("APP TOKEN");
  }

Where to go from here?

Congratulations! You've successfully integrated TestFairy into your Cordova project! Visit your dashboard, and you should see your app listed.

  • Have a look at the API documentation for other calls you can make to the TestFairy plugin

  • Follow the project on GitHub for updates, reporting bugs, or contributing to the project!