我如何在 Jenkins 里面 运行 Katalon 测试套件 Docker

How do I run Katalon test suite in Jenkins inside Docker

我有一个 Katalon 测试套件设置,它 运行 在 UI 和我安装了 Katalon studio 的机器上的 CLI 中非常棒。

我在 docker 容器中有 Jenkins CI 服务器 运行ning,我想在该 Jenkins 服务器上为 运行 我的测试套件设置一个作业.

我需要在 Jenkins 服务器上 运行 多长时间才能 运行 Katalon 作业?是否有 运行时间或 Jenkins 的插件?

如果没有,是否有 Katalon 的 docker 容器,我可以使用它通过 jenkins 远程 运行 作业,比如 SonarQube 的东西?

编辑 - 来自 Katalon 支持的新答案

我收到了来自 Katalon 支持的新回复:

First of all, I would to sorry for my answer due to I'm not giving out the proper one based on your question. I've reviewed again your question and see Katalon Studio have Linux version (http://download.katalon.com/4.8.0/Katalon_Studio_Linux_64-4.8.tar.gz) for console mode execution and it's ideally to package it into your dockerfile.

更像是这样,根据此处的文档,使用 Docker:

应该非常简单

https://docs.katalon.com/display/KD/Console+Mode+Execution

Hope this answer resolve your question better :).

编辑结束


原版

我在 Katalon Studio 网站上创建了一张票,询问同样的问题,我得到了这个(可笑的)回复:

First of all, there is no Dockerfile for Katalon Studio. It will be hard and complicated to do this and we also do not have a plan to do it in the future :). But we will try to consider with your request to see if there is any applicable adjustment to this case.

换句话说,没有Docker解。很遗憾我们不能将它用于我们的 CI 东西,因为我所做的原型设计取得了很好的效果。

好吧。

Katalon Studio 确实有 Linux 的专用版本(http://download.katalon.com/4.8.0/Katalon_Studio_Linux_64-4.8.tar.gz). It utilizes console mode Katalon Studio,当然你可以将它打包到你的 Jenkins 容器中。这种方法将适应你的场景:)。

您可以在此处和 Docker 中心找到它。但我不喜欢它需要被 email/password 激活。所以它使构建变慢。我打算制作自己的 docker 图像,包括我激活的 Katalon 工作室。 他们似乎不太支持CI。

https://github.com/katalon-studio/katalon-studio-docker

好的,我发现了:使用 "sudo docker cp /sourcefolder/Katalon_folder/ ContainerId:/destination_folder"

脚本也是如此。下一步是安装 Firefox / geckodriver。

由于接受的答案已超过两年,有些事情发生了变化,现在 Docker Hub:

上有 Katalon 的官方 Docker 图片
docker pull katalonstudio/katalon

有关各种 CI 工具的示例项目配置,请转到 here

这是一个 Jenkins 文件示例:

pipeline {
    agent {
        docker {
            image 'katalonstudio/katalon'
            args "-u root"
        }
    }
    stages {
        stage('Test') {
            steps {
                sh 'katalon-execute.sh -browserType="Chrome" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/TS_RegressionTest"'
            }
        }
    }
    post {
        always {
            archiveArtifacts artifacts: 'report/**/*.*', fingerprint: true
            junit 'report/**/JUnit_Report.xml'
        }
    }
}