email2vimalraj / CucumberExtentReporter

A plugin to generate the cucumber jvm custom html report using ExtentsReport
http://www.vimalselvam.com/cucumber-extent-reporter/
MIT License
58 stars 75 forks source link

Not compatible with cucumber-jvm 2.3.1 #75

Open tronghieu opened 6 years ago

tronghieu commented 6 years ago

CucumberJVM 2.3. require plugins implement Plugin class

cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listenerener.ExtentCucumberFormatter

    at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:181)
    at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
    at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
    at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201)
    at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:94)
    at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:41)
    at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:26)
    at cucumber.api.junit.Cucumber.<init>(Cucumber.java:74)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
    at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
    at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
    at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
    at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
    at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
    at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: java.lang.ClassNotFoundException: com.cucumber.listenerener.ExtentCucumberFormatter
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:174)
    ... 21 more

In cucumber.runtime.formatter.PluginFactory, method loadClass

private static Class<? extends Plugin> loadClass(String className) {
        try {
            Class<?> aClass = Thread.currentThread().getContextClassLoader().loadClass(className);

            if (Plugin.class.isAssignableFrom(aClass)) {
                return (Class<? extends Plugin>) aClass;
            }
            throw new CucumberException("Couldn't load plugin class: " + className + ". It does not implement " + Plugin.class.getName());
        } catch (ClassNotFoundException e) {
            throw new CucumberException("Couldn't load plugin class: " + className, e);
        }
    }
athoriq commented 6 years ago

Any solution for this issue? I got same problem

cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listener.ExtentCucumberFormatter. It does not implement cucumber.api.Plugin at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:179) at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166) at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223) at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201) at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:94) at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:41) at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:26) at cucumber.api.junit.Cucumber.(Cucumber.java:74) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:87) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:73) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:46) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:522) 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)

email2vimalraj commented 6 years ago

As mentioned above the plugin still not supports cucumber 2.0. I'm yet to start work on this.

I appreciate a PR.

Thanks Vimalraj

On 23-Jan-2018 3:53 PM, "athoriq" notifications@github.com wrote:

Any solution for this issue? I got same problem

cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listener.ExtentCucumberFormatter. It does not implement cucumber.api.Plugin at cucumber.runtime.formatter.PluginFactory.loadClass( PluginFactory.java:179) at cucumber.runtime.formatter.PluginFactory.pluginClass( PluginFactory.java:166) at cucumber.runtime.formatter.PluginFactory.getPluginClass( PluginFactory.java:223) at cucumber.runtime.formatter.PluginFactory.isFormatterName( PluginFactory.java:201) at cucumber.runtime.RuntimeOptionsFactory.addPlugins( RuntimeOptionsFactory.java:94) at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions( RuntimeOptionsFactory.java:41) at cucumber.runtime.RuntimeOptionsFactory.create( RuntimeOptionsFactory.java:26) at cucumber.api.junit.Cucumber.(Cucumber.java:74) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance( NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance( DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.junit.internal.builders.AnnotatedBuilder.buildRunner( AnnotatedBuilder.java:104) at org.junit.internal.builders.AnnotatedBuilder.runnerForClass( AnnotatedBuilder.java:86) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass( RunnerBuilder.java:59) at org.junit.internal.builders.AllDefaultPossibilitiesBuilder .runnerForClass(AllDefaultPossibilitiesBuilder.java:26) at org.junit.runners.model.RunnerBuilder.safeRunnerForClass( RunnerBuilder.java:59) at org.junit.internal.requests.ClassRequest.getRunner( ClassRequest.java:33) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader. createUnfilteredTest(JUnit4TestLoader.java:87) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest( JUnit4TestLoader.java:73) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests( JUnit4TestLoader.java:46) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner. runTests(RemoteTestRunner.java:522) 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)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/email2vimalraj/CucumberExtentReporter/issues/75#issuecomment-359746006, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKI3pGjwbhu8qMWiVMMN1LMtsv8W4Xaks5tNbMsgaJpZM4RTCyb .

kathyrollo commented 6 years ago

After implementing workaround for #59, I also faced this error as of 3.1.0. Cucumber-JVM is now at 3.x.x (which I am currently using). This is an excellent reporting tool but may be lagging behind other reporting alternatives.

CucumberOptions:

@RunWith(Cucumber.class)
@CucumberOptions(features = { "src/test/resources/jcucumberng/project/features" }, tags = { "not @ignore" }, glue = {
        "jcucumberng/project/typeregistry", "jcucumberng/project/stepdefs", "jcucumberng/project/hooks" }, plugin = {
                "pretty", "com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-html-extent/report.html",
                "html:target/cucumber-html-default", "json:target/cucumber-report.json",
                "junit:target/cucumber-report.xml" }, snippets = SnippetType.UNDERSCORE, monochrome = true, strict = true, dryRun = false)

Output

cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listener.ExtentCucumberFormatter. It does not implement cucumber.api.Plugin
email2vimalraj commented 6 years ago

@kathyrollo : I'm currently working on this and expected to release a new version in a week. Now the recent version of cucumber-jvm removed many things which were directly accessible in earlier versions. So the delay is.

Alje001 commented 6 years ago

@email2vimalraj: I would like to ask you, if you have any solution for the Bug?

best regards

Alje001 commented 6 years ago

any update please?

deena-p commented 6 years ago

@email2vimalraj I would also like to know, if you have any update on this? Thanks.

Bhavik1191 commented 6 years ago

@email2vimalraj I would also like to know any update for this issue. Or can you please just tell us some workaround for now? I don't want to downgrade the cucumber-jvm version to 1.2.5 Thanks

email2vimalraj commented 6 years ago

Hello everyone,

I understand the pain of everyone waiting for the update. But I've got busy as I moved to a different country and still settling down. So not able to spend much time on contributing, but I would definitely wanted to give an update.

And most importantly, the recent cucumber-jvm upgraded their APIs massively which leads to understanding and trying to back support what I was providing as a feature. So it will take sometime.

I would be very happy if any one of you can come forward and send me a PR which can support the latest version.

So right now, I don't have any timeline to promise you, but will try my level best to get this done as quick as possible.

Thanks Vimalraj

On Tue 21 Aug, 2018, 2:14 PM Bhavik-Selenium, notifications@github.com wrote:

@email2vimalraj https://github.com/email2vimalraj I would also like to know any update for this issue. Or can you please just tell us some workaround for now? I don't want to downgrade the cucumber-jvm version to 1.2.5 Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/email2vimalraj/CucumberExtentReporter/issues/75#issuecomment-414561537, or mute the thread https://github.com/notifications/unsubscribe-auth/ABKI3oG0zazJ7pr9njJljbw-tRrYwCJiks5uS6VUgaJpZM4RTCyb .

kathyrollo commented 6 years ago

Hi @email2vimalraj , Congratulations on the move and take your time. Happy to know it is still being actively worked on. This will definitely be a fine addition to my cucumber-jvm-3 framework.

Raja5211 commented 6 years ago

@email2vimalraj - Any update on this. We are fighting to generate the extend reports with latest cucumber-jvm version.

BuggySimi commented 6 years ago

@email2vimalraj can we have some alternative solution like downgrading the cucumber jvm version and extent report. will that help meanwhile?

roundcent commented 6 years ago

fyi all - Cucumber-jvm v5 will be available soon.. I think creating the latest would be considered at this point. I am working on the v5 port for internal reports but love this framework and Extent so would love to contribute.

adrian-arg commented 6 years ago

Hello, does some one have a working workaround POM example for this? Do we need to downgrade all Cucumber related libraries or are there some specific ones?

peterwkc commented 6 years ago

Any solution to this problem?

foursyth commented 6 years ago

fyi all - @anshooarora will be releasing Extent Framework support for cucumber2 and cucumber4 this week. Stay tuned.

foursyth commented 6 years ago

Cucumber 2 - https://github.com/extent-framework/extentreports-cucumber2-adapter

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber2-adapter</artifactId>
    <version>1.0.0</version>
</dependency>

Cucumber 4 - https://github.com/extent-framework/extentreports-cucumber4-adapter

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber4-adapter</artifactId>
    <version>1.0.1</version>
</dependency>

Currently, usage docs are only available for cucumber4 but they are exactly the same for cucumber2 as well. Please use the same concepts with your version of cucumber.

Usage docs - http://extentreports.com/docs/versions/4/java/cucumber4.html

adrian-arg commented 6 years ago

Cucumber 2 - https://github.com/extent-framework/extentreports-cucumber2-adapter

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber2-adapter</artifactId>
    <version>1.0.0</version>
</dependency>

Cucumber 4 - https://github.com/extent-framework/extentreports-cucumber4-adapter

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber4-adapter -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber4-adapter</artifactId>
    <version>1.0.1</version>
</dependency>

Currently, usage docs are only available for cucumber4 but they are exactly the same for cucumber2 as well. Please use the same concepts with your version of cucumber.

Usage docs - http://extentreports.com/docs/versions/4/java/cucumber4.html

Thank you, @foursyth ! I don't seem to be able to figure out how to correctly use the Adapter from the documentation. By any chance do you have a working project you could share with us?

foursyth commented 6 years ago

Hello @adrian-arg

See the test/ package of this project, and the below runner:

https://github.com/extent-framework/extentreports-cucumber2-adapter/blob/master/src/test/java/cucumber/examples/java/calculator/RunCukesTest.java

In the example, only the relevant runner is added and everything else goes on as usual:

@RunWith(Cucumber.class)
@CucumberOptions(plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:", "json:target/cucumber-report.json"})
public class RunCukesTest {
}

Under your src/test/resources/, you need an extent.properties so the adapter knows which reporters you are using:

https://github.com/extent-framework/extentreports-cucumber2-adapter/blob/master/src/test/resources/com/aventstack/adapter/extent.properties

Similarly, in the same extent.properties file, you can refer to any configuration you would like to load.

In a nutshell:

foursyth commented 6 years ago

Also see here: http://extentreports.com/docs/versions/4/java/cucumber2.html

You can do use System.setProperty() too, but I prefer the properties route as its more manageable and requires less interference with code.

kathyrollo commented 6 years ago

@foursyth Would there be no adapter for Cucumber3?

foursyth commented 6 years ago

PS. I am working with our team in improving the documentation on the website.

@kathyrollo cucumber-3 adapter will be released before this week's end.

Our plan was to start with version 2, and go all the way to 4 but our professional users wanted version 4 released before others, so cucumber-3 adapter got delayed.

foursyth commented 6 years ago

@kathyrollo apparently this was being released while we were conversing. It may take a bit for mvnrepository to show this artifact but it has been deployed to central already.

Cucumber3 - https://github.com/extent-framework/extentreports-cucumber3-adapter

<!-- https://mvnrepository.com/artifact/com.aventstack/extentreports-cucumber3-adapter -->
<dependency>
    <groupId>com.aventstack</groupId>
    <artifactId>extentreports-cucumber3-adapter</artifactId>
    <version>1.0.0</version>
</dependency>

Usage is exactly the same as cucumber2 and cucumber4 adapters. See my earlier posts starting here.

adrian-arg commented 6 years ago

In a nutshell:

  • Add the reference to the adapter in your runner
  • Mark extent.properties with the needed reporters
  • Specify path of configuration XMLs (if needed)

Thanks for the quick reply! I have gone through these steps but I don't get any Report from the adapter. I've pretty much copied and pasted the code from the runner and properties.

foursyth commented 6 years ago

Hello @adrian-arg

Please open the issue here: https://github.com/extent-framework/extentreports-cucumber2-adapter

I will work with you to resolve.

adrian-arg commented 6 years ago

Hello @adrian-arg

Please open the issue here: https://github.com/extent-framework/extentreports-cucumber2-adapter

I will work with you to resolve.

Thank you, foursyth, I appreciate it! I'm using Cucumber4-Adapter, so I opened the issue in that git. https://github.com/extent-framework/extentreports-cucumber4-adapter/issues/1

Sum123it commented 6 years ago

Hi,

Did anyone try with AbstractTestNGCucumberTests? testng-6.14.3 io.cucumber-2.3.1 cucumber testng 2.3.1 extentreports 4.0.5 cucumber-extentsreport 3.0.2 extentreports-cucumber4-adapter 1.0.4

I am getting below error while running my tests with testng with below plugin:

@CucumberOptions(

monochrome = true, // display
plugin = { "html:test-output/cucumber-reports/cucumber-report.html",
           "json:test-output/json-reports/json-report.json",
           "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:test-output/extent-rep

public class TestRunner extends AbstractTestNGCucumberTests {

@AfterClass
public static void setup() {
    Reporter.loadXMLConfig(new File("src/test/resources/extent-config.xml"));
    Reporter.setSystemInfo("user", System.getProperty("username"));
    Reporter.setTestRunnerOutput("Sampleout");
}

} Error:

[RemoteTestNG] detected TestNG version 6.14.3 FAILED CONFIGURATION: @BeforeClass setUpClass java.lang.NoClassDefFoundError: cucumber/api/event/ConcurrentEventListener at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

deena-p commented 6 years ago

I think you should use extentreports-cucumber2-adapter for io.cucumber 2x.

Sum123it commented 6 years ago

@deena-p -Thanks! I could resolve that with your help but with below configuration my scenarios are passed- but reporting has issues with incompatible gherkin. testng-6.14.3 io.cucumber-2.3.1 cucumber testng 2.3.1 extentreports 4.0.5 cucumber-extentsreport 3.0.2 extentreports-cucumber4-adapter 1.0.4 gherkin 5.0.0

FAILED CONFIGURATION: @AfterClass setup java.lang.NoClassDefFoundError: gherkin/formatter/Reporter at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

manick7 commented 5 years ago

I am using cucumber-jvm - 3.0.2 and facing this issue.

cucumber.runtime.CucumberException: Couldn't load plugin class: com.cucumber.listenerener.ExtentCucumberFormatter

at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:181)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201)
at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:94)
at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:41)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:26)
Donly16 commented 5 years ago

