I have a end to end test suite with features marked with @e2e tag. The features are within different modules namely WNG, DTC, FFD with their own tags(like @e2eWNG, @e2eDTC, @e2eFFD) along with @e2e. Each of the modules can run independently and I wish to parallelise the test execution. For example tags with @e2eWNG can run on a single thread, @e2eDTC can run on another thread and so on.
Right now I just run all tests with tags @e2e and this is sequential.
I had a look at https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/DemoTestParallel.java as an example but I could not figure out how to separate the threads by tags.
I tried doing this based on a solution mentioned here - Is it possible to generate Cucumber HTML Reports with Karate's JUnit5 fluent API? and this is what I did in my test runner class
Results DTC = Runner.path("classpath:").tags("@e2eDTC").reportDir("target/cucumber-html-reports").parallel(1);
Results WNG = Runner.path("classpath:").tags("@e2eWNG").reportDir("target/cucumber-html-reports").parallel(1);
Results FFD = Runner.path("classpath:").tags("@e2eFFD").reportDir("target/cucumber-html-reports").parallel(1);
assertTrue(DTC.getErrorMessages(), DTC.getFailCount() == 0);
assertTrue(WNG.getErrorMessages(), WNG.getFailCount() == 0);
assertTrue(FFD.getErrorMessages(), FFD.getFailCount() == 0);
generateReport(DTC.getReportDir());
generateReport(WNG.getReportDir());
generateReport(FFD.getReportDir());
But I do understand this is again sequential. Just wanted to know if there is way we can parallelise the execution separated by tags. I may be missing something but any suggestions would be really helpful.