“Serenity Report不会在本地执行测试时生成。”

huangapple go评论97阅读模式
英文:

Serenity Report aren't generated in case test is executed locally

问题

我已更新Serenity版本。我们使用了3.3.2版本,我已更新到最新的3.9.8版本。新版本破坏了Serenity报告生成。如果我们在本地使用JUnit Runner运行测试,报告不再生成:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
    plugin = {"pretty"},
    glue = {"com.vicoland"},
    tags = {"not @ignore and @single"},
    features = "src/test/resources/features"
)
public class RunSingleTest {
}

当使用Maven运行测试时,报告会生成,因为我们从Maven插件执行Serenity报告生成。有人知道在使用上述Runner在IntelJIdea本地执行测试时,需要进行哪些额外配置以生成报告吗?

英文:

I updated the serenity version. We used the 3.3.2 version and I updated to use the most recent one 3.9.8. The new version broke the serenity report generation. The report is not generated anymore in case we are running the test locally with a JUnit Runner:

@RunWith(CucumberWithSerenity.class)
@CucumberOptions(
    plugin = {"pretty"},
    glue = {"com.vicoland"},
    tags = ("not @ignore and @single"),
    features = "src/test/resources/features"
)
public class RunSingleTest {
}

The reports are generated in case the tests are running with maven since we are executing the serenity report generation from maven plugin.

Somebody knows which additional configuration should be make in order to generate the report when the tests are executed locally in IntelJIdea using the above Runner?

答案1

得分: 0

我在本地测试执行期间启用了DEBUG模式。看起来默认的报告模式已从HTML更改为JSON:

DEBUG n.t.core.reports.ReportService - 报告格式:[HTML]

我在serenity.conf文件中更改为使用html作为输出格式:output.formats=html

之后,HTML报告被生成,并在测试日志中启用。

英文:

I enabled the DEBUG mode during the local test execution. It seems the default reporting mode was moved to JSON from HTML:

DEBUG n.t.core.reports.ReportService - Reporting formats: [HTML]

I changed inside the serenity.conf to use the html as output format: output.formats=html

After this the html report was generated and it was enabled inside the test's log.

huangapple
  • 本文由 发表于 2023年8月4日 22:00:25
  • 转载请务必保留本文链接:https://go.coder-hub.com/76836648.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定