End-to-End Testing

End-to-end testing is a unified testing mechanism to test the entire 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.

Notes:
  • For information on testing serverless apps through event simulation, see Test the App .
  • Currently, only onAppInstall and onAppUninstall can be tested through end-to-end testing. The afterAppUpdate event cannot be tested through end-to-end testing.
Run an end-to-end test
  1. From the command line, navigate to the app root directory. $ fdk run
  2. Log in to your Freshteam account and from the left navigation pane, navigate to Settings > General Settings > Integrate with other Apps > 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 In Dev 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.
    1. 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:
      1. The .fdk/localstore file for account level authorization.
      2. The browser's localStorage for agent level authorization.
    2. 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 In Dev label , a settings icon is displayed.
  5. To retest the installation parameters, click the settings icon and from the menu displayed select Settings.
  6. To retest authorization, click the settings icon and from the menu displayed select Reauthorize.
  7. To test the app uninstallation event, click the settings icon and from the menu displayed select Uninstall.
    Note: For serverless apps, this triggers the onAppUninstall event defined in server.js.