cucumber.runtime.CucumberException: Classes annotated with @RunWith(Cucumber.class) must not define any Step Definition or Hook methods. Their sole purpose is to serve as an entry point for JUnit. Step Definitions and Hooks should be defined in their own classes. This allows them to be reused across features. Offending class: class com.cucumber.learning.YoutubeTest at cucumber.runtime.junit.Assertions.assertNoCucumberAnnotatedMethods(Assertions.java:13)

Stack Overflow | Test admin | 8 months ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 2

    how to execute parallel testing in cucumber

    Stack Overflow | 8 months ago | Test admin
    cucumber.runtime.CucumberException: Classes annotated with @RunWith(Cucumber.class) must not define any Step Definition or Hook methods. Their sole purpose is to serve as an entry point for JUnit. Step Definitions and Hooks should be defined in their own classes. This allows them to be reused across features. Offending class: class com.cucumber.learning.YoutubeTest at cucumber.runtime.junit.Assertions.assertNoCucumberAnnotatedMethods(Assertions.java:13)
  2. 0

    Cucumber doesn't work with JUnit 4.12

    GitHub | 2 years ago | lbeuster
    cucumber.runtime.CucumberException: Failed to create scenario runner

    1 unregistered visitors

    Root Cause Analysis

    1. cucumber.runtime.CucumberException

      Classes annotated with @RunWith(Cucumber.class) must not define any Step Definition or Hook methods. Their sole purpose is to serve as an entry point for JUnit. Step Definitions and Hooks should be defined in their own classes. This allows them to be reused across features. Offending class: class com.cucumber.learning.YoutubeTest at cucumber.runtime.junit.Assertions.assertNoCucumberAnnotatedMethods(Assertions.java:13)

      at cucumber.api.junit.Cucumber.<init>()
    2. Cucumber-JVM: JUnit
      Cucumber.<init>
      1. cucumber.api.junit.Cucumber.<init>(Cucumber.java:55)
      1 frame
    3. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      4. java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      4 frames
    4. JUnit
      Request.classes
      1. org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:29)
      2. org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:21)
      3. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      4. org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:26)
      5. org.junit.runner.Computer.getRunner(Computer.java:40)
      6. org.junit.runner.Computer$1.runnerForClass(Computer.java:31)
      7. org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:59)
      8. org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:101)
      9. org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:87)
      10. org.junit.runners.Suite.<init>(Suite.java:80)
      11. org.junit.runner.Computer.getSuite(Computer.java:28)
      12. org.junit.runner.Request.classes(Request.java:75)
      12 frames
    5. SureFire JUnitCore Runner
      JUnitCoreProvider.invoke
      1. org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:97)
      2. org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:78)
      3. org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:54)
      4. org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:144)
      4 frames
    6. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
      2. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
      3. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      3 frames