简体   繁体   中英

How to run cucumber-gradle automation test script parrallely as well as in sequence manner?

  1. I am writing Web based application automation test script using cucumber,selenium webdriver, Java and gradle.
  2. I have around some 25 feature files.
  3. I need to test this 25 feature files parallel as well as in sequence manner.
  4. Currently, I am running the one test at a time by using test name.
  5. Is there any way to run the test in parallel as well as concurrent manner?

You can do parallel execution if you provide different cucumber runner classes.

Then you can configure the Test tasks in Gradle to run in parralel:

tasks.withType(Test) {
    maxParallelForks = 4
}

And you need to define a test Task which executes your cucumber runners (in this example all have a Cucumber in their classname)

task cucumberTests(type: Test){ 
   includes = ['**/*Cucumber*'] 
}

Maybe this will help you

PS Regarding the sequential running: Cucumber doesn't guarante any running order of the different feature files

If you are open to using Maven, here is the example I used. Worked great for me!

https://opencredo.com/running-cucumber-jvm-tests-in-parallel/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM