简体   繁体   中英

How can I run a single Serenity test runner class (among several) in Gradle?

I'm using Serenity + JBehave in Java, run by Gradle. I have several test runner classes pointing at different sets of stories. I need to be able to specify which one I run. One runner file is below to give an example of my implementation there.

import net.serenitybdd.jbehave.SerenityStories;

public class Debug extends SerenityStories {

    public Debug() {
        findStoriesIn("**/ldap");
    }
}

You can do following in build.gradle, so when ever you run

task runSpecificRunner(type: Test) {

    include '**/**YOURRunnerName.class'
}

Then run ./gradlew runSpecificRunner aggregate, you will see only that specific runner will be executed.

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