[英]What is the best way to create a test automation suite as a service
I am trying to create the following setup : 我正在尝试创建以下设置:
My goal is that this implementation should be executable by any framework irrespective of the technology that the framework uses. 我的目标是,无论框架使用何种技术,该实现都应可由任何框架执行。 I was thinking of creating the project as a WebService using Java (servlet).
我当时正在考虑使用Java(servlet)将项目创建为Web服务。
My question is: 我的问题是:
Thanks in advance. 提前致谢。
You can create a maven project and have your automated tests under maven test folder.Configure your tests to run through POM.xml(use maven surefire plugin).Configure a jenkins job to run the maven test.Anybody with access the jenkins can build/run this task! 您可以创建一个maven项目并在maven测试文件夹下进行自动化测试。将您的测试配置为通过POM.xml运行(使用maven surefire插件)。配置一个jenkins作业以运行该maven测试。任何有权访问jenkins的人都可以构建/运行此任务!
Below link should give you a headstart http://learn-automation.com/selenium-integration-with-jenkins/ 下面的链接应该为您提供领先的机会http://learn-automation.com/selenium-integration-with-jenkins/
As a matter of fact, it is something we did on one of our projects. 事实上,这是我们在一个项目中所做的。 As I cannot share specifics, I will give you overall architectural view of the project.
由于无法共享细节,因此我将为您提供该项目的总体架构视图。
The core of all things was a service that could run JUnit tests on requests. 万物的核心是可以对请求运行JUnit测试的服务。 It was a Soap web-service, but nothing stops you from making it REST.
这是一个Soap网络服务,但是没有什么可以阻止您使其成为REST。 To implement this you need to implement your version of JUnit test runners (see for example: http://www.mscharhag.com/java/understanding-junits-runner-architecture or https://github.com/junit-team/junit4/wiki/Test-runners )
要实现这一点,您需要实现您的JUnit测试运行程序的版本(例如,请参见: http : //www.mscharhag.com/java/understanding-junits-runner-architecture或https://github.com/junit-team/ junit4 / wiki / Test-runners )
If you use JUnit as test framework for running your Selenuim tests this may be a great solution for you - JUnit will generate HTML reports for you if you configure it properly, it will hide actual test suite implementation from users and run test suite on demand. 如果将JUnit用作运行Selenuim测试的测试框架,那么这可能是一个不错的解决方案-如果配置正确,JUnit将为您生成HTML报告,它将对用户隐藏实际的测试套件实现,并按需运行测试套件。 This solution is also great because it operates on JUnit level and does not care about what kind of tests it actually runs, so it can be also reused for any other kind of automated tests.
该解决方案也很棒,因为它在JUnit级别上运行,并且不关心它实际运行的是哪种测试,因此它也可以重用于任何其他类型的自动化测试。
So to answer all your questions: 因此,回答所有问题:
Can this implementation be accessed by any external automation framework ? 任何外部自动化框架都可以访问此实现吗? -> yes, it can be accessed by anybody who able send http requests
->是的,任何能够发送http请求的人都可以访问它
Are there any limitations to this implementation? 此实现是否有任何限制? -> none that I am aware of
->我不知道的
Is there a better way to implement this requirement? 有没有更好的方法来实现此要求? -> well, I didn't actually work with TestNG much so I don't know if it is easier or more difficult to do it on Junit level.
->好吧,我实际上并没有过多地使用TestNG,所以我不知道在Junit级别上做起来更容易或更困难。 You can use Jenkins or other CI tool as well to achieve same results - they can run JUnit tests for you and almost always have API ready for this, although those APIs may be not perfect.
您也可以使用Jenkins或其他CI工具获得相同的结果-它们可以为您运行JUnit测试,并且几乎总是为此准备好API,尽管这些API可能并不完美。
So I'd say that if you need this only for one thing you can use CI tools for this purpose, if you don't have CI tools available then choice has been made for you. 因此,我想说的是,如果您只需要一件事情,就可以使用CI工具,如果您没有CI工具,那么您就可以选择了。 However, from our experience, having this kind of service was a great asset for a company and I really wonder why there's no such products available elsewhere yet.
但是,根据我们的经验,提供这种服务对公司来说是一笔巨大的财富,我真的很奇怪为什么在其他地方还没有这样的产品。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.