Configure ant to run Scenarios from Jenkins
All the ant calls are case-sensitive.
To run scenarios using local files, Jenkins must be installed on a local machine, after which local paths can be specified in place of REPOSITORY paths using SERVER.
-
Save this Jenkins project with these configurations.
-
Click build now.
-
Upon successful build, the user can see the logs by clicking on the build link and then clicking on Console Output which will display all the logs and the link to navigate to Reports of the test run.
Jenkins console or output logs (run from the command line) will show all the details, test case pass / fail, Execution times being taken from all the iterations.
Beginning in the AIQ 4.10.0 release, if you want to run multiple scenarios in parallel you no longer have to specify the individual scenarios in the build.xml file. You can now just add the root folder and CICD will run each scenario within that folder.
To pass scenario and folder as a parameter, setup the following:
-
In the build.xml file, parameters on top should have the variable reference for the value.
Copy<!-- Execute Scenario's parameters -->
<property name="dir" value="${dirName}" />
<!-- folder that contains scenario and resources needed by it -->
<property name="scenario" value="${scenarioName}" />
-
Execute Scenario target should have the same variable name defined for the dir and scenario.
Copy<target name="executeScenario" depends="setupEnvironment">
<taskdef name="executeScenario" classname="com.appvance.ci.ExecuteScenario">
<classpath refid="RestClientLibPath" />
</taskdef>
<executeScenario aiqCreds="${credsData}" dir="${dirName}" scenario="${scenarioName}" consoleDetails="${consoleDetailsData}" resultsFolder="${scenarioResults}" />
<taskdef name="fetchScenarioResults" classname="com.appvance.ci.FetchScenarioResults">
<classpath refid="RestClientLibPath" />
</taskdef>
<fetchScenarioResults aiqCreds="${credsData}" consoleDetails="${consoleDetailsData}" resultsFolder="${scenarioResults}" scenario="${scenarioName}" stopOnFailure="${stopOnFailure}" />
</target> -
From Jenkins, the parameters for dir and scenario can be passed by using the Build> Advanced option