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. It’s a big change, but 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.
If you’re interested in learning how you can use ProvarDXTM to dramatically simplify scratch org testing and find out how good test automation for Salesforce DX can be, 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 easily 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 too, so you can manage full 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 includes a Visual Studio (VS) Code extension that provides access to the most powerful ProvarDXTM CLI commands using the VS Code command autocomplete menu.
To get started you will need:
- A local Provar installation license or a Provar execution-only license (Provar v2.2.0 or later)
- Salesforce CLI
- ProvarDXTM plugin and/or ProvarDXTM VS extension (links to downloads are below)
- A Provar test project to be executed
- If you are using scratch orgs, an authenticated Dev Hub, and a scratch org
Note: This blog assumes that 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 ProvarDXTM plugin for the Salesforce CLI. The plugin gives Salesforce DX developers the ability 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 select 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. This takes the name of the connection in your Provar project and reassigns all tests using that connection to use the scratch org instead.
Learn More About ProvarDXTM
- For detailed instructions that outline how to run ProvarDXTM, you can 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 here https://marketplace.visualstudio.com/items?itemName=ProvarTesting.provardx-vscode. ProvarDXTM is compatible with Provar version 2.2.0 and later.
- If you’re interested in getting a guided tour of ProvarDXTM, fill out this form and we’ll be in touch.
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].