extentreports-java icon indicating copy to clipboard operation
extentreports-java copied to clipboard

UnsupportedOperationException when using Before/After hooks.

Open haroon-sheikh opened this issue 8 years ago • 2 comments

Summary

I'm seeing the following error when using hooks with this formatter

Current Behavior

Getting the following error when running the formatter with Hooks. I can't seem to figure out what the problem is.

java.lang.UnsupportedOperationException
	at cucumber.runner.UnskipableStep.getStepLine(UnskipableStep.java:43)
	at com.sitture.ExtentFormatter.handleTestStepStarted(ExtentFormatter.java:118)
	at com.sitture.ExtentFormatter.access$200(ExtentFormatter.java:36)
	at com.sitture.ExtentFormatter$3.receive(ExtentFormatter.java:69)
	at com.sitture.ExtentFormatter$3.receive(ExtentFormatter.java:66)
	at cucumber.runner.EventBus.send(EventBus.java:28)
	at cucumber.api.TestStep.run(TestStep.java:79)
	at cucumber.api.TestCase.run(TestCase.java:58)
	at cucumber.runner.Runner.runPickle(Runner.java:80)
	at cucumber.runtime.junit.PickleRunners$NoStepDescriptions.run(PickleRunners.java:140)
	at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:68)
	at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:23)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:73)
	at cucumber.api.junit.Cucumber.runChild(Cucumber.java:117)
	at cucumber.api.junit.Cucumber.runChild(Cucumber.java:55)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at cucumber.api.junit.Cucumber$1.evaluate(Cucumber.java:126)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	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.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Sample

@RunWith(Cucumber.class)
@CucumberOptions(
        features = {"src/test/resources"},
        snippets = SnippetType.CAMELCASE,
        plugin = { "com.sitture.ExtentFormatter:target/output/extent-report/index.html" }
)
public class RunCukesTest {

	@BeforeClass
	public static void setup() {
        ExtentReporter.setConfig("src/test/resources/config.xml");
        ExtentReporter.setSystemInfo("Browser", "Chrome");
        ExtentReporter.setSystemInfo("Selenium", "v2.53.1");
	}

}

Environment Details

  • Extent report Version used: 3.1.2
  • Operating System and version: Mac
  • JDK Version: 1.8

haroon-sheikh avatar Dec 28 '17 20:12 haroon-sheikh

Hmm stacktrace points to com.sitture package having the issue. Don't think it belongs to this repo. The error is coming from formatter.

karthikbhatnagar avatar Dec 29 '17 00:12 karthikbhatnagar

@karthikbhatnagar I'm the owner of the formatter but I cant seem to figure what I'm missing.

haroon-sheikh avatar Dec 29 '17 12:12 haroon-sheikh