Salesforce DX Integration using ANT
Provar and Salesforce DX can be used together to generate a scratch org, push the latest Salesforce customization and run Provar tests inside the scratch org to get functional testing insights. This allows immediate feedback during a development cycle or when a scratch org is used as a system integration test environment.
For Provar customers already using our ANT option to execute tests on servers or locally, Provar supports integration with Salesforce DX scratch orgs using our ConfigureDX option.
Note: You can also find more information here about our Salesforce DX integration.
Prerequisites
The following prerequisites must be completed before setup.
- The scratch org needs to be set up including deployment of the org configuration to be tested
- A password should be generated for the scratch org.
- The scratch org’s DevHub alias must be the same as the Salesforce org username in your Provar test project..
- The Salesforce DX project should be authenticated on the machine where Provar is installed.
Setup
To support Salesforce DX in Provar ANT, it is necessary to add a new ANT task after generating the Build File. This ANT task will create a new Provar Environment and add the necessary connection overrides to run Provar against the scratch org with the corresponding DevHub alias. Use this task prior to the Provar Runner Task to create/update the environment.
You can then copy and paste the following into the build file, adding your own information where shown.
<taskdef name="Provar-ConfigureDx" classname="com.provar.testrunner.ant.ConfigureDxTask" classpath="${provar.home}/ant/ant-provar.jar;${provar.home}/ant/ant-provar-bundled.jar;${provar.home}/ant/ant-provar-sf.jar"/> <Provar-ConfigureDx testEnvironment="<env-name>" provarHome="${provar.home}" projectPath="${testproject.home}" adminUser="<admin user of scratch org>"/>
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
Additional logging
You can enable additional logging for the location of the .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.
testOutputlevel=”FINE”
This will get the location of the .sfdx folder, the commands and authorization used and their output in the logs.
The 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:
Demo video
Watch the video below to see Salesforce DX integration in action:
- Provar Automation
- Installing Provar Automation
- Updating Provar Automation
- Using Provar Automation
- API Testing
- Behavior-Driven Development
- Creating and Importing Projects
- Creating Test Cases
- Custom Table Mapping
- Functions
- Debugging Tests
- Defining a Namespace Prefix on a Connection
- Defining Proxy Settings
- Environment Management
- Exporting Test Cases into a PDF
- Exporting Test Projects
- Override Auto-Retry for Test Step
- Managing Test Steps
- Namespace Org Testing
- NitroX
- Provar Automation
- Provar Test Builder
- Refresh and Recompile
- Reintroduction of CLI License Check
- Reload Org Cache
- Reporting
- Running Tests
- Searching Provar with Find Usages
- Secrets Management and Encryption
- Setup and Teardown Test Cases
- Tags and Service Level Agreements (SLAs)
- Test Cycles
- Test Plans
- Testing Browser Options
- Tooltip Testing
- Using the Test Palette
- Using Custom APIs
- Callable Tests
- Data-Driven Testing
- Page Objects
- Block Locator Strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript Locator Support
- Label Locator Strategies
- Maintaining Page Objects
- Mapping Non-Salesforce fields
- Page Object Operations
- ProvarX™
- Refresh and Reselect Field Locators in Test Builder
- Using Java Method Annotations for Custom Objects
- Applications Testing
- Provar Manager
- Provar Manager Setup and User Guide
- Installing Provar Manager
- Configuring Provar Manager
- How to Use Provar Manager
- Managing Your Testing Life Cycle
- Provar Manager Test Execution
- Test Executions and Defect Management
- Provar Manager Test Coverage
- How to Integrate Provar Manager
- Setting Up a Connection to Provar Manager
- Object Mapping Between Automation and Manager
- How to Upload Test Plans, Test Plan Folders, Test Plan Instances, and Test Cases
- Provar Manager Filters
- Uploading Callable Test Cases in Provar Manager
- Uploading Test Steps in Provar Manager
- How to Know if a File in Automation is Linked in Test Manager
- Test Execution Reporting
- Provar Manager Plugins
- Uploading Existing Manual Test Cases to Provar Manager with DataLoader.Io
- Provar Grid
- DevOps
- Introduction to Test Scheduling
- Apache Ant
- Configuration for Sending Emails via the Automation Command Line Interface
- Continuous Integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Automation secrets password in Microsoft Azure Pipelines
- Parallel Execution in Microsoft Azure Pipelines using Multiple build.xml Files
- Parallel Execution in Microsoft Azure Pipelines using Targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- CircleCI
- Copado
- Docker
- Flosum
- Gearset DevOps CI/CD
- GitHub Actions
- Integrating GitHub Actions CI to Run Automation CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Jenkins
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team Foundation Server
- Version Control
- Salesforce Testing
- Best Practices
- Troubleshooting
- Release Notes