简体   繁体   English

使用与黄瓜集成的柑橘框架进行并行集成测试执行

[英]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.

相关问题 如何集成Citrus框架和BBD Cucumber - How to integration Citrus framework and BBD Cucumber 使用Citrus Framework传递测试变量以进行测试 - Passing test variables to test using Citrus Framework Citrus Framework-使用Spring Integration通过SFTP上传文件 - Citrus Framework - upload file via SFTP using Spring Integration 如何在各自的测试文件夹中为每个测试生成 cucumber.json(我使用的是 Cucumber 5,它使用 Z0F10ECB7756532AE8DAE8CA448 进行并行执行) - How to generate cucumber.json per test in respective test folders (I am using Cucumber 5 which uses TestNG for parallel execution) 如何设置cucumber testng框架并行执行的线程数? - How to set the thread count in parallel execution of cucumber testng framework? Cucumber JVM 4.0.0和Junit测试运行程序不会发生并行执行 - Parallel Execution not happening with Cucumber JVM 4.0.0 and Junit test runner JUnit 5 + Cucumber 并行测试执行不适用于文件安全(Maven) - JUnit 5 + Cucumber parallel test execution doesn't work with filesafe (Maven) Excel 自动化与 Cucumber 框架集成 - Excel automation integrated with Cucumber framework 如何使用 cucumber 挂钩退出测试执行 - How to quit test execution using cucumber hooks Citrus 框架:接收超时时不失败测试 - Citrus framework: not fail test on receive timeout
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM