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 74 forks source link

cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter. It does not implement cucumber.api.Plugin #116

Open nrajendranviasat opened 4 years ago

nrajendranviasat commented 4 years ago

Runner class

@RunWith(Cucumber.class) @CucumberOptions( monochrome = true, plugin = {"com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:target/cucumber-reports/report.html"}, features = "src/test/resources/features/", glue = {"com.test"} ) public class RunnerClassTest{ @AfterClass public static void writeExtentReport() { System.out.println("hello i m in write///..."); try { //Reporter.loadXMLConfig(new File(FileReaderManager.getInstance().getConfigReader().getReportConfigPath())); System.out.println("dfhafjgj... " + Reporter.class.toString()); Reporter.loadXMLConfig(new File("C:\Projects\CommunityWIFI\code\cwf-automation-tests\configs\extent-config.xml")); } catch(Exception e){ e.printStackTrace(); } Reporter.setSystemInfo("User Name", System.getProperty("user.name")); Reporter.setSystemInfo("Time Zone", System.getProperty("user.timezone")); Reporter.setSystemInfo("Machine", "Windows 10" + "64 Bit"); Reporter.setSystemInfo("Selenium", "3.7.0"); Reporter.setSystemInfo("Maven", "3.5.2"); Reporter.setSystemInfo("Java Version", "1.8.0_151"); }

pom.xml

com.vimalselvam cucumber-extentsreport 3.1.1
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>3.1.1</version>
    </dependency>

    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports-cucumber4-adapter</artifactId>
        <version>1.0.2</version>
    </dependency>
io.cucumber cucumber-junit 3.0.2 test
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>3.0.2</version>
        <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-jvm</artifactId>
        <version>3.0.2</version>
        <type>pom</type>
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>5.0.1</version>
        <type>pom</type>
    </dependency>

Getting below Exception

cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter. 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:89)
at cucumber.runtime.RuntimeOptionsFactory.buildArgsFromOptions(RuntimeOptionsFactory.java:37)
at cucumber.runtime.RuntimeOptionsFactory.create(RuntimeOptionsFactory.java:24)
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.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
nrajendranviasat commented 4 years ago

Its already present. I have modified the adapter to adapter3, Now I am getting

java.lang.NullPointerException at com.vimalselvam.cucumber.listener.Reporter.loadXMLConfig(Reporter.java:57) at com.test.StagingAppTestSuite.writeExtentReport(StagingAppTestSuite.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

Process finished with exit code -1

From: chik145 [mailto:notifications@github.com] Sent: Tuesday, January 7, 2020 11:54 AM To: email2vimalraj/CucumberExtentReporter CucumberExtentReporter@noreply.github.com Cc: Rajendran, Nithya Nithya.Rajendran@viasat.com; Mention mention@noreply.github.com Subject: Re: [email2vimalraj/CucumberExtentReporter] cucumber.runtime.CucumberException: Couldn't load plugin class: com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter. It does not implement cucumber.api.Plugin (#116)

@nrajendranviasathttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_nrajendranviasat&d=DwMCaQ&c=jcv3orpCsv7C4ly8-ubDoUfrxF5xIGWmptxGWP5vi5w&r=bywKQxO-xbTDEamefnI9VQscg-6xRXguPSXrMu2uTVs&m=Bhu_i629cqOrPa4hMAR9_OArz3EXj_y7DXeAOaKIers&s=wXkuQZ3GFwq7onDR4vagihJLycPBBVap1uDsuJGI3Pc&e= Add Bellow Dependency And Try Once com.vimalselvam cucumber-extentsreport 3.1.1

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_email2vimalraj_CucumberExtentReporter_issues_116-3Femail-5Fsource-3Dnotifications-26email-5Ftoken-3DAOAT3ROKGNPADYZYLZN6ORTQ4QNZTA5CNFSM4KDCEMC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIH3DMA-23issuecomment-2D571453872&d=DwMCaQ&c=jcv3orpCsv7C4ly8-ubDoUfrxF5xIGWmptxGWP5vi5w&r=bywKQxO-xbTDEamefnI9VQscg-6xRXguPSXrMu2uTVs&m=Bhu_i629cqOrPa4hMAR9_OArz3EXj_y7DXeAOaKIers&s=cFgUGeN9fENnhhYio3Dt1bWz-rsVIP62HT0d3z0HgMs&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AOAT3RP3J5J5O7BZB3TTFGDQ4QNZTANCNFSM4KDCEMCQ&d=DwMCaQ&c=jcv3orpCsv7C4ly8-ubDoUfrxF5xIGWmptxGWP5vi5w&r=bywKQxO-xbTDEamefnI9VQscg-6xRXguPSXrMu2uTVs&m=Bhu_i629cqOrPa4hMAR9_OArz3EXj_y7DXeAOaKIers&s=KhOuETDxe_e8FjWXTaJ2bYfdMZ3xUU_OQ0ZhBdkK5_w&e=.

nrajendranviasat commented 4 years ago

Its already present. I have modified the adapter to adapter3, Now I am getting

java.lang.NullPointerException at com.vimalselvam.cucumber.listener.Reporter.loadXMLConfig(Reporter.java:57) at com.test.StagingAppTestSuite.writeExtentReport(StagingAppTestSuite.java:44) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.junit.runner.JUnitCore.run(JUnitCore.java:137) at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68) at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33) at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230) at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)

Process finished with exit code -1