Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Using steps in testNG @Factory throw error

未关闭
#367 0 条评论 5 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
30/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
java
领域
testing

调研方向

首先,使用列出的 Allure 和 TestNG 版本以及 @Steps 调用,复现所示 TestNG @Factory 方法中的失败。跟踪 factoryMethod 周围的生命周期,并验证预期的步骤文本能够显示,且不会出现报告中的 no-test 或 no-step 错误。

由索引模型根据 Issue 内容生成。

描述

I'm submitting a ...
  • bug report
What is the current behavior?
If you use the steps in the factory, the allures writes an error
18:34:28.258 ERROR io.qameta.allure.AllureLifecycle Could not start step: no test case running
18:34:28.259 ERROR io.qameta.allure.AllureLifecycle Could not start step: no test case running
18:34:28.702 ERROR io.qameta.allure.AllureLifecycle Could not add attachment: no test is running
18:34:30.011 ERROR io.qameta.allure.AllureLifecycle Could not add attachment: no test is running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not update step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not stop step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not update step: no step running
18:34:30.022 ERROR io.qameta.allure.AllureLifecycle Could not stop step: no step running
Example:
public class CountersTestFactory {

  @Factory
  public synchronized Object[] factoryMethod() throws Exception {
    // next two lines it @Steps
    Campaign campaign = CampaignSteps.createDefault(user.get().getApiKey());
    SocketIOSteps.waitForcampaignCollected(campaignId);

    assertThat(
        "campaign",
        CampaignDataSteps.getList(user.get().getApiKey(), campaign.id).result.size(),
        greaterThan(0));

    return new Object[] {
      new CountersCurrentTest(
          user.get().getApiKey(),
          campaign.id,
          DateUtils.getTimestampMinusDays(90),
          DateUtils.getTimestamp()),
}

What is the expected behavior?

@ Step displayed annotation text

Please tell us about your environment:
Allure version 2.12.1
Test framework [email protected]
Allure integration [email protected]
Generate report using [email protected]
Other information
主要语言
Java
星标
390
派生
242
平均合并
2 天 14 小时
30 天内合并 PR
13

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

allure-framework/allure-java 的其他 Issue

查看 allure-framework/allure-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。