Hi, after run , the report doesn't display correctly. I search in google, it said I should use the local mode to generate the report. But cucumber doesn't support it.

htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS); or extent=new ExtentReports(workDir+"/ExtentReportResults.html", true, NetworkMode.OFFLINE); If I add dependency of extentreport 3.1.5, it does support the local way, but when running, error will be prompt. "Caused by: java.lang.ClassNotFoundException: com.aventstack.extentreports.reporter.ConfigurableReporter" 4.0.5 will run correctly, but html format wrong. So, how should I do to solve this? Can anyone help? 20190221162929

pom
sandeepmknair commented 5 years ago

Appreciate your effort and it generates report for me but it throes and exception.Would you be able to look into it?

com.mongodb.MongoSocketOpenException: Exception opening socket at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:67) ~[mongodb-driver-core-3.8.2.jar:na] at com.mongodb.internal.connection.InternalStreamConnection.open(InternalStreamConnection.java:126) ~[mongodb-driver-core-3.8.2.jar:na] at com.mongodb.internal.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:117) ~[mongodb-driver-core-3.8.2.jar:na] at java.lang.Thread.run(Unknown Source) [na:1.8.0_201] Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method) ~[na:1.8.0_201] at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source) ~[na:1.8.0_201] at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source) ~[na:1.8.0_201] at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source) ~[na:1.8.0_201] at java.net.AbstractPlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_201] at java.net.PlainSocketImpl.connect(Unknown Source) ~[na:1.8.0_201] at java.net.SocksSocketImpl.connect(Unknown Source) ~[na:1.8.0_201] at java.net.Socket.connect(Unknown Source) ~[na:1.8.0_201] at com.mongodb.internal.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:64) ~[mongodb-driver-core-3.8.2.jar:na] at com.mongodb.internal.connection.SocketStream.open(SocketStream.java:62) ~[mongodb-driver-core-3.8.2.jar:na] ... 3 common frames omitted

Udhay1316 commented 5 years ago

Hi @anshooarora @adrian-arg

My project built on cucumber-sprint 2.3.1. To generate extent report, I have added below gradle dependencies

name: 'cucumber-extentsreport', version: '3.1.1' name: 'extentreports-cucumber2-adapter', version: '1.0.0' to generate extent report.

Note: I have created extent.properties and the below code snippet in the runner class plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:output/report.html"}

public static void teardown() { Reporter.loadXMLConfig(new File("src/test/resources/extent.properties")); Reporter.setSystemInfo("user", System.getProperty("user.name")); Reporter.setSystemInfo("os", "Mac OSX"); Reporter.setTestRunnerOutput("Sample test runner output message"); }

But I am getting below error when I ran my runner test

cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter

at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:181)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
at cucumber.runtime.formatter.PluginFactory.isFormatterName(PluginFactory.java:201)
at cucumber.runtime.RuntimeOptionsFactory.addPlugins(RuntimeOptionsFactory.java:94)
at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:41)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:26)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:104)
at org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:86)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
at org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:33)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:49)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

Caused by: java.lang.ClassNotFoundException: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:174) ... 21 more

sseenivasan89 commented 5 years ago

Any update on this issue ? still i am facing the same issue

adityabad commented 4 years ago

im finding this issue when i try to run. i have set all the plugins to v5.5.0. Caused by: java.lang.ClassNotFoundException: cucumber.api.event.ConcurrentEventListener