wttech / bobcat

Bobcat is an automated testing framework for functional testing of web applications.
https://cognifide.github.io/bobcat/
Apache License 2.0
90 stars 40 forks source link

How to run concurrent Cucumber tests? #154

Closed ghost closed 7 years ago

ghost commented 7 years ago

Hi, I have a question.

I added maven surefire plugin, and defined the forkCount but tests are running in 1 thread only.

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.16</version>
                <configuration>
                    <forkCount>5</forkCount>
                    <reuseForks>true</reuseForks>
                    <systemPropertyVariables>
                        <webDriver.type>${webDriver.type}</webDriver.type>
                        <configuration.paths>${configuration.paths}</configuration.paths>
                        <content.path>${content.path}</content.path>
                    </systemPropertyVariables>
                </configuration>
            </plugin>

My Test Runner. Features are provided explicitly from within maven command line (Run configuration in Eclipse)

@RunWith(Cucumber.class)
@CucumberOptions(
    plugin = {"pretty", "html:target/cucumber-html-report/automation",
        "json:target/automation.json",
        "junit:target/junit-report/automation.xml"
    },
    glue = "com.java"
    monochrome = true
)
public class TestRunner {

}

My question - what do I do wrong? Bobcat version 1.1.3

kkarolk commented 7 years ago

Hi F3Ni0, thanks for your question.

The reason why your tests are still running in one thread is that you have only one test runner class. Bobcat is using Cucumber-JVM for running tests written in Gherkin so the parallelization is based on test runner classes. If you want to run tests in two threads you'll have to have at least two runner classes, for three - at least three and so on.