0
votes

I'm using citrus framework integrated with cucumber for integration test (having different Cucumber feature files).

I have different HTTP rest services configured in citrus.

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.

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.

1

1 Answers

0
votes

Citrus tests are run by TestNG or JUnit, so you need to use these frameworks' parallel execution techniques.

I am executing my integration tests with Maven's failsafe-plugin (using TestNG). You can configure it to run tests in parallel using a profile like the following (also see the maven-failsafe-plugin documentation).

<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.

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. 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.

Give it a try and see if parallel tests work for you.