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.
Notes:- For information on testing serverless apps through event simulation, see Test the App.
- Currently, only the onAppInstall and onAppUninstall events 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
From the command line, navigate to the directory that contains the app related files and run the following command.
fdk run
Log in to your Freshworks product account and from the left navigation pane, navigate to Settings > Admin Settings > Marketplace 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 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.
On successful installation of the app, the Custom Apps page is refreshed and for the app being tested, in addition to the label, the Settings button is displayed.
- If the app requires authorization to access resources from a third-party domain, the Authorize app window is displayed. Click Authorize.
To retest the installation parameters, click the Settings button, and select Edit settings.
To retest authorization, click the Settings button, and select Reauthorize.
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.