All documentation

Docs ยท Guide

Testing Apps

View on GitHubSuggest an edit

Testing your App before you put it in the hands of your users is an essential part of the development lifecycle. It allows you to check that the interface looks as you expect it to whilst also allowing you to validate that your app behaves like it should. Testing your App then gives you confidence that your App is ready for your users!

Preview Mode

When you are building your App in the App Designer, you are typically using "Design Mode". When you are in design mode, you can drag components onto the page, edit the properties of your components and define your In Page Logic (IPL). Design mode is aimed at making it as easy as possibly to build your app so while it can give you a rough idea of how your page will look there are certain limitations to how components can be rendered. Fortunately to solve this, the App Designer has another mode: preview mode.

Preview mode solves this for you by taking away the distractions of the App Designer and showing you the App as your end users would see it. Your App, as shown in preview mode, will look exactly the same as it would once you have deployed it. To switch to preview mode, click the preview icon in the top right of the designer bar. To get back to design mode, click the paintbrush icon in the top right of the designer bar.

Whilst in preview mode, you can click on links to other pages and they will work as expected, your IPL will also work as expected.

Previewing as a User

If your app is set up to to use authentication, then you may well have designed your app so that users with different roles are allowed to see different data and perform different actions. This is typically done by setting up permissions on either your pages or the resources linked to your app. To test how your permissions work on your App, you can use the "Preview as User" feature, which allows you to enter preview mode as a particular user that has been set up on your app.

This can be extremely useful for debugging issues that users might encounter as you can experience using the App exactly as they do. To use the "Preview as User" functionality, you must have authentication enabled for your app and you must have at least one app user which has been assigned a group with a role. When this is the case, your top bar will have a little person icon on the right hand side, clicking this will offer you a drop down allowing you to select which user you would like to preview the app as. To leave this mode, you can click the paintbrush icon to go back to design mode or in the preview as user dropdown click the Unselected option.

Using Versions

Just like with automation, your Apps are always versioned, this means that you can develop your app in the Draft version, whilst your Published version app is the one that is deployed and in the hands of your users. You can have your draft version deployed on one URL and your published version deployed on another URL. This allows you to fully deploy your App whilst developing it so you can see what the real experience will be like.

Using Deploy Targets

In addition to the deploy states, you can also deploy your App to multiple different URL's. This means that you can make some changes to your App then deploy it to a new URL, this can allow you to perform A/B Testing. Fully deploying your App to test it can also give you a much better idea of how your app will be perform for users, as even though the preview mode in the App Designer is very practical for testing, nothing quite substitutes for the real thing!

Using Toca

If you want to automate the testing of your app, then why not use the automation layer in Toca? There are many actions which will allow you to automate the browser so you can test the functionality of your app. Using Toca to test your app means you don't need to use other software to build automated test scripts, it is all built into the same platform. The browser actions are all built on top of the powerful and ever-popular browser testing framework Selenium already and there is also a Selenium action which allows you to write Python with access to the Selenium package for more advanced use cases and tests.