首页 > 解决方案 > 在黄瓜文件中的“漂亮”中出现错误

问题描述

运行测试运行程序文件时出现以下错误,有人可以建议在更改报告的不同版本后如何解决这个问题,仍然面临同样的错误

cucumber.runtime.CucumberException: Only one formatter can use STDOUT, now both pretty and pretty use it. If you use more than one formatter you must specify output path with PLUGIN:PATH_OR_URL
at cucumber.runtime.formatter.PluginFactory.defaultOutOrFailIfAlreadyUsed(PluginFactory.java:185)
at cucumber.runtime.formatter.PluginFactory.convertOrNull(PluginFactory.java:144)
at cucumber.runtime.formatter.PluginFactory.instantiate(PluginFactory.java:99)
at cucumber.runtime.formatter.PluginFactory.create(PluginFactory.java:87)
at cucumber.runtime.RuntimeOptions.getPlugins(RuntimeOptions.java:245)
at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:291)
at com.sun.proxy.$Proxy14.done(Unknown Source)
at cucumber.runtime.junit.JUnitReporter.done(JUnitReporter.java:227)
at cucumber.api.junit.Cucumber.run(Cucumber.java:101)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

测试运行文件:-

    package com.ntrs.msf.runner;

import java.io.File;

import org.junit.AfterClass;
import org.junit.runner.RunWith;

import com.cucumber.listener.Reporter;
import com.ntrs.msf.managers.FileReaderManager;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

//@RunWith(CucumberWithSerenity.class)
@RunWith(Cucumber.class)

@CucumberOptions(tags = {"@IRR515-Test",}, features = "src/test/resources/features/", plugin = { "pretty",
        "com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html" }, glue = {
                "com/ntrs/msf/stepDefinitions" }, monochrome = false)
public class Holdings515_Test {
    @AfterClass
    public static void writeExtentReport() {
        Reporter.loadXMLConfig(new File(FileReaderManager.getInstance().getConfigReader().getReportConfigPath()));
    }
}

标签: cucumbercucumber-jvmcucumber-java

解决方案


尝试更改plugin =format =

这有帮助吗?


推荐阅读