Alexander Sherwood is the director of product marketing at Provar and specializes in helping teams better understand how to build great products and deliver the right solutions with ProvarDX.
Lately, I’ve been talking to Salesforce teams using Salesforce DX to enable a shift from org-driven to source-driven development. While it’s a significant change, the approach is well understood, and the ecosystem surrounding Salesforce DX is established and growing. One of the historical gaps in the Salesforce DX picture has been the lack of a well-integrated test automation solution. Development with scratch orgs and managing the process via the Salesforce CLI requires a different approach to testing. That’s why we built ProvarDXTM.
Suppose you want to learn to use ProvarDXTM to dramatically simplify scratch org testing and determine how good test automation for Salesforce DX can be. In that case, this blog provides a step-by-step guide to getting started.
Simplify Scratch org Testing as Part of Your CI/CD Pipelines.
With ProvarDXTM, you can efficiently run existing Provar tests from the Salesforce CLI. Just generate a scratch org, push the latest Salesforce customizations, and use ProvarDXTM to run Provar tests inside that org. And ProvarDXTM works with sandboxes so that you can manage complete lifecycle testing. Another bonus is that ProvarDXTM recognizes org aliases to simplify authentication and reduce testing overhead managing multiple environments.
What’s in ProvarDXTM?
ProvarDXTM includes a Salesforce CLI plugin that allows you to execute Provar test cases directly from the Salesforce CLI. It also contains a Visual Studio (VS) Code extension that provides access to the most powerful ProvarDXTM CLI commands using the VS Code command autocomplete menu.
The following items are the requirements to begin:
- A local Provar installation license or a Provar execution-only license (Provar v2.2.0 or later)
- Salesforce CLI
- ProvarDXTM plugin and ProvarDXTM VS extension (links to downloads are below)
- Executing the Provar test project
- If you are using scratch orgs, an authenticated Dev Hub, and a scratch org
Note: This blog assumes you are a Provar user and Salesforce DX developer. If you’re new to Salesforce DX and want to learn more, the Salesforce DX Developer Guide is an excellent place to start.
Getting Started with ProvarDXTM
ProvarDXTM consists of the following:
- The ProvarDXTM plugin for the Salesforce CLI. The plugin allows Salesforce DX developers to execute tests and test plans from the Salesforce CLI.
- A Visual Studio Code extension that provides access to ProvarDXTM CLI commands using the VS Code command autocomplete menu.
- A Provar Desktop option (export as ProvarDXTM) to export Provar tests as property files which can be configured to run tests against scratch orgs (or any Salesforce org).
Step 1: Install the Salesforce CLI in the same environment where ProvarDXTM will be executed.
Step 2: Install the ProvarDXTM plugin in the Salesforce CLI.
Step 3: Check for correct installation – from a command line, type’ sfdx plugins –core’. Within the listed output, you should see an entry for @provartesting/provardx.
Note: The ProvarDXTM plugin can be installed in the Salesforce CLI as either an NPM package or VS extension (which will also install the NPM package).
Salesforce CLI command extensions
- sfdx provar:runtests
- sfdx provar:validate
- sfdx provar:metadatacache
- sfdx provar:compile
Visual Studio command extensions
- ProvarDX: Create Properties Files
- ProvarDX: Validate Properties Files
- ProvarDX: Run Test Cases
Step 1: From Provar Desktop, select the tests you want to run with ProvarDXTM, right-click and choose the Export as ProvarDXTM option.
Step 2: The export function will create a default filename: provardx-properties.json.
Step 3: Validate the property file. sfdx provar:validate (CLI) or ProvarDX: Validate Properties Files (VS).
Step 4: Execute the tests from the Salesforce CLI (sfdx provar:runtests) or with Visual Studio (ProvarDX: Run Test Cases).
Step 5: To run the tests against a specific scratch org, you’ll need to edit the provardx-properties.json file to override the connections in the ProvarDX project with your scratch org user. In addition, this process modifies the connection name in your Provar project and updates all the tests utilizing that connection to utilize the scratch org instead.
Learn More About ProvarDXTM
- For detailed instructions outlining how to run ProvarDXTM, refer to our product page to learn more.
- ProvarDX is included free under an open-source license. You can download the Salesforce CLI plugin here https://www.npmjs.com/package/@provartesting/provardx and the Visual Studio Code extension https://marketplace.visualstudio.com/items?itemName=ProvarTesting.provardx-vscode. ProvarDXTM is compatible with Provar version 2.2.0 and later.
- If you want a guided tour of ProvarDXTM, fill out this form, and we’ll contact you.
I love feedback. If you have any questions about ProvarDXTM or any thoughts about what will make Provar test automation better, let’s talk! Please feel free to contact me at [email protected].