in src/main/java/org/jenkinsci/plugins/awsdevicefarm/AWSDeviceFarmRecorder.java [1175:1364]
private boolean validateTestConfiguration(@Nonnull PrintStream log) {
TestType testType = stringToTestType(testToRun);
switch (testType) {
case BUILTIN_FUZZ: {
// [Optional]: EventCount (int)
if (eventCount != null && !eventCount.isEmpty()) {
if (!eventCount.matches("^\\d+$")) {
writeToLog(log,"EventCount must be a number.");
return false;
}
}
// [Optional]: Seed (int)
if (seed != null && !seed.isEmpty()) {
if (!seed.matches("^\\d+$")) {
writeToLog(log, "Seed must be a number.");
return false;
}
}
break;
}
case BUILTIN_EXPLORER: {
break;
}
case APPIUM_JAVA_JUNIT: {
if (appiumJavaJUnitTest == null || appiumJavaJUnitTest.isEmpty()) {
writeToLog(log, "Appium Java Junit test must be set.");
return false;
}
break;
}
case APPIUM_JAVA_TESTNG: {
if (appiumJavaTestNGTest == null || appiumJavaTestNGTest.isEmpty()) {
writeToLog(log, "Appium Java TestNG test must be set.");
return false;
}
break;
}
case APPIUM_PYTHON: {
if (appiumPythonTest == null || appiumPythonTest.isEmpty()) {
writeToLog(log, "Appium Python test must be set.");
return false;
}
break;
}
case APPIUM_RUBY: {
if (appiumRubyTest == null || appiumRubyTest.isEmpty()) {
writeToLog(log, "Appium Ruby test must be set.");
return false;
}
break;
}
case APPIUM_NODE: {
if (appiumNodeTest == null || appiumNodeTest.isEmpty()) {
writeToLog(log, "Appium Node test must be set.");
return false;
}
break;
}
case APPIUM_WEB_JAVA_JUNIT: {
if (appiumJavaJUnitTest == null || appiumJavaJUnitTest.isEmpty()) {
writeToLog(log, "Appium Java Junit test for the web application must be set.");
return false;
}
break;
}
case APPIUM_WEB_JAVA_TESTNG: {
if (appiumJavaTestNGTest == null || appiumJavaTestNGTest.isEmpty()) {
writeToLog(log, "Appium Java TestNG test for the web application must be set.");
return false;
}
break;
}
case APPIUM_WEB_PYTHON: {
if (appiumPythonTest == null || appiumPythonTest.isEmpty()) {
writeToLog(log, "Appium Python test for the web application must be set.");
return false;
}
break;
}
case APPIUM_WEB_RUBY: {
if (appiumRubyTest == null || appiumRubyTest.isEmpty()) {
writeToLog(log, "Appium Ruby test for the web application must be set.");
return false;
}
break;
}
case APPIUM_WEB_NODE: {
if (appiumNodeTest == null || appiumNodeTest.isEmpty()) {
writeToLog(log, "Appium Node test for the web application must be set.");
return false;
}
break;
}
case CALABASH: {
// [Required]: Features Path
if (calabashFeatures == null || calabashFeatures.isEmpty()) {
writeToLog(log, "Calabash Features must be set.");
return false;
}
// [Required]: Features.zip
if (!calabashFeatures.endsWith(".zip")) {
writeToLog(log, "Calabash content must be of type .zip");
return false;
}
break;
}
case INSTRUMENTATION: {
// [Required]: Tests Artifact
if (junitArtifact == null || junitArtifact.isEmpty()) {
writeToLog(log, "JUnit tests Artifact must be set.");
return false;
}
break;
}
case UIAUTOMATOR: {
if (uiautomatorArtifact == null || uiautomatorArtifact.isEmpty()) {
writeToLog(log, "UI Automator tests artifact must be set.");
return false;
}
break;
}
case UIAUTOMATION: {
if (uiautomationArtifact == null || uiautomationArtifact.isEmpty()) {
writeToLog(log, "UI Automation tests artifact must be set.");
return false;
}
break;
}
case XCTEST: {
if (xctestArtifact == null || xctestArtifact.isEmpty()) {
writeToLog(log, "XC tests artifact must be set.");
return false;
}
break;
}
case XCTEST_UI: {
if (xctestUiArtifact == null || xctestUiArtifact.isEmpty()) {
writeToLog(log, "XCTest UI tests artifact must be set.");
return false;
}
break;
}
default: {
writeToLog(log, "Must select a test type to run.");
return false;
}
}
if (CUSTOM_ENVIRONMENT.equals(environmentToRun) && StringUtils.isBlank(testSpecName)) {
writeToLog(log, "A test Spec must be selected.");
return false;
}
return true;
}