2019-01-31 10:16:34 +02:00
|
|
|
import com.sap.piper.ConfigurationHelper
|
|
|
|
import com.sap.piper.GitUtils
|
|
|
|
import com.sap.piper.Utils
|
2019-10-23 13:38:31 +02:00
|
|
|
import groovy.text.GStringTemplateEngine
|
2019-01-31 10:16:34 +02:00
|
|
|
import groovy.transform.Field
|
|
|
|
|
|
|
|
import static com.sap.piper.Prerequisites.checkScript
|
|
|
|
|
|
|
|
@Field String STEP_NAME = getClass().getName()
|
2021-01-28 12:31:24 +02:00
|
|
|
@Field String METADATA_FILE = 'metadata/uiVeri5ExecuteTests.yaml'
|
2019-01-31 10:16:34 +02:00
|
|
|
|
2021-01-28 12:31:24 +02:00
|
|
|
/*
|
|
|
|
* Parameters read from config for backwards compatibility of groovy wrapper step:
|
2019-01-31 10:16:34 +02:00
|
|
|
*
|
2021-01-28 12:31:24 +02:00
|
|
|
* testRepository, gitBranch, gitSshKeyCredentialsId used for test repository loading
|
2019-01-31 10:16:34 +02:00
|
|
|
*/
|
2021-01-28 12:31:24 +02:00
|
|
|
@Field Set CONFIG_KEYS = [
|
|
|
|
"gitBranch",
|
|
|
|
"gitSshKeyCredentialsId",
|
|
|
|
"testRepository",
|
|
|
|
]
|
2019-01-31 10:16:34 +02:00
|
|
|
|
2021-01-28 12:31:24 +02:00
|
|
|
void call(Map parameters = [:]) {
|
|
|
|
final script = checkScript(this, parameters) ?: this
|
|
|
|
String stageName = parameters.stageName ?: env.STAGE_NAME
|
|
|
|
def utils = parameters.juStabUtils ?: new Utils()
|
|
|
|
Map config = ConfigurationHelper.newInstance(this)
|
2020-08-26 15:32:58 +02:00
|
|
|
.loadStepDefaults([:], stageName)
|
2021-01-28 12:31:24 +02:00
|
|
|
.mixinGeneralConfig(script.commonPipelineEnvironment, CONFIG_KEYS)
|
|
|
|
.mixinStepConfig(script.commonPipelineEnvironment, CONFIG_KEYS)
|
|
|
|
.mixinStageConfig(script.commonPipelineEnvironment, stageName, CONFIG_KEYS)
|
|
|
|
.mixin(parameters, CONFIG_KEYS)
|
2019-01-31 10:16:34 +02:00
|
|
|
.use()
|
|
|
|
|
2021-01-28 12:31:24 +02:00
|
|
|
if (parameters.testRepository || config.testRepository ) {
|
2021-03-17 09:08:33 +02:00
|
|
|
parameters.stashContent = [GitUtils.handleTestRepository(this, [gitBranch: config.gitBranch, gitSshKeyCredentialsId: config.gitSshKeyCredentialsId, testRepository: config.testRepository])]
|
2019-01-31 10:16:34 +02:00
|
|
|
}
|
|
|
|
|
2021-01-28 12:31:24 +02:00
|
|
|
List credentials = [
|
|
|
|
[type: 'usernamePassword', id: 'seleniumHubCredentialsId', env: ['PIPER_SELENIUM_HUB_USER', 'PIPER_SELENIUM_HUB_PASSWORD']],
|
|
|
|
]
|
|
|
|
piperExecuteBin(parameters, STEP_NAME, METADATA_FILE, credentials)
|
2019-01-31 10:16:34 +02:00
|
|
|
}
|