diff --git a/src/main/resources/io/jenkins/plugins/ProvarAutomation/config.properties b/src/main/resources/io/jenkins/plugins/ProvarAutomation/config.properties
index 632a8d6..9e2e051 100644
--- a/src/main/resources/io/jenkins/plugins/ProvarAutomation/config.properties
+++ b/src/main/resources/io/jenkins/plugins/ProvarAutomation/config.properties
@@ -17,4 +17,6 @@ SecretsPasswordDescr=The secrets password used to encrypt the project
SalesforceMetadataCacheSetting=Salesforce Metadata Cache Setting
SalesforceMetadataCacheSettingDescr=The Salesforce metadata cache refresh setting
ResultsPathSetting=Test Results Path Setting
-ResultsPathSettingDescr=How to handle the results directory before the next run
\ No newline at end of file
+ResultsPathSettingDescr=How to handle the results directory before the next run
+LicensePath=Execution License Path
+LicensePathDescr=The path of the '.licenses' directory on the machine being used to run Provar tests
\ No newline at end of file
diff --git a/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-buildFile.html b/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-buildFile.html
index be492be..cebfe48 100644
--- a/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-buildFile.html
+++ b/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-buildFile.html
@@ -1,4 +1,4 @@
- The name of the build file. Must end with '.xml'.
+ The name of the build file. Can end with '.xml' or just be the base file name.
This task assumes it is contained in the ANT
folder of your Project Name
directory.
diff --git a/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-licensePath.html b/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-licensePath.html
new file mode 100644
index 0000000..277c650
--- /dev/null
+++ b/src/main/resources/io/jenkins/plugins/ProvarAutomation/help-licensePath.html
@@ -0,0 +1,5 @@
+
+ The path of your license directory on the machine being used to run the tests.
+ Your license directory should contain a ".licenses" folder.
+ If left empty, will default to $USER_HOME/Provar/.licenses.
+
\ No newline at end of file
diff --git a/src/test/java/io/jenkins/plugins/ProvarAutomationTest.java b/src/test/java/io/jenkins/plugins/ProvarAutomationTest.java
index ed64dcb..624f39b 100644
--- a/src/test/java/io/jenkins/plugins/ProvarAutomationTest.java
+++ b/src/test/java/io/jenkins/plugins/ProvarAutomationTest.java
@@ -50,6 +50,10 @@ public class ProvarAutomationTest {
final String testPlan = "Regression";
final String testFolder = "all";
final String environment = "Dev";
+ static String windowsLicensePath = "C:/Users/" + System.getProperty("user.name") + "/Provar/.licenses";
+ static String unixLicensePath = System.getenv("HOME") + "/Provar/.licenses";
+ static String osName = System.getProperty("os.name");
+ final String licensePath = osName.contains("Windows") ? windowsLicensePath : unixLicensePath;
final ProvarAutomation.Browser browser = ProvarAutomation.Browser.Safari;
final Secret secretsPassword = Secret.fromString("ProvarSecretsPasssword");
final ProvarAutomation.SalesforceMetadataCacheSettings salesforceMetadataCacheSetting = ProvarAutomation.SalesforceMetadataCacheSettings.Reload;
@@ -61,7 +65,7 @@ public class ProvarAutomationTest {
@Test
public void testConfigRoundtrip() throws Exception {
FreeStyleProject p = jr.createFreeStyleProject();
- p.getBuildersList().add(new ProvarAutomation(provarAutomationName, buildFile, testPlan, testFolder, environment, browser, secretsPassword, salesforceMetadataCacheSetting, resultsPathSetting, projectName));
+ p.getBuildersList().add(new ProvarAutomation(provarAutomationName, buildFile, testPlan, testFolder, environment, browser, secretsPassword, salesforceMetadataCacheSetting, resultsPathSetting, projectName, licensePath));
WebClient webClient = jr.createWebClient();
HtmlPage page = webClient.getPage(p,"configure");
@@ -81,6 +85,7 @@ public void testConfigRoundtrip() throws Exception {
assertEquals(salesforceMetadataCacheSetting,pa.getSalesforceMetadataCacheSetting());
assertEquals(resultsPathSetting,pa.getResultsPathSetting());
assertEquals(projectName,pa.getProjectName());
+ assertEquals(licensePath, pa.getLicensePath());
}
// TODO: Add tests for validations of file paths, specifically the build file.
// TODO: Add testing for downloading of Provar CLI, extraction, and env var set.
@@ -91,7 +96,7 @@ public void testConfigRoundtrip() throws Exception {
@Test
public void testBuild() throws Exception {
FreeStyleProject project = jr.createFreeStyleProject();
- ProvarAutomation builder = new ProvarAutomation(provarAutomationName, buildFile, testPlan, testFolder, environment, browser, secretsPassword, salesforceMetadataCacheSetting, resultsPathSetting, projectName);
+ ProvarAutomation builder = new ProvarAutomation(provarAutomationName, buildFile, testPlan, testFolder, environment, browser, secretsPassword, salesforceMetadataCacheSetting, resultsPathSetting, projectName, licensePath);
project.getBuildersList().add(builder);
FreeStyleBuild build = jr.assertBuildStatus(Result.FAILURE, project.scheduleBuild2(quietPeriod).get());
jr.assertLogContains("Running the build file: " + buildFile, build);
@@ -103,8 +108,20 @@ public void testBuild() throws Exception {
jr.assertLogContains("Results Path Setting: " + resultsPathSetting, build);
jr.assertLogContains("Project Folder: " + projectName, build);
jr.assertLogContains("Project is encrypted! Thank you for being secure.", build);
+ jr.assertLogContains("Execution license path being used: " + licensePath, build);
}
+ // TODO: Add test for license path and license file
+// @Test
+// public void testLicense() throws Exception {
+///* FreeStyleProject project = jr.createFreeStyleProject();
+// ProvarAutomation builder = new ProvarAutomation(provarAutomationName, buildFile, testPlan, testFolder, environment, browser, secretsPassword, salesforceMetadataCacheSetting, resultsPathSetting, projectName, licensePath);
+// project.getBuildersList().add(builder);
+// FreeStyleBuild build = jr.assertBuildStatus(Result.FAILURE, project.scheduleBuild2(quietPeriod).get());
+// Path path = Paths.get("does-not-exist.txt");
+// assertFalse(Files.exists(path));*/
+// }
+
@Test
public void testScriptedPipeline() throws Exception {
String agentLabel = "my-agent";
@@ -121,7 +138,8 @@ public void testScriptedPipeline() throws Exception {
+ " secretsPassword: '" + secretsPassword + "',\n"
+ " salesforceMetadataCacheSetting: '" + salesforceMetadataCacheSetting + "',\n"
+ " resultsPathSetting: '" + resultsPathSetting + "',\n"
- + " projectName: '" + projectName + "'\n"
+ + " projectName: '" + projectName + "',\n"
+ + " licensePath: '" + licensePath + "'\n"
+ "}";
job.setDefinition(new CpsFlowDefinition(pipelineScript, true));