代码如下
//robotframework excute
stage('robotframework excute'){

steps{
script {
if (penv != "null") {

[$class: 'RobotPublisher',
disableArchiveOutput: false,
logFileName: 'log.html',
otherFiles: '',
outputFileName: 'output.xml',
outputPath: '${WORKSPACE}/report',
passThreshold: 100,
reportFileName: 'report.html',
unstableThreshold: 0]
}

}
}
}

执行日志如下,script 不认识 $class: 'RobotPublisher'好像。但是如果去掉 script{},又会提示 expect a step
[Pipeline] stage
[Pipeline] { (robotframework excute)
[Pipeline] script
[Pipeline] {
[Pipeline] }
[Pipeline] // script
[Pipeline] }
[Pipeline] // stage


↙↙↙阅读原文可查看相关链接,并与作者交流