SN Pro Tips

View Original

Use Automated Tests to Validate "Guided Setup" Completion & Functionality.

Here's a Quick Pro-Tip:

If you have an application which requires some setup or initial configuration, write ATF tests specifically to validate that the application is set up properly. Add executing the tests as a final step in your application's Guided Setup, and provide some meaningful output that directs the admin to the right place(s) to fix any issues identified by the tests.

For example, I'm building an application now which connects to an outside application running on the company's intranet. Part of the guided setup includes populating a system property with the outside application instance's base URL and encrypted credentials or API key, setting up a MID server for the REST messages, and other important steps.
If these steps aren't done, or are done incorrectly, the application will not work. Therefore, I'm writing some ATF tests to check whether the configuration is set up such that the application can log into this external service, get data from it, and properly parse that data.

I don’t have to directly validate that, for example, the instance URL is correct - I don’t know their instance URL anyway. Instead, I just have to check if all of the REST messages fire and function as expected, retrieve expected data, and that that data is parseable. If something fails, I can look at the HTTP status code, and determine the likely problem.
404? URL is probably wrong.
401? Credentials are probably wrong.
500? The external application is probably misconfigured; here’s a link to the docs about how to set it up.

That’s all, folks! If you want to see my upcoming article on how to add a Guided Setup to your application, be sure to subscribe and follow me on LinkedIn and Twitter, to see when that article drops!


See this form in the original post

See this content in the original post