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.
- 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 app cannot be tested through end-to-end testing.
Run an end-to-end test
- From the command line, navigate to the app root directory. $ fdk run
- Log in to your Freshcaller account and from the left navigation pane, navigate to Admin Settings > Apps. The Apps Gallery is displayed.
- 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.
- 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.
- 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:
- To retest the installation parameters, click the settings icon and from the menu displayed, select Settings.
- To retest authorization, click the settings icon and from the menu displayed, select Reauthorize.
- 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.