【问题标题】:Need to run @BeforeSuite when debugging TestNG in Intellij在 Intellij 中调试 TestNG 时需要运行 @BeforeSuite
【发布时间】:2014-09-11 01:39:18
【问题描述】:

我正在尝试在 IntelliJ 中调试 TestNG 测试,它是测试自动化套件的一部分。但是,在该测试可以运行之前,我需要运行标记为@BeforeSuite 的方法中包含的代码。

如何配置 IntelliJ 以在调试测试时自动运行 @BeforeSuite 中的代码?

【问题讨论】:

    标签: java intellij-idea testng


    【解决方案1】:

    如果标记为@BeforeSuite 的方法在同一个类中,那么它将在您的@Test 方法之前自动运行。您只需将调试点保留在@BeforeSuite 方法中即可。

    【讨论】:

      【解决方案2】:

      解决方法:

      我发现我可以指定调试“组”中的所有测试。我可以用一组“Debug”标记我的@BeforeSuite 类和我正在测试的方法。

      然后在 Intellij 运行配置中,我告诉它运行“调试”组。

      瞧。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-18
        • 1970-01-01
        • 2014-05-31
        • 1970-01-01
        相关资源
        最近更新 更多