0

i have below code

package runner;

import java.util.stream.Stream;

public class PiccoloRunnerMain {

    private static String[] defaultOptions = {
            "--plugin", "pretty",
            "--plugin", "html:target/fix-api-results.html",
            "--plugin", "summary",
            "--glue", "cukestep",
            "--tags", "@T1",
            "src/main/resources/features/"
    };

    public static void main(String args[]){
        try{
            Stream<String> cucumberOptions = Stream.concat(Stream.of(defaultOptions), Stream.of(args));
            io.cucumber.core.cli.Main.main(cucumberOptions.toArray(String[]::new));
        }catch(Exception e){
            System.out.println(e);
        }
    }
}

but after generating uberjar file using gradle , when i run test its throwing error

java.lang.IllegalArgumentException: path must exist: /Users/abcd/repo/qa-orchestra/src/main/resources/features

how I to pass feature file to cucumber cli?

task uberJar(type: Jar) {
    manifest {
        attributes 'Main-Class': "$mainClassName"
    }
    from configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) }
    baseName(project.name)
    with jar
}

this is how I am generating jar file. or this is the issue with jar?

bugCracker
  • 3,656
  • 9
  • 37
  • 58

1 Answers1

0

answer is here in one of the comments. Running Cucumber tests directly from executable jar

bugCracker
  • 3,656
  • 9
  • 37
  • 58