简体   繁体   English

如何在Gradle中运行单个Serenity测试运行程序类(其中几个)?

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

I'm using Serenity + JBehave in Java, run by Gradle. 我正在由Gradle运行的Java中使用Serenity + JBehave。 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 您可以在build.gradle中执行以下操作,因此无论何时运行

task runSpecificRunner(type: Test) {

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

Then run ./gradlew runSpecificRunner aggregate, you will see only that specific runner will be executed. 然后运行./gradlew runSpecificRunner聚合,您将只看到将执行的特定运行器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Serenity 测试未与 Serenity Parameterized Runner 一起运行 - Serenity test not running with Serenity Parameterized Runner 如何在不使用 Maven 的情况下从 CLI 运行 Cucumber Test runner - How can I run Cucumber Test runner from CLI without using Maven intelliJ 如何运行 gradle 任务作为测试 - How can intelliJ run gradle task as test 仅在通过另一个测试的情况下才能运行测试类? - How can I run a test class only if another test was passed? 如何使用宁静框架在 selenium 中循环 10 次单个测试 - How to loop 10 times a single test in selenium using serenity framework 从多个罐中的单个罐中加载课程 - Loading a class from single jar among several jars 如何在Gradle中为单个测试类并行执行JUnit测试 - How to execute JUnit tests in parallel for a single test class in Gradle 当使用 Serenity 出现故障时,如何继续运行其他步骤? - How can I continue to run other steps when there is a failure using Serenity? 如何实例化远程Web驱动程序,以便我可以在Java和Selenium中通过Serenity并行运行测试 - How to instantiate Remote Web Driver so I can run tests in parallel using Java and Selenium with Serenity 除了使用集成测试运行器在IntelliJ IDEA项目中以“IntegrationTest”结尾的所有JUnit单元测试之外,我该如何运行? - How can I run all JUnit unit tests except those ending in “IntegrationTest” in my IntelliJ IDEA project using the integrated test runner?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM