Test and debug Apps Script Google Workspace add-ons (original) (raw)

When you publish an add-on, users can install it through the host application or the Google Workspace Marketplace. Before you publish, test the add-ons that you develop within the host applications that they extend.

This page describes how to install an add-on that is under development (called an unpublished or _developer_add-on) for testing or personal use. You can also debug add-ons using the Apps Script IDE's debugger and breakpoints.

Prerequisites

Install an unpublished add-on

You can install unpublished add-ons from Apps Script's Deploymentsdialog.

Follow these steps to install an unpublished Google Workspace add-on for testing:

  1. Open the script project in the Apps Script editor.
  2. Click Deploy > Test deployments.
  3. Click Install.
  4. At the bottom, click Done.

You can let other users test the add-on by sharing the Apps Script project with their account (edit access is required). Then prompt the users to follow the above steps.

Once installed, the add-on is immediately available in host applications it extends. You may need to refresh the host application tab before the add-on appears. You must alsoauthorizethe add-on before using it. If your project is already authorized, use ScriptApp.invalidateAuth to invalidate the existing authorizations so that you can test the granular OAuthfeature on your add-on.

Uninstall an unpublished add-on

To uninstall an unpublished add-on deployment, follow these steps:

  1. Open the script project in the Apps Script editor.
  2. Click Deploy > Test deployments.
  3. Click Uninstall.
  4. At the bottom, click Done.

These steps immediately remove the deployment and the add-on no longer appears in any host application. You can reinstall the deployment at any time by repeating the install procedure.

Testing best practices

While testing your Google Workspace add-on, be sure to follow theBest practicesfor add-on development. In addition, be sure to do the following:

  1. Test card navigation flows thoroughly in all the host applications the add-on extends. Make sure the add-on behavior is correct as the user moves from context to context, and between non-contextual and contextual cards.
  2. Use example test datato evaluate your add-on's behavior.
  3. If your add-on connects to a third-party API or other service, verify that the service can be accessed and behaves as expected. Make sure your add-on is handling theauthorization and log-in detailscorrectly.
  4. Make sure any error conditions are handled gracefully. Use error cardswhere needed.
  5. Pay attention to how performant the add-on is. If you make a change to the code and the add-on starts slowing down, you may need to remove or rework that feature.