Getting error “cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listener.ExtentCucumberFormatter.”

后端 未结 2 469
天涯浪人
天涯浪人 2021-01-22 11:26

I am trying to generate Extent report for my test run using Junit cucumber ,but i am getting error

\"cucumber.runtime.CucumberException: Couldn\'t load plugin c         


        
2条回答
  •  情书的邮戳
    2021-01-22 12:02

    After many days searching for a solution to this problem that was also happening to me, I discovered the cause (at least that worked for me). Apparently, the pluggin com.cucumber.listener.ExtentCucumberFormatter or com.vimalselvam.cucumber.listener.ExtentCucumberFormatter (for cucumber-extentreports version 3.1.1+) only works with the cucumber of the info.cukes package.

    
    
    info.cukes
    cucumber-java    
    1.2.5
    
    

    To use ExtentReports with the most current cucumber versions (package io.cucumber from versions 2.X.X onwards) you need to add the cucumber-adapter plugin.

    For each X version of cucumber, there is an adapter, such as for cucumber version 4.X.X the extentreports-cucumber4-adapter dependency is required.

    
    com.aventstack
    extentreports-cucumber4-adapter
    1.0.7
    
    

              

    And in the class Runner you should replace the plugin:

    "com.cucumber.listener.ExtentCucumberFormatter:"

    by

    "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:"

    For an example of using cucumber 4 with extent reports follow the GitHub link I found:

    https://github.com/foursyth/extentreports-cucumber4-example

    For versions 2.X.X and 3.X.X follow the same principles as 4.X.X

    ExtentReport settings specification link of all versions:

    http://extentreports.com/documentation/

    Hope this helps.

提交回复
热议问题