Multi user support while running feature file in paralle

gradle-core

(shashi yadav) #1

I want to Run Cucumber feature File in Parallel and also every feature file should execute with different user .I have stored my users in gradle.properties file.
I have achieved the task of running feature in Parallel but not able to do multi user support.
Please help me how can i achieve this multi user support for parallel execution of feature file.
My task looks like this:
task demoCucumberParallel {
dependsOn compileTestJava
doLast {
def features = fileTree(dir: “${project.projectDir}/src/test/resources/features/”).include ‘**/feature

   GParsPool.withPool(5)
    {       
           
       features.eachParallel { File file ->               
          
                    try {                 
             javaexec {
                main = "cucumber.api.cli.Main" 
        classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
     
        //  args = ['--plugin', 'com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html','--glue', 'stepDefinitions', 'src/test/resources']
          args = ['--plugin', 'com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report'+file.getName()+'.html','--glue', 'stepDefinitions', file]
       
   }   
          } catch (Exception ignore) {
            
          }                    
           
           
       }  
   }        
}

}