Minimal UTAM Project
July 19, 2024 ยท View on GitHub
This repo is an example of how to leverage the Salesforce UI Test Automation Model (UTAM).
Disclaimers
This repo is not a supported project by Salesforce. Use at your own risk.
It has been tested on a machine with:
- macOS Sonoma
- Node.js v20.15.1
- npm v10.7.0
- Salesforce Summer 24 Release (API v61.0)
Resources
Overview
UTAM is a framework provided by Salesforce, Inc for automating Salesforce orgs using the Page Object pattern. Salesforce provides the example repo utam-js-recipes for getting familar with using the UTAM framework with JavaScript.
That repository is the official place for Salesforce UTAM examples and demonstrates how to do a variaty of tasks with UTAM. In contrast, this repo provides a single minimal example of automating a Salesforce Org using the out of the box Salesforce components. It is minimialist by design.
The project has two tests.
- hello_world.spec.js This demonstrates a minimal Jasmine test. It doesn't automate anything but it does run when the tests are run.
- navigation_example.spec.js This logins into a Salesforce org, uses the AppLauncher to navigate to the Sales app, and verifies the navigation succeeded.
The Technology Stack
The repo demonstrates how to combine the following technology to automate a Salesforce org using the page object pattern.
| Technology | Description |
|---|---|
| Node.js | JavaScript App Server. Provides the runtime context for the tests to run it. |
| npm | The Node Package Manager. Used to install the dependencies. |
| WebDriverIO | Automation toolkit. |
| Jasmine | Testing framework. |
| utam | The UI Test Automation Model |
| salesforce-pageobjects | Salesforce provided page objects for OOTB components. |
Instructions
- Install Node.js and NPM by downloading it from nodejs.com.
- Clone this repo.
- Use npm to install the dependencies defined in the package.json file.
npm install
- The project uses a .env file for setting authentication credentials. An example .env file is provided. Copy that to a .env file and update the values to use your own details.
- The project provides multiple ways to run the tests.
- Via a npm script.
npm run test - Via a Makefile.
make test - Via VSCode Launch Targets (Run All Tests and Debug Selected Test).