Providing extra information for testers

Last updated on November 22, 2024

Display hidden fields to assist testers in confirming and validating the form.

On this page:

Overview

Many forms are designed to be short and simple for the citizen, but that simplicity may be because the form has complexity behind the scenes.

It can be difficult for Testers to do their work thoroughly form some long or complex forms that include things like:

You can help make testing faster and better by exposing this information to the Testers using a central visibility control. This can be referred to as a "testing layer", because it can exist between the Form Builder layer you work with and the production version of the form Citizens use.

Setting up a 'switch'

The first step to setting up a testing layer is to create a 'switch' control that lets you toggle between a 'test' mode and a 'production' mode.

You can do this by:

  1. Creating a radio button control named something like status
  2. Providing two options and values, such as:
    • "Being developed, revised or tested" with a value of test
    • "Approved for release" with a value of prod

Once your switch is set up, you can use it to control field visibility.

To see an example of how this switch works, see the following form:

Options to consider

You have flexibilty in designing your switch and have a number of options such as:

  • Including the switch in form templates or forms control sections so it's ready to use if you need it
  • Including initial data in some of the fields to save tester time
  • Using a dropdown control instead of a radio control to save space
  • Creating a separate additional switch so testers can switch between appearances

With the last option, you would create:

  • One switch only visible to you in the Form Builder
  • Another switch always visible to and editable by testers

For this approach you could:

  • Place a new section at the top of the form labeled something like "Visibility options"
  • Place a switch like the one describe above in this section
    • Relabel it and options to reflect the viewpoint of the Testers
    • Keep the values the same
  • Place a switch for your use in this section as well
    • Give it a different name, such as project
    • Label it like the switch described earlier
    • Keep the values the same
    • Set its Visibility to "No"

Once those two switches are set up, you can set the Visibility of your section to respond to your second switch, such as:

string($project) = 'test'

Your second switch acts as an override to the switch the Testers can change. When you select the prod option on your switch, the whole section becomes hidden and the default setting of "prod" for the test view takes effect.

Setting field visibility

For each field you want to appear in a 'test' mode, you set the visibility to respond to the switch. In our example, this would be:

string($status) = 'test'

If you are going to use that field to populate a PDF - either automatic or templated - you'll also want to include the PDF mode for the visibility:

string($status) = 'test' or fr:mode() = 'pdf'

This combination will make the field visible in 'test' or PDF mode, and hidden otherwise.

Including initial data

You can save testers some time in completing forms by pre-filling some fields for them in the 'test' mode.

Just about any field is a good candidate for this, especially very common or longer fields like:

  • Contact information such as first name, last name, address and phone number
  • Decriptive fields such as explanations or detailed information

You may not want to provide initial data for every field, however. You'll still want testers to actively test certain fields and interactions.

You can provide this content in the Initial Value section of the control's Formulas tab using a conditional phrase, such as:

if (string($status) = 'test') then 'John' else ''

This statement provides a value if the form is in 'test' mode, and no value (represented by a pair of single quotes) if it's not.

Using the switch in your process

If you are using a "testing layer" in your form, you'll need to make a slight modification to your process.

  • While building your form:
    • Include the Visibility formula for any fields you want Testers to see
    • Set the switch to 'test' mode so you can preview what Testers will see
  • Confirm that the switch is set to 'test' mode before you publish your form for client testing
  • Once your form has been approved for release:

A testing layer effectively means that you have 2 representations of the form, so you'll choose the correct representation at different points in your process.