首页 文章

Selenium Cucumber Java范围报告

提问于
浏览
1

我目前正在使用Selenium Java的Cucumber Framework . 我希望将我的普通黄瓜报告升级到范围报告 . 尝试了Extent报告3.0.2 . 我能够生成Extent报告,但我无法将失败的测试用例的屏幕截图嵌入到Extent Report中 .

任何人都可以帮助知道这可能有这个功能,将失败案例的屏幕截图嵌入到Cucumber Selenium Java Framework中 . 如果是,请帮助我转发与此或代码相关的任何链接 .

另外我想了解是否还有其他自定义报告比扩展程序报告更容易配置 .

另外请帮助我理解哪种并列执行更快 . 1.Cucumber JVM paralell插件2.Maven Sure fire plugin 3.Test NG paralell classes

如果任何人可以分享我如何配置并行执行,那将是很大的帮助 .

提前感谢您的帮助 . 祝你有美好的一天

2 回答

  • 0

    我使用以下NPM模块,我必须在每次测试后手动运行,因为我也在java中运行...除非有java代码可以以编程方式运行节点模块,我不知道 -

    https://www.npmjs.com/package/cucumber-html-reporter

  • 1

    使用与此类似的东西,以便在发生故障时让范围报告截取屏幕截图 . 祝你好运 .

    public void onTestFailure(ITestResult testResult) {
            System.out.println("Method " + getTestMethodName(testResult) + " failed");
            watch.reset();
            try {
                String path = TakeScreenshot.takeScreenshot(eDriver, testResult.getMethod().getMethodName());
                test.addScreenCaptureFromPath(path).fail("<b>"
                        + testResult.getMethod().getMethodName().replaceAll("(\\p{Ll})(\\p{Lu})", "$1 $2").toUpperCase()
                        + "</b>" + " failed <br>"+testResult.getThrowable());
    
            } catch (IOException e) {
                e.printStackTrace();
            }
    
        }
    

相关问题