Generating the build.xml File for Docker

To generate the build.xml file for Docker, we recommend using Run Under ANT on a machine with Provar installed; then, you can customize the file to run inside the Docker integration container.

Ensure you have installed Java 1.8 or later and ANT 1.9.0 or later before completing the steps above.

Refer to the sample file below for an example of a build.xml file configured for Docker without Provar installed.

<project default="runtests">
    <property environment="env"/>
    <property name="provar.home" value="${env.PROVAR_HOME}"/>
    <property name="testproject.home" value="${env.WORKSPACE}"/>
    <property name="testproject.results" value="${env.WORKSPACE}/ANT/Results"/>
    <property name="secrets.password" value="${env.ProvarSecretsPassword}"/>
    <property name="testenvironment.secretspassword" value="${env.ProvarSecretsPassword_EnvName}"/>
     
    <taskdef name="Provar-Compile" classname="com.provar.testrunner.ant.CompileTask" classpath="${provar.home}/ant/ant-provar.jar"/>
    <taskdef name="Run-Test-Case" classname="com.provar.testrunner.ant.RunnerTask" classpath="${provar.home}/ant/ant-provar.jar;${provar.home}/ant/ant-provar-bundled.jar;${provar.home}/ant/ant-provar-sf.jar"/>
    <taskdef name="Test-Cycle-Report" classname="com.provar.testrunner.ant.TestCycleReportTask" classpath="${provar.home}/ant/ant-provar.jar;${provar.home}/ant/ant-provar-bundled.jar;${provar.home}/ant/ant-provar-sf.jar"/>
    
    <target name="runtests">
​
        <Provar-Compile provarHome="${provar.home}" projectPath="${testproject.home}"/>
​
        <Run-Test-Case provarHome="${provar.home}" 
                projectPath="${testproject.home}" 
                resultsPath="${testproject.results}" 
                resultsPathDisposition="Increment" 
                testEnvironment="" 
                webBrowser="Chrome_Headless" 
                webBrowserConfiguration="Full Screen"
                webBrowserProviderName="Desktop"
                webBrowserDeviceName="Full Screen" 
                excludeCallableTestCases="false" 
                salesforceMetadataCache="Reload" 
                projectCachePath="${testproject.home}/../.provarCaches"
                testOutputlevel="WARNING" 
                pluginOutputlevel="WARNING"
                stopTestRunOnError="false"                
                secretsPassword="${secrets.password}"
                testEnvironmentSecretsPassword="${testenvironment.secretspassword}"
                invokeTestRunMonitor="true"
                >
            <fileset dir="${testproject.home}/tests"/>
        </Run-Test-Case>
    </target>
</project>

The three main property tags that need to be reconfigured are provar.home, testproject.home and testproject.results:

  • provar.home contains the location where the Provar installation was unzipped to.
    • Since we use a Docker container, this value must be set to ${env.PROJECT_HOME}
  • testproject.home is the folder that contains the Test Project .testproject file.
    • This value must be set to ${env.WORKSPACE}
  • testproject.results is where the test run’s results should be written.
    • This value must be set to ${env.WORKSPACE}/ANT/Results
Review Provar on G2
Documentation library

Other available resources

Looking for something different?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top