Test the app end-to-end

End-to-end testing is a unified testing mechanism to test the lifecycle of a locally running app. To enable local testing of apps, most features and interfaces offered by the Freshworks app development platform are simulated in the FDK. In addition, you can test the app lifecycle events such as app installation, configuration, and uninstallation either through a custom UI or through end-to-end testing.

The URL to access the custom UI is displayed when you run the fdk run command, to test apps. Testing lifecycle events through the custom UI, results in designing the app experience around a UI which is different from the UI in which the app is finally published. This can lead to a mismatch in app user experience.

End-to-end testing renders the apps, which are being tested, in the in-product App Gallery. This presents a mechanism to test apps from an app user’s perspective and in the actual UI to which the apps are published eventually.


Run an end-to-end test

  1. From the command line, navigate to the directory that contains the app related files and run the following command.

    fdk run
  2. Log in to your Freshsales Classic account and from the left navigation pane, navigate to Settings > Admin Settings > Marketplace Apps. The Apps Gallery is displayed.

  3. Navigate to Manage Apps > Custom Apps. All custom apps and apps that are running locally in the FDK are listed. A Image of rate count label is displayed alongside the locally running apps.

    Note:All locally running apps are displayed under Custom Apps.

  4. To test the app installation event, click Install.

    Note:For serverless apps, this triggers the onAppInstall event defined in server.js.

    • If the app requires authorization to access resources from a third-party domain, the Authorize app window is displayed. Click Authorize.
      Third-party domain is displayed and the generated token is stored in:
      • The .fdk/localstore file for account level authorization.
      • The browser's localStorage for agent level authorization.
    • If the app contains installation parameters, the installation page is displayed. Enter appropriate values in the fields. Click Install to test the installation parameters.

      On successful installation of the app, the Custom Apps page is refreshed and for the app being tested, in addition to the Image of rate count label, the Settings button is displayed.
  5. To retest the installation parameters, click the Settings button, and select Edit settings.

  6. To retest authorization, click the Settings button, and select Reauthorize.

  7. To test the app uninstallation event, click the Settings button, and select Uninstall App.

    Note:For serverless apps, this triggers the onAppUninstall event defined in server.js.