简体   繁体   English

契约合同测试入门的前提条件

[英]Pre-requisites for getting started with Pact Contract Testing

Our organisation team structure is such that there is a new independent team of testers who is supposed to do API Testing. 我们的组织团队结构使得应该有一个新的独立测试人员团队来进行API测试。 So as a member of this team, I do not have java code set up for every API project. 因此,作为这个团队的成员,我没有为每个API项目设置Java代码。

  1. So how can I write Consumer driven tests in that case? 那么在那种情况下我该如何编写消费者驱动的测试呢?
  2. Or do I need to setup every consumer java project before i start testing? 还是在开始测试之前需要设置每个消费者Java项目?
  3. Or do I need to request all the API providers/consumers about this framework and ask them to implement the same. 还是我需要请求有关此框架的所有API提供者/使用者,并要求他们实施相同的框架。

Currently, the testing is limited to manual testing via Postman and Unit Testing by developers. 目前,测试仅限于通过邮递员进行的手动测试和开发人员进行的单元测试。

Pact tests need to be part of the Consumer code base, as they are run as unit-level tests, so you will need access to the code to do so. 契约测试需要作为使用者代码库的一部分,因为它们是作为单元级测试运行的,因此您需要访问代码。

As for the Provider code base, they could arguably be kept outside of the code base (as you just need a running Provider to execute the tests) but I would strongly recommend against this for a number of reasons. 至于提供者代码库,可以说它们可以保留在代码库之外(因为您只需要一个运行中的提供者来执行测试),但是出于多种原因,我强烈建议您这样做。

Answering your questions one-by-one: 一对一回答您的问题:

  1. (see above) (往上看)
  2. Yes, or 是的,或者
  3. Yes - this is the ideal situation, freeing your team up for 'manual' or more 'exploratory' testing. 是的-这是理想的情况,可以让您的团队腾出手来进行“手动”或更多“探索性”测试。

As an aside, I would argue that having a separate team of testers is an anti-pattern. 顺便说一句,我认为拥有一个单独的测试人员团队是一种反模式。 While structurally you might have different reporting lines, what I've seen work best is if members of your Test team were virtual members of the other team and could be closely collaborating with them. 从结构上来说,您可能具有不同的报告方式,但我认为最好的是,如果您的测试团队的成员是另一个团队的虚拟成员,并且可以与他们密切合作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM