Testing Your App

Info:

Ensure you have previous steps and have FDK CLI version 9.0.0 or higher with Node version v18.13.0 installed locally

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.

App testing steps

  1. Navigate to the app directory created in previous step or your_first_app directory as applicable from the CLI

  2. Run command fdk run to run the app, which should prompt the result as follows

    $ fdk run
    Starting local testing server at http://*:10001/    
    Append 'dev=true' to your Freshservice account URL to start testing    
    e.g. https://domain.freshservice.com/helpdesk/tickets/1?dev=true    
    Quit the server with Control-C.
  3. To allow the Chrome browser to connect to the test server that runs on HTTP,

    1. Navigate to Settings > Advanced > Privacy and security > Site settings > Insecure content.
    2. In the Allow section, click Add and enter the account URL.
  4. Navigate to your product page by changing the domain name. Append ?dev=true or &dev=true in URI to include query param as shown below

    1. When to use when there is no query param in URI https://subdomain.freshservice.com/helpdesk/tickets/1?dev=true
    2. To use when there is already a URI query param is present https://subdomain.freshservice.com/helpdesk/tickets/1?current_tab=details&dev=true
  5. To test serverless events, navigate to events page http://localhost:10001/web/test to test events

  6. To test custom config, navigate to custom config page http://localhost:10001/custom_configs to cheeck custom configurations

  7. After testing, press Control + C to stop the server. A code coverage summary that indicates the extent of testing is displayed. A coverage summary that indicates extensive testing is as follows.

    ======================= Coverage summary ========================
        Statements   : 98.18% ( 54/55 )
        Branches     : 100% ( 4/4 )
        Functions    : 84.62% ( 22/26 )
        Lines        : 98.18% ( 54/55 )
    ================================================================