Provar now supports integration with Salesforce DX. Provar and Salesforce DX can be used together to generate a Scratch Org, push latest Salesforce customization, then run Provar tests inside the Scratch Org to get functional testing insights.
Refer to Integrating Test Automation with Salesforce DX [VIDEO] for an overview of Salesforce DX and the benefits of integrating it with Provar. We also recommend completing the Salesforce DX Trailhead course.
The following prerequisites need to be completed before setup.
- Scratch Org need to be set up.
- Password should be generated for the Scratch Org.
- Scratch org alias should be same as the Salesforce org username.
- Salesforce DX project should be authenticated on the machine where Provar is installed.
To support Salesforce DX in Provar, it is necessary to add a new ANT Task after generating the Build File. This ANT Task will create a test environment and add the necessary Connection Overrides to run Provar against a Scratch Org. Use this task prior to the Provar Runner Task to create/update the environment.
To prevent errors, please click this link to access a plaintext file of the arguments above. You can then copy and paste these into the Build File, adding your own information where shown.
The following errors will be thrown in the ANT log file if the provided details are not correct:
- An error will be thrown if no users are found in the Scratch org with that admin user
- An error will be thrown if the passwords are not generated for the required users
- A warning will be logged if the alias is not found
As of Provar 1.8.11, you can enable additional logging for the location of .sfdx folder, authorization, commands which Provar uses in Salesforce DX and the command output.
To get these additional logs, add one additional argument to the ConfigureDx ANT Task you added above:
This will get the location of the .sfdx folder, the commands and authorization used and their output in the logs.
The commands output will look like this:
The .sfdx folder and authorization will look like this:
Alternatively, if the log level is not explicitly set to FINE, the output of the Configure-Dx Task will look like this:
Watch the video below to see Salesforce DX integration in action: