[英]Parallel integration test execution using citrus framework integrated with cucumber
I'm using citrus framework integrated with cucumber for integration test (having different Cucumber feature files). 我使用与黄瓜集成的柑橘框架进行集成测试(具有不同的Cucumber功能文件)。
I have different HTTP rest services configured in citrus. 我在柑橘中配置了不同的HTTP Rest服务。
Could you please suggest me how I can execute the integration tests in parallel. 您能否建议我如何并行执行集成测试。
Integration tests are using those citrus services. 集成测试正在使用这些柑橘服务。 I need to use some (context)variables to validate some test results for all scenarios defined in the Cucumber feature files.
我需要使用一些(上下文)变量来验证Cucumber功能文件中定义的所有方案的某些测试结果。
Or could you please suggest me whether multithreading is supported by the citrus framework so that multiple cucumber scenarios can invoke a HTTP service at the same time. 或者您能否建议我citrus框架是否支持多线程,以便多个黄瓜方案可以同时调用HTTP服务。
Citrus tests are run by TestNG or JUnit, so you need to use these frameworks' parallel execution techniques. Citrus测试由TestNG或JUnit运行,因此您需要使用这些框架的并行执行技术。
I am executing my integration tests with Maven's failsafe-plugin (using TestNG). 我正在使用Maven的failsafe-plugin(使用TestNG)执行集成测试。 You can configure it to run tests in parallel using a profile like the following (also see the maven-failsafe-plugin documentation ).
您可以使用以下配置文件将其配置为并行运行测试(另请参见maven-failsafe-plugin文档 )。
<profiles>
<profile>
<id>parallel</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<parallel>methods</parallel>
<threadCount>10</threadCount>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
This works for TestNG, but I am not sure if it works for JUnit. 这适用于TestNG,但是我不确定它是否适用于JUnit。
Usually, parallel HTTP requests should not be a problem for Citrus, since it automatically correlates HTTP send and receive action within the same test case. 通常,并行HTTP请求对于Citrus来说应该不是问题,因为它会自动在同一测试用例中关联HTTP发送和接收操作。 However, you need to be aware that this does not work for JMS messages, for which you need to manually set a correlation id when sending and use a selector for this correlation id when receiving.
但是,您需要注意,这不适用于JMS消息,对于JMS消息,您需要在发送时手动设置相关ID,并在接收时为该相关ID使用选择器。
Give it a try and see if parallel tests work for you. 尝试一下,看看并行测试是否对您有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.