Testing Locally

You can test locally using ngrok. This topic describes how to create an ngrok environment that points to your localhost and how to run tests in this new environment from your Preflight account.

Create an ngrok URL that can be used for testing locally.

To Create an Environment That Points to localhost:

Use the following procedure if the page that you want to test locally is on localhost port 8080:

  1. Run the following command from the command line.

    ngrok http 8080 
    // this command exposes
    // localhost port 8080 

    This exposes localhost with ngrok.

  2. Copy the URL that points to localhost.

  3. In the Navigation bar, select Settings > Environments.

  4. In Environment URL add the ngrok environment link that points to your localhost.

  5. Click Add Environment.

    This URL is now available in the list of available test environments. If required, you can delete it by clicking Delete Environment.

  6. Select the tests you want to run locally and run them with custom settings to select the local environment you created.

Updated at Mon, Sep 18, 2023