Please watch the video below for more details on how to create a ngrok environment pointing to your localhost as well as adding and running tests on this new environment from your PreFlight account.

Making an environment that points to localhost:

When the page that you want to test on locally is running on localhost port 8080, for example, you can run the following command from your command line.

ngrok http 8080 

// this command is going to expose your localhost port 8080 to outside

After exposing your localhost with ngrok copy the url that is displayed pointing to your localhost. You will use this link to create a new PreFlight environment for testing.

To do this go to Test Settings > Environments page. On the Environments page will allow you to add or remove testing environments to your account. This list is also automatically updated when you create a new test on a newly detected environment.

When viewing the Environments page you will see a form field for entering urls. Here you can add your newly created ngrok environment link that points to your localhost and then simply click the Add Environment button. Once added this url will show up in your environment url list. You will also have the option to delete any of the urls when needed via the Delete Environment button next to the url in question.

After you have added the ngrok environment link to your list of urls you can then use the Run All with Custom Settings option under the Run All Tests (all tests view) or Run Group Tests (test group view) dropdown.

When the Run All with Custom Settings option is chosen this will bring up a page full of default selections for testing. Scroll down to the bottom of the page to access the Environments section. There will be a dropdown selector that when clicked will display your list of environment urls. Here you should select the newly added ngrok environment. Once satisfied with the custom selections click the Run All Tests Now button to queue up the selected Preflight tests for testing on your localhost using this ngrok environment.

Didn't answer your question? Have other questions? Or, do you need help setting it up? We have answers - drop us a message in the chat, or email: [email protected].

Did this answer your question?