Note: Nintex Apps data centers are located in West US and Australia (AUS). In-region processing of Nintex Apps data is only available in these regions.

Automated Testing

Automated testing is the process of writing scripts of actions, and their expected results, to be run within a browser by a computer. These scripts, or tests, are used to verify that the various parts of an application function as intended. The success or failure of those scripts determines whether or not an application is in working order.

These tests can be executed on an individual developer's local machine while building an application, or run automatically as a part of a CI/CD workflow when a developer's source code is pushed to a repository. All of this typically occurs before user acceptance testing (UAT)—where human end users actually utilize an application for its intended purpose.

Like other software applications, the pages of Nintex apps can also be tested to ensure that they are functioning as intended, even as Nintex admins make changes to pages. These automated tests can then alert the organization when a particular change breaks a part of page, perhaps preventing a component from rendering or a model from querying and returning data.

While the landscape of testing frameworks is vast, there are some consistent processes and best practices to keep in mind when designing tests for Nintex Apps.

Note: 
  • The examples discussed below assume you are working with a Nintex Apps site. Many of these same concepts can be applied to Nintex Apps for Salesforce deployments as well, though their implementation will vary.
  • The sample code below is in JavaScript, but you may use your language of choice per your testing suite.

Prerequisites and Concepts

While the examples included here are basic and written to be understood by most builders, knowledge of automated testing concepts and terms is recommended before proceeding.

Some important concepts include:

Overview of Automated Tests for Nintex Apps

Regardless of testing framework, you must write tests that do the following:

  1. Log in to a Nintex Apps site or Salesforce environment.
    • When working on Nintex Apps, login credentials are typically sourced from environment variables.
    • If working with a Nintex Apps for Salesforce implementation, consider using the force CLI to automate the login process.
  2. Open a page to test.
  3. Target specific elements on the screen to test an expected behavior.

After writing these scripts, run the tests—manually or through a CI/CD system.

The results of the tests can be output to a file on your local machine or, if applicable, processed by a separate CI/CD process to update records within other connected services—such as a test case management integration.

Writing Automated Tests for Nintex Apps

  • Write tests in the programming language of choice, using specific element selectors for your app page components.
    • When building Nintex Apps pages, make extensive use of the unique ID property on components.
  • If you are less experienced in writing code, or are not sure how to begin using element selectors, consider using Selenium IDE. This tool can record interactions to draft automated tests, and then run them, without handwriting tests from scratch.
  • In the design stage for the application—potentially before using any Nintex Apps components—identify definitive, repeatable behaviors. Keep tests small and well defined. For more complex behaviors, set up a series of tests so you can tell exactly where the page logic encounters issues.
  • (Optional) If moving Nintex Apps pages to a specific testing environment before running automated testing, use the CLI to quickly move pages from one environment to another.

Best Practices for Designing Tests

  1. Create and document test scenarios before attempting any automation.
  2. Identify test candidates suitable for automation. For example:
    • How often does the test need to be repeated?
    • How difficult is it to automate?
  3. Choose an automation tool that is best for your needs.
    • For example: Do you have the resources to code tests? Which coding language?
    • Would it be better to use a record and playback tool, like Selenium IDE?
  4. Make full use of the Unique ID property within components.
    • These unique IDs propagate to Nintex Apps's runtime DOM as the id HTML attribute. These are the best and most flexible element locators when automating.
  5. Break up automated tests into logical groups.
    • A smaller "Smoke Test" suite that can be run quickly on changes.
    • A larger "Full Test" suite to run before deploying to production.
  6. Use a known subset of test data or fixtures for automated tests, if possible.
    • Tests run faster and are more stable with a smaller subset of data as opposed to full datasets or production data analogues.