首页 > 解决方案 > Cucumber 没有创建文件夹,而是创建了一个文件

问题描述

我试图创建一个名为HtmlReportsusing cucumber pretty 的文件夹。当我运行 Runner 类时,它创建了一个HtmlReports文件而不是创建一个文件夹。

这是我的代码。

package Stepdefinition;

import org.junit.runner.RunWith;

import io.cucumber.junit.CucumberOptions;
import io.cucumber.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(features="src/test/resources/Features",
monochrome = true,
plugin={"pretty","html:target/HtmlReports"}
)
public class Testrunner {

    
}

这是创建的文件的屏幕截图

有人可以帮我吗?

标签: directorycucumber

解决方案


在 Cucumber v6 中,html 格式化程序得到了一些改进。它现在输出一个单页 html 报告。您可以通过添加.html扩展名来打开它。

@CucumberOptions(plugin = "html:target/cucumber-report.html")

推荐阅读