├── .mvn ├── jvm.config └── wrapper │ └── maven-wrapper.jar ├── cucumber-testng ├── .gitignore └── src │ ├── test │ ├── resources │ │ ├── cucumber.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ ├── error │ │ │ │ └── parse-error.feature │ │ │ │ ├── testng │ │ │ │ ├── empty-feature.feature │ │ │ │ ├── empty-scenario.feature │ │ │ │ ├── fa.feature │ │ │ │ ├── fb.feature │ │ │ │ ├── feature-with-same-steps-in-different-scenarios.feature │ │ │ │ ├── three-scenarios.feature │ │ │ │ └── scenarios-with-tags.feature │ │ │ │ └── undefined │ │ │ │ └── undefined_steps.feature │ │ └── META-INF │ │ │ └── services │ │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ │ └── io │ │ └── cucumber │ │ └── testng │ │ ├── RunCucumberTest.java │ │ ├── RunFeatureWithThreeScenariosTest.java │ │ └── TestPendingException.java │ └── main │ └── java │ └── io │ └── cucumber │ └── testng │ ├── FeatureWrapper.java │ ├── FeatureWrapperImpl.java │ ├── PickleWrapper.java │ ├── PickleWrapperImpl.java │ ├── NoUuidGenerator.java │ ├── CucumberPropertiesProvider.java │ ├── CucumberExceptionWrapper.java │ └── NoObjectFactory.java ├── .github ├── FUNDING.yml ├── renovate.json └── workflows │ └── release-github.yml ├── cucumber-core └── src │ ├── test │ ├── resources │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── core │ │ │ │ ├── runtime │ │ │ │ └── empty.feature │ │ │ │ ├── bar.properties │ │ │ │ ├── foo.properties │ │ │ │ ├── resource │ │ │ │ └── test │ │ │ │ │ ├── resource.txt │ │ │ │ │ ├── other-resource.txt │ │ │ │ │ ├── spaces in name resource.txt │ │ │ │ │ ├── jar-resource.jar │ │ │ │ │ └── spring-resource.jar │ │ │ │ ├── has spaces.properties │ │ │ │ └── options │ │ │ │ ├── runtime-options-empty-rerun.txt │ │ │ │ └── runtime-options-rerun.txt │ │ ├── env-test.properties │ │ └── META-INF │ │ │ └── services │ │ │ └── io.cucumber.core.backend.BackendProviderService │ ├── resource-symlink │ └── java │ │ └── io │ │ └── cucumber │ │ └── core │ │ ├── resource │ │ └── test │ │ │ ├── OtherClass.java │ │ │ ├── ExampleInterface.java │ │ │ └── ExampleClass.java │ │ ├── options │ │ ├── TestPluginOption.java │ │ ├── NoUuidGenerator.java │ │ └── RuntimeOptionsBuilderTest.java │ │ ├── cli │ │ └── MainDemo.java │ │ ├── plugin │ │ └── StubFormatter.java │ │ ├── runner │ │ └── TestDefinitionArgument.java │ │ ├── runtime │ │ └── StubFeatureSupplier.java │ │ └── exception │ │ └── UnrecoverableExceptionsTest.java │ └── main │ ├── java │ └── io │ │ └── cucumber │ │ └── core │ │ ├── options │ │ ├── GlueFile.java │ │ ├── CucumberPropertiesProvider.java │ │ └── SnippetTypeParser.java │ │ ├── backend │ │ ├── Options.java │ │ ├── StaticHookDefinition.java │ │ ├── Status.java │ │ ├── DataTableTypeDefinition.java │ │ ├── DocStringTypeDefinition.java │ │ ├── ParameterTypeDefinition.java │ │ ├── BackendProviderService.java │ │ ├── DefaultDataTableCellTransformerDefinition.java │ │ ├── DefaultParameterTransformerDefinition.java │ │ ├── DefaultDataTableEntryTransformerDefinition.java │ │ ├── Lookup.java │ │ ├── Container.java │ │ ├── HookDefinition.java │ │ ├── CucumberBackendException.java │ │ └── Pending.java │ │ ├── eventbus │ │ ├── Options.java │ │ ├── AbstractEventBus.java │ │ ├── EventBus.java │ │ ├── RandomUuidGenerator.java │ │ └── UuidGenerator.java │ │ ├── snippets │ │ ├── Joiner.java │ │ ├── SnippetType.java │ │ └── SnakeCaseJoiner.java │ │ ├── stepexpression │ │ ├── Argument.java │ │ ├── DocStringTransformer.java │ │ └── RawTableTransformer.java │ │ ├── runtime │ │ ├── RunnerSupplier.java │ │ ├── ObjectFactorySupplier.java │ │ ├── FeatureSupplier.java │ │ ├── BackendSupplier.java │ │ └── TestCaseFailed.java │ │ ├── feature │ │ └── Options.java │ │ ├── order │ │ └── PickleOrder.java │ │ ├── runner │ │ ├── UndefinedStepDefinitionException.java │ │ ├── StepDefinitionMatch.java │ │ ├── Options.java │ │ └── Match.java │ │ ├── plugin │ │ ├── UTF8OutputStreamWriter.java │ │ ├── Options.java │ │ ├── UrlReporter.java │ │ └── CanonicalOrderEventPublisher.java │ │ ├── exception │ │ ├── CompositeCucumberException.java │ │ └── CucumberException.java │ │ ├── filter │ │ ├── Options.java │ │ └── NamePredicate.java │ │ ├── logging │ │ └── LogRecordListener.java │ │ └── resource │ │ └── ClassLoaders.java │ └── resources │ ├── META-INF │ └── services │ │ ├── io.cucumber.core.backend.ObjectFactory │ │ └── io.cucumber.core.eventbus.UuidGenerator │ └── io │ └── cucumber │ └── core │ ├── plugin │ └── timeline │ │ ├── chosen.override.css │ │ ├── chosen-sprite.png │ │ ├── vis-timeline-graph2d.override.css │ │ └── report.css │ └── version.properties ├── cucumber-guice ├── .gitignore └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ └── io │ │ │ └── cucumber │ │ │ └── guice │ │ │ └── integration │ │ │ ├── hello.feature │ │ │ └── guice-no-scope.feature │ └── java │ │ └── io │ │ └── cucumber │ │ └── guice │ │ ├── integration │ │ ├── SingletonObject.java │ │ ├── UnScopedObject.java │ │ ├── ScenarioScopedObject.java │ │ ├── HelloWorldSteps.java │ │ ├── YourModule.java │ │ └── YourInjectorSource.java │ │ ├── impl │ │ └── LivesInChildClassLoader.java.txt │ │ └── factory │ │ └── SecondInjectorSource.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ ├── io.cucumber.core.backend.ObjectFactory │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ └── io │ └── cucumber │ └── guice │ ├── InjectorSourceInstantiationFailed.java │ ├── ScenarioScope.java │ ├── InjectorSource.java │ ├── GuiceBackendProviderService.java │ ├── ScenarioModule.java │ └── ScenarioScoped.java ├── cucumber-junit └── src │ ├── test │ ├── resources │ │ ├── cucumber.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ ├── junit │ │ │ │ ├── empty-feature.feature │ │ │ │ ├── empty-scenario.feature │ │ │ │ ├── single.feature │ │ │ │ ├── single-duplicate.feature │ │ │ │ ├── fb.feature │ │ │ │ ├── rule.feature │ │ │ │ └── fa.feature │ │ │ │ └── error │ │ │ │ └── lexer_error.feature │ │ └── META-INF │ │ │ └── services │ │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ │ └── io │ │ └── cucumber │ │ └── junit │ │ ├── RunCucumberTest.java │ │ ├── RunCucumberTestWithStepNotifications.java │ │ ├── TestPendingException.java │ │ ├── FailureMatcher.java │ │ ├── SanityTest.java │ │ └── DescriptionMatcher.java │ └── main │ └── java │ └── io │ └── cucumber │ └── junit │ ├── NoUuidGenerator.java │ ├── SkippedThrowable.java │ ├── JUnitOptions.java │ └── NoObjectFactory.java ├── cucumber-spring └── src │ ├── test │ ├── resources │ │ ├── cucumber.properties │ │ ├── junit-platform.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── spring │ │ │ │ ├── springBeanInjection.feature │ │ │ │ ├── contextCaching.feature │ │ │ │ ├── springBeanInjectionWithMetaConfiguration.feature │ │ │ │ ├── annotationContextConfiguration.feature │ │ │ │ ├── stepdefInjection.feature │ │ │ │ └── threadingCukes.feature │ │ ├── logback-test.xml │ │ ├── cucumber2.xml │ │ └── cucumber.xml │ └── java │ │ └── io │ │ └── cucumber │ │ └── spring │ │ ├── beans │ │ ├── DummyComponent.java │ │ ├── TestController.java │ │ ├── BellyBean.java │ │ └── Belly.java │ │ ├── cucumbercontextconfigannotation │ │ ├── AnnotatedInterface.java │ │ ├── AbstractWithComponentAnnotation.java │ │ └── WithMetaAnnotation.java │ │ ├── contextcaching │ │ ├── ContextConfig.java │ │ └── RunCucumberTest.java │ │ ├── commonglue │ │ ├── AutowiresThirdStepDef.java │ │ ├── ThirdStepDef.java │ │ └── AnotherStepDef.java │ │ ├── annotationconfig │ │ ├── AnnotationContextConfiguration.java │ │ ├── AnnotationContextConfigurationDefinitions.java │ │ └── RunCucumberTest.java │ │ ├── metaconfig │ │ ├── general │ │ │ └── MetaConfiguration.java │ │ └── dirties │ │ │ ├── DirtiesMetaConfiguration.java │ │ │ └── RunCucumberTest.java │ │ ├── componentannotation │ │ ├── WithComponentAnnotation.java │ │ └── WithControllerAnnotation.java │ │ ├── dirtiescontextconfig │ │ └── RunCucumberTest.java │ │ └── contextconfig │ │ └── RunCucumberTest.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ ├── io.cucumber.core.backend.ObjectFactory │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ └── io │ └── cucumber │ └── spring │ ├── package-info.java │ └── SpringBackendProviderService.java ├── examples ├── calculator-java-cli │ ├── .gitignore │ └── src │ │ ├── test │ │ └── resources │ │ │ ├── cucumber.properties │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ └── date_calculator.feature │ │ └── main │ │ └── java │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ └── DateCalculator.java ├── calculator-java-junit4 │ ├── .gitignore │ └── src │ │ ├── test │ │ ├── resources │ │ │ ├── cucumber.properties │ │ │ └── io │ │ │ │ └── cucumber │ │ │ │ └── examples │ │ │ │ └── calculator │ │ │ │ └── date_calculator.feature │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ └── RunCucumberTest.java │ │ └── main │ │ └── java │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ └── DateCalculator.java ├── calculator-java-junit5 │ ├── .gitignore │ └── src │ │ ├── test │ │ ├── java │ │ │ └── io │ │ │ │ └── cucumber │ │ │ │ └── examples │ │ │ │ └── calculator │ │ │ │ └── Example.java │ │ └── resources │ │ │ ├── junit-platform.properties │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── shopping.feature │ │ │ └── date_calculator.feature │ │ └── main │ │ └── java │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ └── DateCalculator.java ├── calculator-java-testng │ ├── src │ │ ├── test │ │ │ ├── resources │ │ │ │ ├── cucumber.properties │ │ │ │ └── io │ │ │ │ │ └── cucumber │ │ │ │ │ └── examples │ │ │ │ │ └── calculator │ │ │ │ │ ├── shopping.feature │ │ │ │ │ └── date_calculator.feature │ │ │ └── java │ │ │ │ └── io │ │ │ │ └── cucumber │ │ │ │ └── examples │ │ │ │ └── calculator │ │ │ │ ├── RunCucumberByCompositionBase.java │ │ │ │ └── RunCucumberTest.java │ │ └── main │ │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ └── DateCalculator.java │ └── .gitignore ├── calculator-java8-cli │ └── src │ │ └── test │ │ └── resources │ │ └── cucumber.properties ├── calculator-kotlin-junit5 │ ├── .gitignore │ └── src │ │ ├── test │ │ └── resources │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── shopping.feature │ │ │ └── date_calculator.feature │ │ └── main │ │ └── kotlin │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calaculator │ │ └── DateCalculator.kt ├── spring-java-junit5 │ └── src │ │ ├── main │ │ ├── resources │ │ │ ├── application.yml │ │ │ ├── templates │ │ │ │ └── user.html │ │ │ └── logback.xml │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── spring │ │ │ └── application │ │ │ ├── UserRepository.java │ │ │ ├── MessageRepository.java │ │ │ └── Application.java │ │ └── test │ │ ├── resources │ │ ├── junit-platform.properties │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── spring │ │ │ └── application │ │ │ └── see-messages.feature │ │ └── java │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── spring │ │ └── application │ │ ├── CucumberTestContextConfiguration.java │ │ ├── UserStepDefinitions.java │ │ └── RunCucumberTest.java ├── wicket-java-junit4 │ ├── wicket-test │ │ └── src │ │ │ └── test │ │ │ ├── resources │ │ │ ├── cucumber.properties │ │ │ ├── io │ │ │ │ └── cucumber │ │ │ │ │ └── examples │ │ │ │ │ └── wicket │ │ │ │ │ └── main │ │ │ │ │ └── Rent.feature │ │ │ └── logback-test.xml │ │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── wicket │ │ │ └── test │ │ │ └── RunCucumberIT.java │ ├── wicket-main │ │ └── src │ │ │ └── main │ │ │ ├── resources │ │ │ ├── io │ │ │ │ └── cucumber │ │ │ │ │ └── examples │ │ │ │ │ └── wicket │ │ │ │ │ └── main │ │ │ │ │ └── view │ │ │ │ │ ├── Rent.html │ │ │ │ │ ├── Available.html │ │ │ │ │ └── Create.html │ │ │ └── logback.xml │ │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── wicket │ │ │ └── main │ │ │ ├── model │ │ │ ├── dao │ │ │ │ └── CarDAO.java │ │ │ └── entity │ │ │ │ └── Car.java │ │ │ └── view │ │ │ └── Available.java │ ├── README.md │ └── pom.xml └── README.md ├── cucumber-cdi2 └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── cdi2 │ │ │ │ └── example │ │ │ │ └── cukes.feature │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── io │ │ └── cucumber │ │ └── cdi2 │ │ └── example │ │ ├── RunCucumberTest.java │ │ └── Belly.java │ └── main │ └── resources │ └── META-INF │ └── services │ └── io.cucumber.core.backend.ObjectFactory ├── cucumber-gherkin-messages └── src │ ├── test │ └── resources │ │ ├── io │ │ └── cucumber │ │ │ └── core │ │ │ └── gherkin │ │ │ └── messages │ │ │ ├── empty.feature │ │ │ ├── lexer-error.feature │ │ │ ├── no-pickles.feature │ │ │ ├── empty-table.feature │ │ │ ├── unnamed.feature │ │ │ ├── doc-string.feature │ │ │ └── background.feature │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.gherkin.FeatureParser │ └── java │ └── io │ └── cucumber │ └── core │ └── gherkin │ └── messages │ └── GherkinMessagesLocation.java ├── cucumber-java └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ └── io │ │ │ └── cucumber │ │ │ └── java │ │ │ └── annotation │ │ │ ├── cukes.feature │ │ │ ├── parameter-types.feature │ │ │ ├── french-iso-8859-1-cukes.feature │ │ │ ├── french-numbers.feature │ │ │ ├── scenario.feature │ │ │ └── scenario_outline_substitution.feature │ └── java │ │ └── io │ │ └── cucumber │ │ └── java │ │ ├── incorrectlysubclassedsteps │ │ └── SubclassesSteps.java │ │ ├── steps │ │ └── Steps.java │ │ ├── repeatable │ │ └── Steps.java │ │ ├── annotation │ │ ├── Steps.java │ │ ├── RunCucumberTest.java │ │ └── FrenchSteps.java │ │ └── defaultstransformer │ │ └── RunCucumberTest.java │ ├── main │ ├── resources │ │ └── META-INF │ │ │ └── services │ │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ │ └── io │ │ └── cucumber │ │ └── java │ │ ├── Status.java │ │ ├── StepDefinitionAnnotation.java │ │ ├── StepDefinitionAnnotations.java │ │ ├── JavaSnippet.java │ │ ├── PendingException.java │ │ ├── JavaBackendProviderService.java │ │ └── InvalidMethodException.java │ └── codegen │ └── resources │ └── templates │ └── package-info.ftl ├── cucumber-openejb └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── openejb │ │ │ │ └── cukes.feature │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── io │ │ └── cucumber │ │ └── openejb │ │ ├── Belly.java │ │ ├── RunCucumberTest.java │ │ └── BellyStepDefinitions.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── java │ └── io │ └── cucumber │ └── openejb │ └── package-info.java ├── cucumber-picocontainer └── src │ ├── test │ ├── resources │ │ ├── cucumber.properties │ │ └── io │ │ │ └── cucumber │ │ │ └── picocontainer │ │ │ └── issue-225.feature │ └── java │ │ └── io │ │ └── cucumber │ │ └── picocontainer │ │ ├── RunCucumberTest.java │ │ ├── SanityTest.java │ │ └── SomeTest.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── java │ └── io │ └── cucumber │ └── picocontainer │ └── package-info.java ├── cucumber-archetype ├── src │ ├── test │ │ └── resources │ │ │ └── projects │ │ │ └── should-generate-project │ │ │ ├── archetype.pom.properties │ │ │ ├── goal.txt │ │ │ ├── archetype.properties │ │ │ └── reference │ │ │ └── src │ │ │ └── test │ │ │ ├── resources │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── example.feature │ │ │ └── java │ │ │ └── com │ │ │ └── example │ │ │ └── StepDefinitions.java │ └── main │ │ └── resources │ │ └── archetype-resources │ │ └── src │ │ └── test │ │ ├── resources │ │ └── __packageInPathFormat__ │ │ │ └── example.feature │ │ └── java │ │ ├── StepDefinitions.java │ │ └── RunCucumberTest.java └── README.md ├── cucumber-deltaspike └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── deltaspike │ │ │ │ └── cukes.feature │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── io │ │ └── cucumber │ │ └── deltaspike │ │ ├── Belly.java │ │ └── RunCucumberTest.java │ └── main │ └── resources │ └── META-INF │ └── services │ └── io.cucumber.core.backend.ObjectFactory ├── cucumber-jakarta-cdi └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ ├── META-INF │ │ │ ├── openwebbeans.properties │ │ │ └── beans.xml │ │ └── io │ │ │ └── cucumber │ │ │ └── jakarta │ │ │ └── cdi │ │ │ └── example │ │ │ └── cukes.feature │ └── java │ │ └── io │ │ └── cucumber │ │ └── jakarta │ │ └── cdi │ │ └── example │ │ ├── Belly.java │ │ └── RunCucumberTest.java │ └── main │ └── resources │ └── META-INF │ └── services │ └── io.cucumber.core.backend.ObjectFactory ├── cucumber-kotlin-java8 ├── src │ └── test │ │ ├── resources │ │ └── junit-platform.properties │ │ └── kotlin │ │ └── io │ │ └── cucumber │ │ └── kotlin │ │ └── RunCucumberTest.kt └── README.md ├── RELEASING.md ├── cucumber-jakarta-openejb └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── jakarta │ │ │ │ └── openejb │ │ │ │ └── cukes.feature │ │ └── META-INF │ │ │ └── beans.xml │ └── java │ │ └── io │ │ └── cucumber │ │ └── jakarta │ │ └── openejb │ │ ├── Belly.java │ │ ├── RunCucumberTest.java │ │ └── BellyStepDefinitions.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── java │ └── io │ └── cucumber │ └── jakarta │ └── openejb │ └── package-info.java ├── cucumber-java8 └── src │ ├── test │ ├── resources │ │ ├── junit-platform.properties │ │ └── io │ │ │ └── cucumber │ │ │ └── java8 │ │ │ └── anon-inner-class-step-definitions.feature │ └── java │ │ └── io │ │ └── cucumber │ │ └── java8 │ │ ├── steps │ │ └── Steps.java │ │ └── RunCucumberTest.java │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ └── java │ └── io │ └── cucumber │ └── java8 │ ├── HookNoArgsBody.java │ ├── HookBody.java │ ├── Status.java │ ├── DataTableCellDefinitionBody.java │ ├── DocStringDefinitionBody.java │ ├── DataTableRowDefinitionBody.java │ ├── DataTableDefinitionBody.java │ ├── DataTableEntryDefinitionBody.java │ ├── DefaultParameterTransformerBody.java │ ├── DefaultDataTableCellTransformerBody.java │ ├── DefaultDataTableEntryTransformerBody.java │ ├── Java8DataTableTypeDefinition.java │ ├── Java8Snippet.java │ ├── PendingException.java │ ├── Java8BackendProviderService.java │ └── Java8DefaultParameterTransformerDefinition.java ├── cucumber-junit-platform-engine └── src │ ├── test │ ├── resources │ │ ├── rerun │ │ │ └── rerun.txt │ │ ├── io │ │ │ └── cucumber │ │ │ │ └── junit │ │ │ │ └── platform │ │ │ │ └── engine │ │ │ │ ├── empty-feature.feature │ │ │ │ ├── empty-scenario.feature │ │ │ │ ├── single.feature │ │ │ │ ├── disabled.feature │ │ │ │ ├── resource.feature │ │ │ │ ├── with space.feature │ │ │ │ ├── parameterized-scenario-outline.feature │ │ │ │ ├── rule.feature │ │ │ │ └── ordering.feature │ │ ├── META-INF │ │ │ └── services │ │ │ │ └── io.cucumber.core.backend.BackendProviderService │ │ ├── feature.jar │ │ ├── junit-platform.properties │ │ └── root.feature │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── junit │ │ │ └── platform │ │ │ └── engine │ │ │ └── RunCucumberTest.java │ └── bad-features │ │ └── parse-error.feature │ └── main │ ├── resources │ └── META-INF │ │ └── services │ │ └── org.junit.platform.engine.TestEngine │ ├── java │ └── io │ │ └── cucumber │ │ └── junit │ │ └── platform │ │ └── engine │ │ └── NamingStrategy.java │ └── java9 │ └── module-info.java ├── compatibility └── src │ └── test │ └── java │ └── io │ └── cucumber │ └── compatibility │ ├── empty │ └── Empty.java │ ├── docstrings │ └── DocStrings.java │ ├── cdata │ └── Cdata.java │ ├── multiplefeatures │ └── MultipleFeatures.java │ ├── stacktraces │ └── StackTraces.java │ ├── multiplefeaturesreversed │ └── MultipleFeatures.java │ ├── hooksundefined │ └── HooksUndefined.java │ ├── regularexpression │ └── RegularExpression.java │ ├── unusedsteps │ └── UnusedSteps.java │ ├── minimal │ └── Minimal.java │ ├── undefined │ └── Undefined.java │ ├── ambiguous │ └── Ambiguous.java │ ├── unknownparametertype │ └── UnknownParameterType.java │ ├── backgrounds │ └── Backgrounds.java │ ├── rulesbackgrounds │ └── RulesBackgrounds.java │ ├── hooks │ └── Hooks.java │ ├── pending │ └── Pending.java │ ├── skipped │ └── Skipped.java │ └── datatables │ └── DataTables.java ├── datatable └── src │ └── main │ └── java │ └── io │ └── cucumber │ └── datatable │ ├── DiffType.java │ ├── DuplicateTypeException.java │ ├── InvalidDataTableTypeException.java │ ├── TableDiffException.java │ ├── TableTransformer.java │ ├── TypeReference.java │ ├── TableCellTransformer.java │ └── TableRowTransformer.java ├── .spotless └── intellij-idea.importorder ├── cucumber-gherkin └── src │ └── main │ └── java │ └── io │ └── cucumber │ └── core │ └── gherkin │ ├── Argument.java │ ├── Step.java │ ├── DataTableArgument.java │ ├── Feature.java │ ├── DocStringArgument.java │ ├── StepType.java │ └── FeatureParserException.java ├── .editorconfig ├── cucumber-plugin └── src │ └── main │ └── java │ └── io │ └── cucumber │ └── plugin │ ├── event │ ├── HookType.java │ ├── EventHandler.java │ ├── StepArgument.java │ ├── Group.java │ ├── TestRunStarted.java │ ├── DataTableArgument.java │ ├── Event.java │ ├── TimeStampedEvent.java │ ├── DocStringArgument.java │ ├── HookTestStep.java │ ├── WriteEvent.java │ ├── TestCaseEvent.java │ ├── TestCaseStarted.java │ ├── StepDefinedEvent.java │ ├── Argument.java │ └── TestStep.java │ ├── SummaryPrinter.java │ ├── ColorAware.java │ └── StrictAware.java ├── SEMVER.md ├── docstring └── src │ └── main │ └── java │ └── io │ └── cucumber │ └── docstring │ ├── CucumberDocStringException.java │ └── ConversionRequired.java ├── .gitignore └── release-notes ├── v2.0.1.md ├── v2.3.0.md └── v2.2.0.md /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Dfile.encoding=UTF-8 2 | -------------------------------------------------------------------------------- /cucumber-testng/.gitignore: -------------------------------------------------------------------------------- 1 | /test-output/ 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: cucumber 2 | github: cucumber 3 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/runtime/empty.feature: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-guice/.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.settings 3 | /.classpath 4 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resource-symlink: -------------------------------------------------------------------------------- 1 | resources/io/cucumber/core/resource -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/bar.properties: -------------------------------------------------------------------------------- 1 | bar=BAR 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/foo.properties: -------------------------------------------------------------------------------- 1 | foo=FOO 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/resource.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/other-resource.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/has spaces.properties: -------------------------------------------------------------------------------- 1 | has=spaces 2 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/error/parse-error.feature: -------------------------------------------------------------------------------- 1 | Invalid syntax -------------------------------------------------------------------------------- /examples/calculator-java-cli/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /examples/calculator-java-junit5/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /cucumber-cdi2/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/options/runtime-options-empty-rerun.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/spaces in name resource.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/empty.feature: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-archetype/src/test/resources/projects/should-generate-project/archetype.pom.properties: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-kotlin-java8/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md). 2 | -------------------------------------------------------------------------------- /cucumber-archetype/src/test/resources/projects/should-generate-project/goal.txt: -------------------------------------------------------------------------------- 1 | clean test verify 2 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-java-cli/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-java8-cli/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /test-output/ 5 | -------------------------------------------------------------------------------- /examples/calculator-kotlin-junit5/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /test-output/ 5 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/env-test.properties: -------------------------------------------------------------------------------- 1 | ENV_TEST=from-bundle 2 | a.b=a.b 3 | B_C=B_C 4 | c.D=C_D 5 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | jpa: 3 | open-in-view: false 4 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-test/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /cucumber-cdi2/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.cdi2.Cdi2Factory 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/options/runtime-options-rerun.txt: -------------------------------------------------------------------------------- 1 | this/should/be/rerun.feature:12 2 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.guice.GuiceFactory -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | 3 | -------------------------------------------------------------------------------- /cucumber-spring/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.spring.SpringFactory -------------------------------------------------------------------------------- /cucumber-java8/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | cucumber.glue=io.cucumber.java8 3 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | 3 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/rerun/rerun.txt: -------------------------------------------------------------------------------- 1 | classpath:io/cucumber/junit/platform/engine/single.feature:3 2 | -------------------------------------------------------------------------------- /cucumber-openejb/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.openejb.OpenEJBObjectFactory -------------------------------------------------------------------------------- /cucumber-picocontainer/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.picocontainer.PicoFactory -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/options/GlueFile.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | class GlueFile { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.core.backend.DefaultObjectFactory 2 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.deltaspike.DeltaSpikeObjectFactory -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.jakarta.cdi.CdiJakartaFactory 2 | -------------------------------------------------------------------------------- /cucumber-java/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.java.JavaBackendProviderService -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-java8/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.java8.Java8BackendProviderService -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.testng.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.core.backend.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-guice/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.guice.GuiceBackendProviderService 2 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.jakarta.openejb.OpenEJBObjectFactory 2 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.spring.SpringBackendProviderService 2 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/empty/Empty.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.empty; 2 | 3 | public class Empty { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-java/src/codegen/resources/templates/package-info.ftl: -------------------------------------------------------------------------------- 1 | /** 2 | * ${language_name} 3 | */ 4 | package io.cucumber.java.${normalized_language}; 5 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.platform.engine.CucumberTestEngine -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/error/lexer_error.feature: -------------------------------------------------------------------------------- 1 | Feature FA 2 | 3 | Scenario SA 4 | Given GA 5 | When GA 6 | Then TA -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/DiffType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | enum DiffType { 4 | NONE, DELETE, INSERT 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/chosen.override.css: -------------------------------------------------------------------------------- 1 | .chosen-container { 2 | min-width: 30%; 3 | display: block; 4 | } 5 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/empty-scenario.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature containing an empty scenario 2 | 3 | Scenario: Empty scenario 4 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/resource/test/OtherClass.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.resource.test; 2 | 3 | public class OtherClass { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/main/resources/META-INF/services/io.cucumber.core.gherkin.FeatureParser: -------------------------------------------------------------------------------- 1 | io.cucumber.core.gherkin.messages.GherkinMessagesFeatureParser 2 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/resources/io/cucumber/guice/integration/hello.feature: -------------------------------------------------------------------------------- 1 | Feature: Hello 2 | 3 | Scenario: World 4 | Given I have 3 cukes in my belly 5 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: in the belly 4 | Given I have 5 cukes in the belly -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/empty-scenario.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature containing an empty scenario 2 | 3 | Scenario: Empty scenario 4 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/SingletonObject.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | public class SingletonObject { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/UnScopedObject.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | public class UnScopedObject { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.core.gherkin.messages.StubBackendProviderService 2 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.platform.engine.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/resource/test/ExampleInterface.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.resource.test; 2 | 3 | public interface ExampleInterface { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/lexer-error.feature: -------------------------------------------------------------------------------- 1 | Feature FA 2 | 3 | Scenario SA 4 | Given GA 5 | When GA 6 | Then TA -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/no-pickles.feature: -------------------------------------------------------------------------------- 1 | Feature: The first rule of the empty feature is no scenarios 2 | 3 | Rule: Test -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/ScenarioScopedObject.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | public class ScenarioScopedObject { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/feature.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/cucumber-junit-platform-engine/src/test/resources/feature.jar -------------------------------------------------------------------------------- /examples/calculator-java-junit5/src/test/java/io/cucumber/examples/calculator/Example.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | public interface Example { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /examples/calculator-java-junit5/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | cucumber.plugin=html:target/results.html,message:target/results.ndjson 3 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | cucumber.plugin=html:target/results.html,message:target/results.ndjson 3 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/java/io/cucumber/testng/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | public class RunCucumberTest extends AbstractTestNGCucumberTests { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/io/cucumber/core/version.properties: -------------------------------------------------------------------------------- 1 | cucumber-jvm.version=${parent.version} 2 | gherkin.version=${gherkin.version} 3 | messages.version=${messages.version} 4 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/META-INF/services/io.cucumber.core.eventbus.UuidGenerator: -------------------------------------------------------------------------------- 1 | io.cucumber.core.eventbus.RandomUuidGenerator 2 | io.cucumber.core.eventbus.IncrementingUuidGenerator 3 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/resource/test/ExampleClass.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.resource.test; 2 | 3 | public class ExampleClass implements ExampleInterface { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/empty-scenario.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature containing an empty scenario 2 | 3 | Scenario: Empty scenario 4 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.glue=io.cucumber.junit.platform.engine 2 | cucumber.filter.tags=not @Disabled 3 | cucumber.publish.quiet=true 4 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/empty-table.feature: -------------------------------------------------------------------------------- 1 | Feature: Empty table 2 | 3 | Scenario: This is valid Gherkin 4 | Given an empty list 5 | | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/resources/io/cucumber/openejb/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: Eat some cukes 4 | Given I have 4 cukes in my belly 5 | Then there are 4 cukes in my belly -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/fa.feature: -------------------------------------------------------------------------------- 1 | Feature: FA 2 | # Some characters that need HTML escaping 3 | Scenario: SA 4 | Given G&A 5 | When GA 7 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/resources/META-INF/openwebbeans.properties: -------------------------------------------------------------------------------- 1 | # avoid warning on java 11 2 | org.apache.webbeans.spi.DefiningClassService=org.apache.webbeans.service.ClassLoaderProxyService 3 | -------------------------------------------------------------------------------- /cucumber-kotlin-java8/README.md: -------------------------------------------------------------------------------- 1 | Java 8 Bindings for Kotlin 2 | ========================== 3 | 4 | This module only runs tests. 5 | 6 | You can use `cucumber-java` or `cucumber-java8` directly in Kotlin. 7 | -------------------------------------------------------------------------------- /cucumber-java8/src/test/resources/io/cucumber/java8/anon-inner-class-step-definitions.feature: -------------------------------------------------------------------------------- 1 | Feature: Java8 2 | 3 | Scenario: use the API with Java7 style 4 | Given I have 42 java7 beans in my belly 5 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/java/io/cucumber/junit/platform/engine/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit.platform.engine; 2 | 3 | @Cucumber 4 | public class RunCucumberTest { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/jar-resource.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/cucumber-core/src/test/resources/io/cucumber/core/resource/test/jar-resource.jar -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | public interface Options { 4 | 5 | Class getObjectFactoryClass(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/eventbus/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.eventbus; 2 | 3 | public interface Options { 4 | 5 | Class getUuidGeneratorClass(); 6 | 7 | } 8 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/chosen-sprite.png -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/spring-resource.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/cucumber-core/src/test/resources/io/cucumber/core/resource/test/spring-resource.jar -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/resources/io/cucumber/jakarta/openejb/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: Eat some cukes 4 | Given I have 4 cukes in my belly 5 | Then there are 4 cukes in my belly -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import org.junit.runner.RunWith; 4 | 5 | @RunWith(Cucumber.class) 6 | public class RunCucumberTest { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/undefined/undefined_steps.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature containing undefined steps 2 | 3 | Scenario: SC1 4 | When undefined step 5 | Then another undefined step 6 | -------------------------------------------------------------------------------- /.spotless/intellij-idea.importorder: -------------------------------------------------------------------------------- 1 | # Organize import order using IntelliJ IDEA defaults 2 | # Escaped hashes sort static methods last: https://github.com/diffplug/spotless/issues/306 3 | 1= 4 | 2=javax 5 | 3=java 6 | 4=\# 7 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/unnamed.feature: -------------------------------------------------------------------------------- 1 | Feature: 2 | Rule: 3 | Scenario: 4 | Scenario Outline: 5 | Examples: 6 | | key | 7 | | value | 8 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/bad-features/parse-error.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a parse error 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | AndAStep with an invalid keyword 6 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/Argument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | import io.cucumber.plugin.event.StepArgument; 4 | 5 | public interface Argument extends StepArgument { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/parameter-types.feature: -------------------------------------------------------------------------------- 1 | Feature: ParameterTypes 2 | 3 | Scenario: Convert a parameter to date via the @ParameterType Annotation 4 | Given today is 1907-11-14 5 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/fb.feature: -------------------------------------------------------------------------------- 1 | Feature: FB 2 | # Scenario with same step occurring twice 3 | 4 | Scenario: SB 5 | When foo 6 | Then bar 7 | 8 | When foo 9 | Then baz 10 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/snippets/Joiner.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.snippets; 2 | 3 | import java.util.List; 4 | 5 | interface Joiner { 6 | 7 | String concatenate(List words); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/root.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature in classpath root 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | When it is executed 6 | Then nothing else happens 7 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/beans/DummyComponent.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.beans; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | @Component 6 | public class DummyComponent { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/beans/TestController.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.beans; 2 | 3 | import org.springframework.stereotype.Controller; 4 | 5 | @Controller 6 | public class TestController { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/stepexpression/Argument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.stepexpression; 2 | 3 | public interface Argument { 4 | 5 | Object getValue(); 6 | 7 | String toString(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/french-iso-8859-1-cukes.feature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/HEAD/cucumber-java/src/test/resources/io/cucumber/java/annotation/french-iso-8859-1-cukes.feature -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/french-numbers.feature: -------------------------------------------------------------------------------- 1 | # language: fr 2 | Fonctionnalité: Concombres fractionnaires 3 | 4 | Scénario: dans la ventre 5 | Étant donné j'ai 5,5 concombres fractionnaires 6 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/options/CucumberPropertiesProvider.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | @FunctionalInterface 4 | public interface CucumberPropertiesProvider { 5 | 6 | String get(String key); 7 | } 8 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/single.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single scenario 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | When it is executed 6 | Then nothing else happens 7 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runtime/RunnerSupplier.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import io.cucumber.core.runner.Runner; 4 | 5 | public interface RunnerSupplier { 6 | 7 | Runner get(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/springBeanInjection.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes injection 2 | 3 | Scenario: annotated bean injected 4 | Then I have belly 5 | 6 | Scenario: xml bean injected 7 | Then I have belly bean 8 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/single-duplicate.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single scenario 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | When it is executed 6 | Then nothing else happens 7 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/feature/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.feature; 2 | 3 | import java.net.URI; 4 | import java.util.List; 5 | 6 | public interface Options { 7 | 8 | List getFeaturePaths(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/incorrectlysubclassedsteps/SubclassesSteps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.incorrectlysubclassedsteps; 2 | 3 | import io.cucumber.java.steps.Steps; 4 | 5 | public class SubclassesSteps extends Steps { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | charset = utf-8 6 | insert_final_newline = true 7 | 8 | [*.xml] 9 | indent_style = space 10 | indent_size = 4 11 | 12 | [*.{feature, yml}] 13 | indent_style = space 14 | indent_size = 2 15 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/steps/Steps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.steps; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class Steps { 6 | 7 | @Given("test") 8 | public void test() { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/HookType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public enum HookType { 7 | BEFORE, AFTER, BEFORE_STEP, AFTER_STEP 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runtime/ObjectFactorySupplier.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import io.cucumber.core.backend.ObjectFactory; 4 | 5 | public interface ObjectFactorySupplier { 6 | 7 | ObjectFactory get(); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/stepexpression/DocStringTransformer.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.stepexpression; 2 | 3 | @FunctionalInterface 4 | interface DocStringTransformer { 5 | 6 | T transform(String docString, String contentType); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/single.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single scenario 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | When it is executed 6 | Then is only runs once 7 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cucumber-archetype/src/main/resources/archetype-resources/src/test/resources/__packageInPathFormat__/example.feature: -------------------------------------------------------------------------------- 1 | Feature: An example 2 | 3 | Scenario: The example 4 | Given an example scenario 5 | When all step definitions are implemented 6 | Then the scenario passes 7 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/test/java/io/cucumber/picocontainer/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.picocontainer; 2 | 3 | import io.cucumber.junit.Cucumber; 4 | import org.junit.runner.RunWith; 5 | 6 | @RunWith(Cucumber.class) 7 | public class RunCucumberTest { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/EventHandler.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public interface EventHandler { 7 | 8 | void receive(T event); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/feature-with-same-steps-in-different-scenarios.feature: -------------------------------------------------------------------------------- 1 | Feature: In cucumber.testng 2 | 3 | Scenario: first 4 | When step 5 | Then another step 6 | 7 | Scenario: second 8 | When step 9 | Then another step 10 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runtime/FeatureSupplier.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import io.cucumber.core.gherkin.Feature; 4 | 5 | import java.util.List; 6 | 7 | public interface FeatureSupplier { 8 | 9 | List get(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/resources/io/cucumber/examples/wicket/main/view/Rent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /cucumber-archetype/src/test/resources/projects/should-generate-project/archetype.properties: -------------------------------------------------------------------------------- 1 | groupId=com.example 2 | artifactId=cucumber 3 | version=0.0.1-SNAPSHOT 4 | package=com.example 5 | packageInPathFormat=com/example 6 | archetypeGroupId=io.cucumber 7 | archetypeArtifactId=cucumber-archetype 8 | -------------------------------------------------------------------------------- /cucumber-archetype/src/test/resources/projects/should-generate-project/reference/src/test/resources/com/example/example.feature: -------------------------------------------------------------------------------- 1 | Feature: An example 2 | 3 | Scenario: The example 4 | Given an example scenario 5 | When all step definitions are implemented 6 | Then the scenario passes 7 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/stepexpression/RawTableTransformer.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.stepexpression; 2 | 3 | import java.util.List; 4 | 5 | @FunctionalInterface 6 | interface RawTableTransformer { 7 | 8 | T transform(List> raw); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/disabled.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with some work in progress 2 | 3 | @Disabled 4 | Scenario: A disabled scenario 5 | Given a single scenario 6 | When it is executed 7 | Then nothing else happens 8 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/repeatable/Steps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.repeatable; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class Steps { 6 | 7 | @Given("test") 8 | @Given("test again") 9 | public void test() { 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/order/PickleOrder.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.order; 2 | 3 | import io.cucumber.core.gherkin.Pickle; 4 | 5 | import java.util.List; 6 | 7 | public interface PickleOrder { 8 | 9 | List orderPickles(List pickles); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/HookNoArgsBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @FunctionalInterface 6 | @API(status = API.Status.STABLE) 7 | public interface HookNoArgsBody { 8 | 9 | void accept() throws Throwable; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/resource.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single scenario 2 | 3 | @ResourceA @ResourceAReadOnly 4 | Scenario: A single scenario 5 | Given a single scenario 6 | When it is executed 7 | Then is only runs once 8 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/contextCaching.feature: -------------------------------------------------------------------------------- 1 | Feature: context caching with JUnit tests 2 | 3 | Scenario: There can only be one application context 4 | When I run a scenario in the same JVM as the SharedContextTest 5 | Then there should be only one Spring context 6 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/java/io/cucumber/testng/RunFeatureWithThreeScenariosTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | @CucumberOptions(features = "classpath:io/cucumber/testng/three-scenarios.feature") 4 | public class RunFeatureWithThreeScenariosTest extends AbstractTestNGCucumberTests { 5 | 6 | } 7 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runtime/BackendSupplier.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import io.cucumber.core.backend.Backend; 4 | 5 | import java.util.Collection; 6 | 7 | public interface BackendSupplier { 8 | 9 | Collection get(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/HookBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @FunctionalInterface 6 | @API(status = API.Status.STABLE) 7 | public interface HookBody { 8 | 9 | void accept(Scenario scenario) throws Throwable; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-java8/src/test/java/io/cucumber/java8/steps/Steps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8.steps; 2 | 3 | import io.cucumber.java8.En; 4 | 5 | public class Steps implements En { 6 | 7 | public Steps() { 8 | 9 | Given("test", () -> { 10 | 11 | }); 12 | 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/with space.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single scenario inside a file with space in filename 2 | 3 | Scenario: A single scenario 4 | Given a single scenario 5 | When it is executed 6 | Then nothing else happens 7 | -------------------------------------------------------------------------------- /cucumber-spring/src/main/java/io/cucumber/spring/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enables dependency injection by Spring 3 | *

4 | * By including the cucumber-spring on your CLASSPATH 5 | * your step definitions will be instantiated by Spring. 6 | */ 7 | package io.cucumber.spring; 8 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/RunCucumberTestWithStepNotifications.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import org.junit.runner.RunWith; 4 | 5 | @RunWith(Cucumber.class) 6 | @CucumberOptions(stepNotifications = true) 7 | public class RunCucumberTestWithStepNotifications { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-openejb/src/main/java/io/cucumber/openejb/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enables dependency injection by OpenEJB 3 | *

4 | * By including the cucumber-openejb on your CLASSPATH 5 | * your step definitions will be instantiated by OpenEJB. 6 | */ 7 | package io.cucumber.openejb; 8 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/cucumbercontextconfigannotation/AnnotatedInterface.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.cucumbercontextconfigannotation; 2 | 3 | import io.cucumber.spring.CucumberContextConfiguration; 4 | 5 | @CucumberContextConfiguration 6 | public interface AnnotatedInterface { 7 | } 8 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/options/TestPluginOption.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | public class TestPluginOption { 4 | 5 | public static PluginOption parse(String pluginArgumentPattern) { 6 | return PluginOption.parse(pluginArgumentPattern); 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/annotation/Steps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.annotation; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class Steps { 6 | 7 | @Given("I have {int} cukes in the belly") 8 | public void I_have_cukes_in_the_belly(int arg1) { 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/springBeanInjectionWithMetaConfiguration.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes injection with meta annotation 2 | 3 | Scenario: annotated bean with meta injected 4 | Then I have a meta belly 5 | 6 | Scenario: xml bean with meta injected 7 | Then I have a meta belly bean 8 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/docstrings/DocStrings.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.docstrings; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class DocStrings { 6 | 7 | @Given("a doc string:") 8 | public void docString(String docString) { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/test/resources/io/cucumber/deltaspike/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: Eat some cukes 4 | Given I have 4 cukes in my belly 5 | Then there are 4 cukes in my belly 6 | 7 | Scenario: Eat some more cukes 8 | Given I have 6 cukes in my belly 9 | Then there are 6 cukes in my belly -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/Status.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public enum Status { 7 | PASSED, 8 | SKIPPED, 9 | PENDING, 10 | UNDEFINED, 11 | AMBIGUOUS, 12 | FAILED, 13 | UNUSED 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/Status.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public enum Status { 7 | PASSED, 8 | SKIPPED, 9 | PENDING, 10 | UNDEFINED, 11 | AMBIGUOUS, 12 | FAILED, 13 | UNUSED 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/annotationContextConfiguration.feature: -------------------------------------------------------------------------------- 1 | Feature: context configuration with @CucumberContextConfiguration annotation 2 | 3 | Scenario: Spring configuration is picked up, when no step definitions are present 4 | Then cucumber picks up configuration class without step defs 5 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/cdata/Cdata.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.cdata; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class Cdata { 6 | 7 | @Given("I have {int} in my belly") 8 | public void iHaveCDATACukesInMyBelly(int count) { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/StaticHookDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.EXPERIMENTAL) 6 | public interface StaticHookDefinition extends Located { 7 | 8 | void execute(); 9 | 10 | int getOrder(); 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/cli/MainDemo.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.cli; 2 | 3 | public class MainDemo { 4 | 5 | public static void main(String[] args) { 6 | // Main.main("--i18n"); 7 | // Main.main("--i18n", "help"); 8 | Main.main("--i18n-keywords", "tlh"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DataTableCellDefinitionBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @FunctionalInterface 6 | @API(status = API.Status.STABLE) 7 | public interface DataTableCellDefinitionBody { 8 | 9 | T accept(String cell) throws Throwable; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DocStringDefinitionBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @FunctionalInterface 6 | @API(status = API.Status.STABLE) 7 | public interface DocStringDefinitionBody { 8 | 9 | T accept(String docString) throws Throwable; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/java/io/cucumber/openejb/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.openejb; 2 | 3 | public class Belly { 4 | 5 | private int cukes; 6 | 7 | public int getCukes() { 8 | return cukes; 9 | } 10 | 11 | public void setCukes(int cukes) { 12 | this.cukes = cukes; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/Status.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public enum Status { 7 | PASSED, 8 | SKIPPED, 9 | PENDING, 10 | UNDEFINED, 11 | AMBIGUOUS, 12 | FAILED, 13 | UNUSED 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/StepArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Represents Gherkin step argument. Can be either a data table or doc string. 7 | */ 8 | @API(status = API.Status.STABLE) 9 | public interface StepArgument { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/main/java/io/cucumber/jakarta/openejb/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enables dependency injection by OpenEJB 3 | *

4 | * By including the cucumber-jakarta-openejb on your 5 | * CLASSPATH your step definitions will be instantiated by OpenEJB. 6 | */ 7 | package io.cucumber.jakarta.openejb; 8 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/main/java/io/cucumber/picocontainer/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enables dependency injection by PicoContainer 3 | *

4 | * By including the cucumber-picocontainer on your 5 | * CLASSPATH your step definitions will be instantiated by 6 | * PicoContainer. 7 | */ 8 | package io.cucumber.picocontainer; 9 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/test/java/io/cucumber/picocontainer/SanityTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.picocontainer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | class SanityTest { 6 | 7 | @Test 8 | void reports_events_correctly_with_cucumber_runner() { 9 | SanityChecker.run(RunCucumberTest.class, true); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/test/java/io/cucumber/picocontainer/SomeTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.picocontainer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | class SomeTest { 6 | 7 | @Test 8 | void one() { 9 | } 10 | 11 | @Test 12 | void two() { 13 | } 14 | 15 | @Test 16 | void three() { 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/beans/BellyBean.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.beans; 2 | 3 | public class BellyBean { 4 | 5 | private int cukes = 0; 6 | 7 | public int getCukes() { 8 | return cukes; 9 | } 10 | 11 | public void setCukes(int cukes) { 12 | this.cukes = cukes; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/test/resources/io/cucumber/examples/spring/application/see-messages.feature: -------------------------------------------------------------------------------- 1 | Feature: See Messages 2 | 3 | Scenario: See another user's messages 4 | Given there is a user 5 | And the user has posted the message "this is my message" 6 | When I visit the page for the User 7 | Then I should see "this is my message" 8 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/multiplefeatures/MultipleFeatures.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.multiplefeatures; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class MultipleFeatures { 6 | 7 | @Given("an order for {string}") 8 | public void an_order_for_item(String item) { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/Step.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | public interface Step extends io.cucumber.plugin.event.Step { 4 | 5 | StepType getType(); 6 | 7 | String getPreviousGivenWhenThenKeyword(); 8 | 9 | String getId(); 10 | 11 | @Override 12 | Argument getArgument(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/java/io/cucumber/jakarta/openejb/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.jakarta.openejb; 2 | 3 | public class Belly { 4 | 5 | private int cukes; 6 | 7 | public int getCukes() { 8 | return cukes; 9 | } 10 | 11 | public void setCukes(int cukes) { 12 | this.cukes = cukes; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/three-scenarios.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature containing 3 scenarios 2 | 3 | Scenario: SC1 4 | Given foo 5 | When foo 6 | Then baz 7 | 8 | Scenario: SC2 9 | Given foo 10 | When foo 11 | Then baz 12 | 13 | Scenario: SC3 14 | Given foo 15 | When foo 16 | Then baz 17 | -------------------------------------------------------------------------------- /cucumber-cdi2/src/test/resources/io/cucumber/cdi2/example/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: Eat some cukes 4 | Given I have 4 cukes in my belly 5 | Then there are 4 cukes in my belly 6 | 7 | Scenario: Eat some more cukes 8 | Given I have 6 cukes in my belly 9 | And I eat 2 more cukes 10 | Then there are 8 cukes in my belly 11 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/impl/LivesInChildClassLoader.java.txt: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.impl; 2 | 3 | import com.google.inject.Injector; 4 | import io.cucumber.guice.InjectorSource; 5 | 6 | public class LivesInChildClassLoader implements InjectorSource { 7 | @Override 8 | public Injector getInjector() { 9 | return null; 10 | } 11 | } -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/DuplicateTypeException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public final class DuplicateTypeException extends CucumberDataTableException { 7 | DuplicateTypeException(String message) { 8 | super(message); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /SEMVER.md: -------------------------------------------------------------------------------- 1 | Semantic Versioning 2 | =================== 3 | 4 | This project adheres to [Semantic Versioning](http://semver.org/). 5 | 6 | ## Public API ## 7 | 8 | The public API consists of: 9 | * Any public class in the `cucumber.api` package or subpackage thereof. 10 | * Any public class annotated with `@org.apiguardian.api.API(status = API.Status.STABLE)`. 11 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/stacktraces/StackTraces.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.stacktraces; 2 | 3 | import io.cucumber.java.en.When; 4 | 5 | public class StackTraces { 6 | 7 | @When("a step throws an exception") 8 | public void test() throws Exception { 9 | throw new Exception("BOOM"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/DataTableTypeDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.datatable.DataTableType; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.STABLE) 7 | public interface DataTableTypeDefinition extends Located { 8 | 9 | DataTableType dataTableType(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /examples/calculator-java-junit5/src/test/resources/io/cucumber/examples/calculator/shopping.feature: -------------------------------------------------------------------------------- 1 | Feature: Shopping 2 | 3 | Scenario: Give correct change 4 | Given the following groceries: 5 | | name | price | 6 | | milk | 9 | 7 | | bread | 7 | 8 | | soap | 5 | 9 | When I pay 25 10 | Then my change should be 4 11 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/resources/io/cucumber/examples/calculator/shopping.feature: -------------------------------------------------------------------------------- 1 | Feature: Shopping 2 | 3 | Scenario: Give correct change 4 | Given the following groceries: 5 | | name | price | 6 | | milk | 9 | 7 | | bread | 7 | 8 | | soap | 5 | 9 | When I pay 25 10 | Then my change should be 4 11 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/multiplefeaturesreversed/MultipleFeatures.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.multiplefeaturesreversed; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class MultipleFeatures { 6 | 7 | @Given("an order for {string}") 8 | public void an_order_for_item(String item) { 9 | 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/DocStringTypeDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.docstring.DocStringType; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.EXPERIMENTAL) 7 | public interface DocStringTypeDefinition extends Located { 8 | 9 | DocStringType docStringType(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/vis-timeline-graph2d.override.css: -------------------------------------------------------------------------------- 1 | .vis-item.vis-selected { 2 | border-color: #8f3938; 3 | font-weight: bold; 4 | } 5 | 6 | .vis-item.failed { 7 | background-color: #f5f5f5; 8 | } 9 | 10 | .vis-item.vis-selected { 11 | background-color: #000000 !important; 12 | color: #ffffff; 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/DataTableArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | import java.util.List; 4 | 5 | public interface DataTableArgument extends Argument, io.cucumber.plugin.event.DataTableArgument { 6 | 7 | @Override 8 | List> cells(); 9 | 10 | @Override 11 | int getLine(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DataTableRowDefinitionBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.List; 6 | 7 | @FunctionalInterface 8 | @API(status = API.Status.STABLE) 9 | public interface DataTableRowDefinitionBody { 10 | 11 | T accept(List row) throws Throwable; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/main/java/io/cucumber/junit/platform/engine/NamingStrategy.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit.platform.engine; 2 | 3 | import io.cucumber.core.gherkin.Pickle; 4 | import io.cucumber.plugin.event.Node; 5 | 6 | interface NamingStrategy { 7 | 8 | String name(Node node); 9 | 10 | String nameExample(Node node, Pickle pickle); 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/stepdefInjection.feature: -------------------------------------------------------------------------------- 1 | Feature: StepDef injection 2 | 3 | Scenario: StepDef injection 4 | Given the StepDef injection works 5 | When I assign the "cucumbers" attribute to 4 in one step def class 6 | Then I can read 4 cucumbers from the other step def class 7 | And 4 have been pushed to a third step def class 8 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/factory/SecondInjectorSource.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.factory; 2 | 3 | import com.google.inject.Injector; 4 | import io.cucumber.guice.InjectorSource; 5 | 6 | public class SecondInjectorSource implements InjectorSource { 7 | @Override 8 | public Injector getInjector() { 9 | return null; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/resources/io/cucumber/jakarta/cdi/example/cukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Cukes 2 | 3 | Scenario: Eat some cukes 4 | Given I have 4 cukes in my belly 5 | Then there are 4 cukes in my belly 6 | 7 | Scenario: Eat some more cukes 8 | Given I have 6 cukes in my belly 9 | And I eat 2 more cukes 10 | Then there are 8 cukes in my belly 11 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DataTableDefinitionBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import io.cucumber.datatable.DataTable; 4 | import org.apiguardian.api.API; 5 | 6 | @FunctionalInterface 7 | @API(status = API.Status.STABLE) 8 | public interface DataTableDefinitionBody { 9 | 10 | T accept(DataTable table) throws Throwable; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/java/io/cucumber/examples/spring/application/UserRepository.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | @Repository 7 | public interface UserRepository extends CrudRepository { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DataTableEntryDefinitionBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.Map; 6 | 7 | @FunctionalInterface 8 | @API(status = API.Status.STABLE) 9 | public interface DataTableEntryDefinitionBody { 10 | 11 | T accept(Map entry) throws Throwable; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/ParameterTypeDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.cucumberexpressions.ParameterType; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.EXPERIMENTAL) 7 | public interface ParameterTypeDefinition extends Located { 8 | 9 | ParameterType parameterType(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runner/UndefinedStepDefinitionException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runner; 2 | 3 | import io.cucumber.core.exception.CucumberException; 4 | 5 | final class UndefinedStepDefinitionException extends CucumberException { 6 | 7 | UndefinedStepDefinitionException() { 8 | super("No step definitions found"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/contextcaching/ContextConfig.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.contextcaching; 2 | 3 | import org.springframework.context.annotation.ComponentScan; 4 | import org.springframework.context.annotation.Configuration; 5 | 6 | @Configuration 7 | @ComponentScan("io.cucumber.spring.contextcaching") 8 | public class ContextConfig { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /examples/calculator-kotlin-junit5/src/test/resources/io/cucumber/examples/calculator/shopping.feature: -------------------------------------------------------------------------------- 1 | Feature: Shopping 2 | 3 | @shopping 4 | Scenario: Give correct change 5 | Given the following groceries 6 | | name | price | 7 | | milk | 9 | 8 | | bread | 7 | 9 | | soap | 5 | 10 | When I pay 25 11 | Then my change should be 4 12 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/hooksundefined/HooksUndefined.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.hooksundefined; 2 | 3 | import io.cucumber.java.After; 4 | import io.cucumber.java.Before; 5 | 6 | public class HooksUndefined { 7 | 8 | @Before 9 | public void before() { 10 | } 11 | 12 | @After 13 | public void after() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/regularexpression/RegularExpression.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.regularexpression; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class RegularExpression { 6 | @Given("^a (.*?)(?: and a (.*?))?(?: and a (.*?))?$") 7 | public void some_vegetables(String a, String b, String c) { 8 | 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runner/StepDefinitionMatch.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runner; 2 | 3 | import io.cucumber.core.backend.TestCaseState; 4 | 5 | interface StepDefinitionMatch { 6 | 7 | void runStep(TestCaseState state) throws Throwable; 8 | 9 | void dryRunStep(TestCaseState state) throws Throwable; 10 | 11 | String getCodeLocation(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/doc-string.feature: -------------------------------------------------------------------------------- 1 | Feature: Doc String 2 | 3 | Scenario: This is valid Gherkin 4 | Given an doc string 5 | """ 6 | This doc string has no content type 7 | """ 8 | Given an doc string with content type 9 | """text/plain 10 | This doc string has content a type 11 | """ 12 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/java/io/cucumber/examples/wicket/main/model/dao/CarDAO.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.wicket.main.model.dao; 2 | 3 | import io.cucumber.examples.wicket.main.model.entity.Car; 4 | 5 | public interface CarDAO { 6 | 7 | void add(Car car); 8 | 9 | Car findAvailableCar(); 10 | 11 | int getNumberOfAvailableCars(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/java/io/cucumber/examples/wicket/main/model/entity/Car.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.wicket.main.model.entity; 2 | 3 | public class Car { 4 | 5 | private boolean rented; 6 | 7 | public void rent() { 8 | rented = true; 9 | } 10 | 11 | public boolean isRented() { 12 | return rented; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/test/java/io/cucumber/deltaspike/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.deltaspike; 2 | 3 | import javax.inject.Singleton; 4 | 5 | @Singleton 6 | public class Belly { 7 | 8 | private int cukes; 9 | 10 | public int getCukes() { 11 | return cukes; 12 | } 13 | 14 | public void setCukes(int cukes) { 15 | this.cukes = cukes; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/background.feature: -------------------------------------------------------------------------------- 1 | Feature: Background 2 | 3 | Background: Can appear after feature 4 | Given a background 5 | 6 | Rule: Rules also have backgrounds 7 | Background: Can appear after rule 8 | And a and some more background 9 | 10 | Scenario: Both backgrounds are used 11 | Then three are 3 steps -------------------------------------------------------------------------------- /cucumber-java8/src/test/java/io/cucumber/java8/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.junit.platform.suite.api.IncludeEngines; 4 | import org.junit.platform.suite.api.SelectPackages; 5 | import org.junit.platform.suite.api.Suite; 6 | 7 | @Suite 8 | @IncludeEngines("cucumber") 9 | @SelectPackages("io.cucumber.java8") 10 | public class RunCucumberTest { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/fb.feature: -------------------------------------------------------------------------------- 1 | Feature: Feature B 2 | 3 | Background: 4 | Given background step 5 | 6 | Scenario: A 7 | Then scenario name 8 | 9 | Scenario: B 10 | Then scenario name 11 | 12 | Scenario Outline: C 13 | Then scenario 14 | Examples: 15 | | name | 16 | | C | 17 | | D | 18 | | E | 19 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/BackendProviderService.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.function.Supplier; 6 | 7 | @API(status = API.Status.STABLE) 8 | public interface BackendProviderService { 9 | 10 | Backend create(Lookup lookup, Container container, Supplier classLoader); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/InjectorSourceInstantiationFailed.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import io.cucumber.core.backend.CucumberBackendException; 4 | 5 | class InjectorSourceInstantiationFailed extends CucumberBackendException { 6 | 7 | InjectorSourceInstantiationFailed(String message, Throwable cause) { 8 | super(message, cause); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/Group.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import java.util.Collection; 4 | 5 | /** 6 | * A capture group in a Regular or Cucumber Expression. 7 | */ 8 | public interface Group { 9 | 10 | Collection getChildren(); 11 | 12 | String getValue(); 13 | 14 | int getStart(); 15 | 16 | int getEnd(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/calculator-kotlin-junit5/src/main/kotlin/io/cucumber/examples/calaculator/DateCalculator.kt: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calaculator 2 | 3 | import java.time.LocalDate 4 | import java.util.* 5 | 6 | class DateCalculator(private val now: LocalDate) { 7 | 8 | fun isDateInThePast(date: LocalDate): String { 9 | return if (date.isBefore(now)) "yes" else "no" 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/HelloWorldSteps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | import io.cucumber.guice.ScenarioScoped; 4 | import io.cucumber.java.en.Given; 5 | 6 | @ScenarioScoped 7 | public class HelloWorldSteps { 8 | 9 | @Given("I have {int} cukes in my belly") 10 | public void I_have_cukes_in_my_belly(int n) { 11 | 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DefaultParameterTransformerBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.reflect.Type; 6 | 7 | @FunctionalInterface 8 | @API(status = API.Status.STABLE) 9 | public interface DefaultParameterTransformerBody { 10 | 11 | Object accept(String fromValue, Type toValueType) throws Throwable; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/TestRunStarted.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | 7 | @API(status = API.Status.STABLE) 8 | public final class TestRunStarted extends TimeStampedEvent { 9 | 10 | public TestRunStarted(Instant timeInstant) { 11 | super(timeInstant); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/resources/templates/user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

10 | 11 | 12 | -------------------------------------------------------------------------------- /cucumber-cdi2/src/test/java/io/cucumber/cdi2/example/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.cdi2.example; 2 | 3 | import org.junit.platform.suite.api.IncludeEngines; 4 | import org.junit.platform.suite.api.SelectPackages; 5 | import org.junit.platform.suite.api.Suite; 6 | 7 | @Suite 8 | @IncludeEngines("cucumber") 9 | @SelectPackages("io.cucumber.cdi2.example") 10 | public class RunCucumberTest { 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/parameterized-scenario-outline.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a parameterized scenario outline 2 | 3 | Scenario Outline: A scenario full of s 4 | Given a scenario outline 5 | 6 | @Example1Tag 7 | Examples: Of the Gherkin variety 8 | | vegetable | 9 | | Cucumber | 10 | | Zucchini | 11 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/Feature.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | import io.cucumber.plugin.event.Node; 4 | 5 | import java.util.List; 6 | 7 | public interface Feature extends Node.Feature { 8 | 9 | Pickle getPickleAt(Node node); 10 | 11 | List getPickles(); 12 | 13 | String getSource(); 14 | 15 | Iterable getParseEvents(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DefaultDataTableCellTransformerBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.reflect.Type; 6 | 7 | @FunctionalInterface 8 | @API(status = API.Status.STABLE) 9 | public interface DefaultDataTableCellTransformerBody { 10 | 11 | Object accept(String fromValue, Type toValueType) throws Throwable; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-cdi2/src/test/java/io/cucumber/cdi2/example/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.cdi2.example; 2 | 3 | import javax.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class Belly { 7 | 8 | private int cukes; 9 | 10 | public int getCukes() { 11 | return cukes; 12 | } 13 | 14 | public void setCukes(int cukes) { 15 | this.cukes = cukes; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/commonglue/AutowiresThirdStepDef.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.commonglue; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | 5 | public class AutowiresThirdStepDef { 6 | 7 | @Autowired 8 | private ThirdStepDef thirdStepDef; 9 | 10 | public ThirdStepDef getThirdStepDef() { 11 | return thirdStepDef; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/snippets/SnippetType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.snippets; 2 | 3 | public enum SnippetType { 4 | UNDERSCORE(new SnakeCaseJoiner()), 5 | CAMELCASE(new CamelCaseJoiner()); 6 | 7 | private final Joiner joiner; 8 | 9 | SnippetType(Joiner joiner) { 10 | this.joiner = joiner; 11 | } 12 | 13 | Joiner joiner() { 14 | return joiner; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/plugin/StubFormatter.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.plugin; 2 | 3 | import io.cucumber.plugin.EventListener; 4 | import io.cucumber.plugin.event.EventPublisher; 5 | 6 | class StubFormatter implements EventListener { 7 | 8 | @Override 9 | public void setEventPublisher(EventPublisher publisher) { 10 | throw new UnsupportedOperationException(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/rule.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single rule 2 | 3 | Rule: A rule 4 | 5 | Example: An example of this rule 6 | Given a single scenario 7 | When it is executed 8 | Then nothing else happens 9 | 10 | 11 | Example: An other example of this rule 12 | Given a single scenario 13 | When it is executed 14 | Then nothing else happens 15 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/annotationconfig/AnnotationContextConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.annotationconfig; 2 | 3 | import io.cucumber.spring.CucumberContextConfiguration; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | @ContextConfiguration("classpath:cucumber.xml") 7 | @CucumberContextConfiguration 8 | public class AnnotationContextConfiguration { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/io/cucumber/spring/threadingCukes.feature: -------------------------------------------------------------------------------- 1 | Feature: Spring Threading Cukes 2 | In order to have a completely clean system for each scenario 3 | As a purity activist 4 | I want that beans have both scenario and thread scope. 5 | 6 | Scenario: A parallel execution 7 | Given I am a step definition 8 | When when executed in parallel 9 | Then I should not be shared between threads 10 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/unusedsteps/UnusedSteps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.unusedsteps; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class UnusedSteps { 6 | 7 | @Given("a step that is used") 8 | public void a_step_that_is_used() { 9 | 10 | } 11 | 12 | @Given("a step that is not used") 13 | public void a_step_that_is_not_used() { 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/plugin/UTF8OutputStreamWriter.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.plugin; 2 | 3 | import java.io.OutputStream; 4 | import java.io.OutputStreamWriter; 5 | import java.nio.charset.StandardCharsets; 6 | 7 | final class UTF8OutputStreamWriter extends OutputStreamWriter { 8 | 9 | UTF8OutputStreamWriter(OutputStream out) { 10 | super(out, StandardCharsets.UTF_8); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/DefaultDataTableCellTransformerDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.datatable.TableCellByTypeTransformer; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.STABLE) 7 | public interface DefaultDataTableCellTransformerDefinition extends Located { 8 | 9 | TableCellByTypeTransformer tableCellByTypeTransformer(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/DefaultParameterTransformerDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.cucumberexpressions.ParameterByTypeTransformer; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.STABLE) 7 | public interface DefaultParameterTransformerDefinition extends Located { 8 | 9 | ParameterByTypeTransformer parameterByTypeTransformer(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/runner/TestDefinitionArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runner; 2 | 3 | import io.cucumber.plugin.event.Argument; 4 | 5 | import java.util.List; 6 | 7 | public class TestDefinitionArgument { 8 | 9 | public static List createArguments(List match) { 10 | return DefinitionArgument.createArguments(match); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/DataTableArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Represents a Gherkin data table argument. 9 | */ 10 | @API(status = API.Status.STABLE) 11 | public interface DataTableArgument extends StepArgument { 12 | 13 | List> cells(); 14 | 15 | int getLine(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/calculator-java-cli/src/test/resources/io/cucumber/examples/calculator/date_calculator.feature: -------------------------------------------------------------------------------- 1 | Feature: Dates with different date formats 2 | This feature shows you can have different date formats, as long as you annotate the 3 | corresponding step definition method accordingly. 4 | 5 | Scenario: Determine past date 6 | Given today is 2011-01-20 7 | When I ask if 2011-01-19 is in the past 8 | Then the result should be yes 9 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/src/test/java/io/cucumber/examples/calculator/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import io.cucumber.junit.Cucumber; 4 | import io.cucumber.junit.CucumberOptions; 5 | import org.junit.runner.RunWith; 6 | 7 | @RunWith(Cucumber.class) 8 | @CucumberOptions(plugin = { "html:target/results.html", "message:target/results.ndjson" }) 9 | public class RunCucumberTest { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/minimal/Minimal.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.minimal; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | 7 | public class Minimal { 8 | 9 | @Given("I have {int} cukes in my belly") 10 | public void I_have_int_cukes_in_my_belly(int cukeCount) { 11 | assertEquals(42, cukeCount); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/undefined/Undefined.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.undefined; 2 | 3 | import io.cucumber.java.en.And; 4 | import io.cucumber.java.en.Given; 5 | 6 | public class Undefined { 7 | 8 | @Given("an implemented step") 9 | public void anImplementedStep() { 10 | } 11 | 12 | @And("a step that will be skipped") 13 | public void aStepThatWillBeSkipped() { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/DocStringArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | public interface DocStringArgument extends Argument, io.cucumber.plugin.event.DocStringArgument { 4 | 5 | @Override 6 | String getContent(); 7 | 8 | @Override 9 | String getContentType(); 10 | 11 | @Override 12 | String getMediaType(); 13 | 14 | @Override 15 | int getLine(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/java/io/cucumber/jakarta/cdi/example/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.jakarta.cdi.example; 2 | 3 | import jakarta.enterprise.context.ApplicationScoped; 4 | 5 | @ApplicationScoped 6 | public class Belly { 7 | 8 | private int cukes; 9 | 10 | public int getCukes() { 11 | return cukes; 12 | } 13 | 14 | public void setCukes(int cukes) { 15 | this.cukes = cukes; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/TestPendingException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import io.cucumber.core.backend.Pending; 4 | 5 | @Pending 6 | public final class TestPendingException extends RuntimeException { 7 | 8 | public TestPendingException() { 9 | this("TODO: implement me"); 10 | } 11 | 12 | public TestPendingException(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/src/test/resources/io/cucumber/examples/calculator/date_calculator.feature: -------------------------------------------------------------------------------- 1 | Feature: Dates with different date formats 2 | This feature shows you can have different date formats, as long as you annotate the 3 | corresponding step definition method accordingly. 4 | 5 | Scenario: Determine past date 6 | Given today is 2011-01-20 7 | When I ask if 2011-01-19 is in the past 8 | Then the result should be yes 9 | -------------------------------------------------------------------------------- /examples/calculator-java-junit5/src/test/resources/io/cucumber/examples/calculator/date_calculator.feature: -------------------------------------------------------------------------------- 1 | Feature: Dates with different date formats 2 | This feature shows you can have different date formats, as long as you annotate the 3 | corresponding step definition method accordingly. 4 | 5 | Scenario: Determine past date 6 | Given today is 2011-01-20 7 | When I ask if 2011-01-19 is in the past 8 | Then the result should be yes 9 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/resources/io/cucumber/examples/calculator/date_calculator.feature: -------------------------------------------------------------------------------- 1 | Feature: Dates with different date formats 2 | This feature shows you can have different date formats, as long as you annotate the 3 | corresponding step definition method accordingly. 4 | 5 | Scenario: Determine past date 6 | Given today is 2011-01-20 7 | When I ask if Jan 19, 2011 is in the past 8 | Then the result should be yes 9 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-test/src/test/java/io/cucumber/examples/wicket/test/RunCucumberIT.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.wicket.test; 2 | 3 | import io.cucumber.junit.Cucumber; 4 | import io.cucumber.junit.CucumberOptions; 5 | import org.junit.runner.RunWith; 6 | 7 | @RunWith(Cucumber.class) 8 | @CucumberOptions(plugin = { "html:target/results.html", "message:target/results.ndjson" }) 9 | public class RunCucumberIT { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/ambiguous/Ambiguous.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.ambiguous; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class Ambiguous { 6 | 7 | @Given("^a step with (.*)$") 8 | public void second_ambiguous_step(String a) { 9 | 10 | } 11 | 12 | @Given("^a (.*?) with (.*?)$") 13 | public void first_ambiguous_step(String a, String b) { 14 | 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/eventbus/AbstractEventBus.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.eventbus; 2 | 3 | public abstract class AbstractEventBus extends AbstractEventPublisher implements EventBus { 4 | 5 | @Override 6 | public void sendAll(Iterable queue) { 7 | super.sendAll(queue); 8 | } 9 | 10 | @Override 11 | public void send(T event) { 12 | super.send(event); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/Event.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | 7 | @API(status = API.Status.STABLE) 8 | public interface Event { 9 | 10 | /** 11 | * Returns instant from epoch. 12 | * 13 | * @return time instant in Instant 14 | * @see Instant#now() 15 | */ 16 | Instant getInstant(); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/java/io/cucumber/testng/TestPendingException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import io.cucumber.core.backend.Pending; 4 | 5 | @Pending 6 | public final class TestPendingException extends RuntimeException { 7 | 8 | public TestPendingException() { 9 | this("TODO: implement me"); 10 | } 11 | 12 | public TestPendingException(String message) { 13 | super(message); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/scenarios-with-tags.feature: -------------------------------------------------------------------------------- 1 | Feature: Some scenarios should be run in serial 2 | 3 | @Serial 4 | Scenario: This one runs serially 5 | Given foo 6 | When foo 7 | Then baz 8 | 9 | Scenario: This one in run in parallel 10 | Given foo 11 | When foo 12 | Then baz 13 | 14 | Scenario: This one in run in parallel too 15 | Given foo 16 | When foo 17 | Then baz 18 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/eventbus/EventBus.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.eventbus; 2 | 3 | import io.cucumber.plugin.event.EventPublisher; 4 | 5 | import java.time.Instant; 6 | import java.util.UUID; 7 | 8 | public interface EventBus extends EventPublisher { 9 | 10 | Instant getInstant(); 11 | 12 | UUID generateId(); 13 | 14 | void send(T event); 15 | 16 | void sendAll(Iterable queue); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/DefaultDataTableEntryTransformerBody.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.reflect.Type; 6 | import java.util.Map; 7 | 8 | @FunctionalInterface 9 | @API(status = API.Status.STABLE) 10 | public interface DefaultDataTableEntryTransformerBody { 11 | 12 | Object accept(Map fromValue, Type toValueType) throws Throwable; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/plugin/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.plugin; 2 | 3 | public interface Options { 4 | 5 | Iterable plugins(); 6 | 7 | boolean isMonochrome(); 8 | 9 | boolean isWip(); 10 | 11 | interface Plugin { 12 | 13 | Class pluginClass(); 14 | 15 | String argument(); 16 | 17 | String pluginString(); 18 | 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/eventbus/RandomUuidGenerator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.eventbus; 2 | 3 | import java.util.UUID; 4 | 5 | /** 6 | * UUID generator based on random numbers. The generator is thread-safe and 7 | * supports multi-jvm usage of Cucumber. 8 | */ 9 | public class RandomUuidGenerator implements UuidGenerator { 10 | @Override 11 | public UUID generateId() { 12 | return UUID.randomUUID(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/main/java/io/cucumber/core/gherkin/messages/GherkinMessagesLocation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin.messages; 2 | 3 | import io.cucumber.plugin.event.Location; 4 | 5 | final class GherkinMessagesLocation { 6 | 7 | static Location from(io.cucumber.messages.types.Location location) { 8 | return new Location(Math.toIntExact(location.getLine()), Math.toIntExact(location.getColumn().orElse(0L))); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/resources/io/cucumber/guice/integration/guice-no-scope.feature: -------------------------------------------------------------------------------- 1 | Feature: cucumber-guice supports no scoping 2 | 3 | Scenario: cucumber-guice provides a new instance every time when no scope is specified for the object 4 | Given an un-scoped instance has been provided in this scenario 5 | When another un-scoped instance is provided 6 | And another un-scoped instance is provided 7 | Then all three provided instances are unique instances -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/rule.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature with a single rule 2 | 3 | Rule: A rule 4 | 5 | Example: An example of this rule 6 | Given a single scenario 7 | When it is executed 8 | Then nothing else happens 9 | 10 | 11 | Example: An other example of this rule 12 | Given a single scenario 13 | When it is executed 14 | Then nothing else happens 15 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/cucumbercontextconfigannotation/AbstractWithComponentAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.cucumbercontextconfigannotation; 2 | 3 | import io.cucumber.spring.CucumberContextConfiguration; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | @CucumberContextConfiguration 7 | @ContextConfiguration("classpath:cucumber.xml") 8 | public abstract class AbstractWithComponentAnnotation { 9 | } 10 | -------------------------------------------------------------------------------- /examples/calculator-java-junit5/src/main/java/io/cucumber/examples/calculator/DateCalculator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import java.util.Date; 4 | 5 | public class DateCalculator { 6 | 7 | private final Date now; 8 | 9 | public DateCalculator(Date now) { 10 | this.now = now; 11 | } 12 | 13 | public String isDateInThePast(Date date) { 14 | return (date.before(now)) ? "yes" : "no"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/main/java/io/cucumber/examples/calculator/DateCalculator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import java.util.Date; 4 | 5 | public class DateCalculator { 6 | 7 | private final Date now; 8 | 9 | public DateCalculator(Date now) { 10 | this.now = now; 11 | } 12 | 13 | public String isDateInThePast(Date date) { 14 | return (date.before(now)) ? "yes" : "no"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/calculator-kotlin-junit5/src/test/resources/io/cucumber/examples/calculator/date_calculator.feature: -------------------------------------------------------------------------------- 1 | Feature: Dates with different date formats 2 | This feature shows you can have different date formats, as long as you annotate the 3 | corresponding step definition method accordingly. 4 | 5 | @date 6 | Scenario: Determine past date 7 | Given today is 2011-01-20 8 | When I ask if Jan 19, 2011 is in the past 9 | Then the result should be "yes" 10 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/README.md: -------------------------------------------------------------------------------- 1 | ## A Wicket example 2 | 3 | This is an example of a JEE application that requires deployment to a servlet container before it can be tested with 4 | Selenium WebDriver and Cucumber-JVM using Java. 5 | 6 | ### Maven 7 | 8 | Run: 9 | 10 | ``` 11 | mvn install 12 | ``` 13 | 14 | This runs Cucumber features using the JUnit runner. The `@RunWith(Cucumber.class)` annotation on the `RunCukesIT` junit class 15 | kicks off Cucumber. 16 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/unknownparametertype/UnknownParameterType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.unknownparametertype; 2 | 3 | import io.cucumber.java.en.Given; 4 | 5 | public class UnknownParameterType { 6 | 7 | @Given("{airport} is closed because of a strike") 8 | public void test(String airport) throws Exception { 9 | throw new Exception("Should not be called because airport type not defined"); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-archetype/README.md: -------------------------------------------------------------------------------- 1 | # Cucumber Archetype 2 | 3 | This is a Maven Archetype for setting up an empty Cucumber project. Used by the [10-Minute Cucumber Tutorial](https://docs.cucumber.io/guides/10-minute-tutorial/). 4 | 5 | ```shell 6 | mvn archetype:generate \ 7 | -DarchetypeGroupId=io.cucumber \ 8 | -DarchetypeArtifactId=cucumber-archetype \ 9 | -DarchetypeVersion=${cucumber.version} 10 | ``` 11 | -------------------------------------------------------------------------------- /.github/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "github>cucumber/renovate-config" 5 | ], 6 | "packageRules": [ 7 | { 8 | "groupName": "Messages and dependants", 9 | "matchPackageNames": [ 10 | "/io.cucumber:(messages|gherkin|query|html-formatter|junit-xml-formatter|testng-xml-formatter|pretty-formatter|cucumber-json-formatter|compatibility-kit)/" 11 | ] 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/SummaryPrinter.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Interface for plugins that print a summary after test execution. Deprecated 7 | * use the {@link EventListener} or {@link ConcurrentEventListener} interface 8 | * instead. 9 | * 10 | * @see Plugin 11 | */ 12 | @API(status = API.Status.STABLE) 13 | @Deprecated 14 | public interface SummaryPrinter extends Plugin { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/calculator-java-cli/src/main/java/io/cucumber/examples/calculator/DateCalculator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import java.time.LocalDate; 4 | 5 | public class DateCalculator { 6 | 7 | private final LocalDate now; 8 | 9 | public DateCalculator(LocalDate now) { 10 | this.now = now; 11 | } 12 | 13 | public String isDateInThePast(LocalDate date) { 14 | return (date.isBefore(now)) ? "yes" : "no"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-test/src/test/resources/io/cucumber/examples/wicket/main/Rent.feature: -------------------------------------------------------------------------------- 1 | Feature: Rental cars should be possible to rent to gain revenue to the rental company. 2 | 3 | As an owner of a car rental company 4 | I want to make cars available for renting 5 | So I can make money 6 | 7 | Scenario: Find and rent a car 8 | Given there are 18 cars available for rental 9 | When I rent one 10 | Then there will only be 17 cars available for rental -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/DefaultDataTableEntryTransformerDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import io.cucumber.datatable.TableEntryByTypeTransformer; 4 | import org.apiguardian.api.API; 5 | 6 | @API(status = API.Status.STABLE) 7 | public interface DefaultDataTableEntryTransformerDefinition extends Located { 8 | 9 | boolean headersToProperties(); 10 | 11 | TableEntryByTypeTransformer tableEntryByTypeTransformer(); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/FeatureWrapper.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * The only purpose of this interface is to be able to provide a custom string 7 | * representation, making TestNG reports look more descriptive. 8 | * 9 | * @see AbstractTestNGCucumberTests#runScenario(PickleWrapper, FeatureWrapper) 10 | */ 11 | @API(status = API.Status.STABLE) 12 | public interface FeatureWrapper { 13 | 14 | } 15 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/src/main/java/io/cucumber/examples/calculator/DateCalculator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import java.time.LocalDate; 4 | 5 | public class DateCalculator { 6 | 7 | private final LocalDate now; 8 | 9 | public DateCalculator(LocalDate now) { 10 | this.now = now; 11 | } 12 | 13 | public String isDateInThePast(LocalDate date) { 14 | return (date.isBefore(now)) ? "yes" : "no"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/java/io/cucumber/examples/spring/application/MessageRepository.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import org.springframework.data.repository.CrudRepository; 4 | import org.springframework.stereotype.Repository; 5 | 6 | import java.util.List; 7 | 8 | @Repository 9 | public interface MessageRepository extends CrudRepository { 10 | 11 | List findByContentContaining(String content); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/ScenarioScope.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import com.google.inject.Scope; 4 | import org.apiguardian.api.API; 5 | 6 | /** 7 | * A custom Guice scope that enables classes to be bound in a scope that will 8 | * last for the lifetime of one Cucumber scenario. 9 | */ 10 | @API(status = API.Status.STABLE) 11 | public interface ScenarioScope extends Scope { 12 | 13 | void enterScope(); 14 | 15 | void exitScope(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/scenario.feature: -------------------------------------------------------------------------------- 1 | Feature: Scenario information is available during step execution 2 | 3 | Scenario: My first scenario 4 | Given I am running a scenario 5 | When I try to get the scenario name 6 | Then The scenario name is "My first scenario" 7 | 8 | Scenario: My second scenario 9 | Given I am running a scenario 10 | When I try to get the scenario name 11 | Then The scenario name is "My second scenario" 12 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/exception/CompositeCucumberException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.exception; 2 | 3 | import java.util.List; 4 | 5 | public final class CompositeCucumberException extends CucumberException { 6 | 7 | public CompositeCucumberException(List causes) { 8 | super(String.format("There were %d exceptions. The details are in the stacktrace below.", causes.size())); 9 | causes.forEach(this::addSuppressed); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/exception/CucumberException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.exception; 2 | 3 | public class CucumberException extends RuntimeException { 4 | 5 | public CucumberException(String message) { 6 | super(message); 7 | } 8 | 9 | public CucumberException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | public CucumberException(Throwable cause) { 14 | super(cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-picocontainer/src/test/resources/io/cucumber/picocontainer/issue-225.feature: -------------------------------------------------------------------------------- 1 | Feature: Issue 225 2 | 3 | Scenario Outline: Outline 1 4 | When foo 5 | Then bar concerning 6 | 7 | Examples: 8 | | fluffy thing | 9 | | a fluffy spiked club | 10 | 11 | Scenario Outline: Outline 2 12 | When foo 13 | Then bang bang concerning 14 | 15 | Examples: 16 | | spiky thing | 17 | | a fluffy spiked club | 18 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/StepType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | public enum StepType { 4 | GIVEN, WHEN, THEN, AND, BUT, OTHER; 5 | 6 | private static final String ASTRIX_KEY_WORD = "* "; 7 | 8 | public static boolean isAstrix(String stepType) { 9 | return ASTRIX_KEY_WORD.equals(stepType); 10 | } 11 | 12 | public boolean isGivenWhenThen() { 13 | return this == GIVEN || this == WHEN || this == THEN; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/Java8DataTableTypeDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import io.cucumber.core.backend.DataTableTypeDefinition; 4 | 5 | abstract class Java8DataTableTypeDefinition extends AbstractDatatableElementTransformerDefinition 6 | implements DataTableTypeDefinition { 7 | 8 | Java8DataTableTypeDefinition(Object body, StackTraceElement location, String[] emptyPatterns) { 9 | super(body, location, emptyPatterns); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/StepDefinitionAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Target(ElementType.ANNOTATION_TYPE) 12 | @API(status = API.Status.INTERNAL) 13 | public @interface StepDefinitionAnnotation { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/commonglue/ThirdStepDef.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.commonglue; 2 | 3 | import io.cucumber.java.en.Then; 4 | 5 | import static org.junit.jupiter.api.Assertions.assertEquals; 6 | 7 | public class ThirdStepDef { 8 | 9 | int cucumbers; 10 | 11 | @Then("{int} have been pushed to a third step def class") 12 | public void have_been_pushed_to_a_third_step_def_class(int arg1) { 13 | assertEquals(arg1, cucumbers); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /docstring/src/main/java/io/cucumber/docstring/CucumberDocStringException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.docstring; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public final class CucumberDocStringException extends RuntimeException { 7 | 8 | CucumberDocStringException(String message) { 9 | super(message); 10 | } 11 | 12 | CucumberDocStringException(String message, Throwable throwable) { 13 | super(message, throwable); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/StepDefinitionAnnotations.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Target(ElementType.ANNOTATION_TYPE) 12 | @API(status = API.Status.INTERNAL) 13 | public @interface StepDefinitionAnnotations { 14 | 15 | } 16 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/FeatureWrapperImpl.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import io.cucumber.core.gherkin.Feature; 4 | 5 | final class FeatureWrapperImpl implements FeatureWrapper { 6 | 7 | private final Feature feature; 8 | 9 | FeatureWrapperImpl(Feature feature) { 10 | this.feature = feature; 11 | } 12 | 13 | @Override 14 | public String toString() { 15 | return "\"" + feature.getName().orElse("Unknown") + "\""; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/eventbus/UuidGenerator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.eventbus; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.UUID; 6 | import java.util.function.Supplier; 7 | 8 | /** 9 | * SPI (Service Provider Interface) to generate UUIDs. 10 | */ 11 | @API(status = API.Status.EXPERIMENTAL) 12 | public interface UuidGenerator extends Supplier { 13 | UUID generateId(); 14 | 15 | default UUID get() { 16 | return generateId(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/PickleWrapper.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * The only purpose of this interface is to be able to provide a custom string 7 | * representation, making TestNG reports look more descriptive. 8 | * 9 | * @see AbstractTestNGCucumberTests#runScenario(PickleWrapper, FeatureWrapper) 10 | */ 11 | @API(status = API.Status.STABLE) 12 | public interface PickleWrapper { 13 | 14 | Pickle getPickle(); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/Lookup.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public interface Lookup { 7 | 8 | /** 9 | * Provides an instance of a glue class. 10 | * 11 | * @param glueClass type of instance to be created. 12 | * @param type of Glue class 13 | * @return new instance of type T 14 | */ 15 | T getInstance(Class glueClass); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE working files 2 | *.iws 3 | *.ipr 4 | *.iml 5 | .idea/ 6 | .vscode/ 7 | .settings 8 | .project 9 | .classpath 10 | lib/ 11 | 12 | 13 | # Build directories 14 | distrib/ 15 | target/ 16 | tmp/ 17 | gen-external-apklibs/ 18 | out/ 19 | 20 | # Build & test droppings 21 | pom.xml.releaseBackup 22 | pom.xml.versionsBackup 23 | release.propertiesF 24 | *.ser 25 | dependency-reduced-pom.xml 26 | *~ 27 | libpeerconnection.log 28 | 29 | # OS generated files 30 | .DS_Store* 31 | ehthumbs.db 32 | Icon? 33 | Thumbs.db 34 | -------------------------------------------------------------------------------- /cucumber-gherkin/src/main/java/io/cucumber/core/gherkin/FeatureParserException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.gherkin; 2 | 3 | public final class FeatureParserException extends RuntimeException { 4 | 5 | public FeatureParserException(String message) { 6 | super(message); 7 | } 8 | 9 | public FeatureParserException(String message, Throwable cause) { 10 | super(message, cause); 11 | } 12 | 13 | public FeatureParserException(Throwable cause) { 14 | super(cause); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/PickleWrapperImpl.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | final class PickleWrapperImpl implements PickleWrapper { 4 | 5 | private final Pickle pickle; 6 | 7 | PickleWrapperImpl(Pickle pickle) { 8 | this.pickle = pickle; 9 | } 10 | 11 | public Pickle getPickle() { 12 | return pickle; 13 | } 14 | 15 | @Override 16 | public String toString() { 17 | return "\"" + pickle.getPickle().getName() + "\""; 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /.github/workflows/release-github.yml: -------------------------------------------------------------------------------- 1 | name: Release GitHub 2 | 3 | permissions: { } 4 | 5 | on: 6 | push: 7 | branches: [release/*] 8 | 9 | jobs: 10 | create-github-release: 11 | name: Create GitHub Release and Git tag 12 | runs-on: ubuntu-latest 13 | environment: Release 14 | permissions: 15 | contents: write 16 | steps: 17 | - uses: actions/checkout@v6 18 | - uses: cucumber/action-create-github-release@v1.1.1 19 | with: 20 | github-token: ${{ secrets.GITHUB_TOKEN }} 21 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/Java8Snippet.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import java.text.MessageFormat; 4 | 5 | final class Java8Snippet extends AbstractJavaSnippet { 6 | 7 | @Override 8 | public MessageFormat template() { 9 | return new MessageFormat("" + 10 | "{0}(\"{1}\", ({3}) -> '{'\n" + 11 | " // {4}\n" + 12 | "{5} throw new " + PendingException.class.getName() + "();\n" + 13 | "'}');"); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/test/java/io/cucumber/examples/spring/application/CucumberTestContextConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import io.cucumber.spring.CucumberContextConfiguration; 4 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | 7 | @CucumberContextConfiguration 8 | @SpringBootTest 9 | @AutoConfigureMockMvc 10 | public class CucumberTestContextConfiguration { 11 | 12 | } 13 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/filter/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.filter; 2 | 3 | import io.cucumber.tagexpressions.Expression; 4 | 5 | import java.net.URI; 6 | import java.util.List; 7 | import java.util.Map; 8 | import java.util.Set; 9 | import java.util.regex.Pattern; 10 | 11 | public interface Options { 12 | 13 | List getTagExpressions(); 14 | 15 | List getNameFilters(); 16 | 17 | Map> getLineFilters(); 18 | 19 | int getLimitCount(); 20 | 21 | } 22 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | %date [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /cucumber-junit/src/main/java/io/cucumber/junit/NoUuidGenerator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import io.cucumber.core.eventbus.UuidGenerator; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * This UUID generator does nothing. It is solely needed for marking purposes. 9 | */ 10 | final class NoUuidGenerator implements UuidGenerator { 11 | 12 | private NoUuidGenerator() { 13 | // No need for instantiation 14 | } 15 | 16 | @Override 17 | public UUID generateId() { 18 | return null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/InvalidDataTableTypeException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import java.lang.reflect.Type; 4 | 5 | class InvalidDataTableTypeException extends CucumberDataTableException { 6 | 7 | InvalidDataTableTypeException(Type type, Exception e) { 8 | super(createMessage(type, e), e); 9 | } 10 | 11 | private static String createMessage(Type type, Exception e) { 12 | return "Can't create a data table type for type " + type + ". " + e.getMessage(); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/TableDiffException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.INTERNAL) 6 | public final class TableDiffException extends RuntimeException { 7 | private TableDiffException(String message) { 8 | super(message); 9 | } 10 | 11 | public static TableDiffException diff(DataTableDiff dataTableDiff) { 12 | return new TableDiffException("tables were different:\n" + dataTableDiff.toString()); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/resources/io/cucumber/examples/wicket/main/view/Available.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | Available cars 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 |
Car classAvailable cars
Compact 12 | Available cars 13 |
16 | -------------------------------------------------------------------------------- /cucumber-cdi2/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/NoUuidGenerator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import io.cucumber.core.eventbus.UuidGenerator; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * This UUID generator does nothing. It is solely needed for marking purposes. 9 | */ 10 | final class NoUuidGenerator implements UuidGenerator { 11 | 12 | private NoUuidGenerator() { 13 | // No need for instantiation 14 | } 15 | 16 | @Override 17 | public UUID generateId() { 18 | return null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/main/java9/module-info.java: -------------------------------------------------------------------------------- 1 | module io.cucumber.junit.platform.engine { 2 | requires io.cucumber.core; 3 | requires io.cucumber.core.gherkin; 4 | 5 | requires org.junit.platform.commons; 6 | 7 | requires transitive org.opentest4j; 8 | requires transitive org.apiguardian.api; 9 | requires transitive org.junit.platform.engine; 10 | 11 | exports io.cucumber.junit.platform.engine; 12 | provides org.junit.platform.engine.TestEngine with io.cucumber.junit.platform.engine.CucumberTestEngine; 13 | } -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | %date [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/options/NoUuidGenerator.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | import io.cucumber.core.eventbus.UuidGenerator; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * This UUID generator does nothing. It is solely needed for marking purposes. 9 | */ 10 | final class NoUuidGenerator implements UuidGenerator { 11 | 12 | private NoUuidGenerator() { 13 | // No need for instantiation 14 | } 15 | 16 | @Override 17 | public UUID generateId() { 18 | return null; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-test/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 6 | %date [%thread] %-5level %logger{36} - %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/backgrounds/Backgrounds.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.backgrounds; 2 | 3 | import io.cucumber.java.en.Given; 4 | import io.cucumber.java.en.Then; 5 | import io.cucumber.java.en.When; 6 | 7 | public class Backgrounds { 8 | 9 | @Given("an order for {string}") 10 | public void context(String item) { 11 | 12 | } 13 | 14 | @When("an action") 15 | public void action() { 16 | 17 | } 18 | 19 | @Then("an outcome") 20 | public void outcome() { 21 | 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Cucumber-JVM examples 2 | 3 | To start with the simplest example, please use the 4 | [cucumber-java-skeleton](https://github.com/cucumber/cucumber-java-skeleton). 5 | 6 | Other examples can be found in this directory. 7 | 8 | Some example projects depend on the current (unreleased) Cucumber-JVM modules. 9 | If any of the examples fail to build, build cucumber-jvm itself once first: 10 | 11 | ``` 12 | cd .. # the dir above this dir 13 | mvn clean install 14 | ``` 15 | 16 | Any of the examples can be built and run with `mvn clean verify`. 17 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/JavaSnippet.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import java.text.MessageFormat; 4 | 5 | final class JavaSnippet extends AbstractJavaSnippet { 6 | 7 | @Override 8 | public MessageFormat template() { 9 | return new MessageFormat("" + 10 | "@{0}(\"{1}\")\n" + 11 | "public void {2}({3}) '{'\n" + 12 | " // {4}\n" + 13 | "{5} throw new " + PendingException.class.getName() + "();\n" + 14 | "'}'"); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/fa.feature: -------------------------------------------------------------------------------- 1 | Feature: Feature A 2 | 3 | Background: background 4 | Given first step 5 | 6 | Scenario: A good start 7 | Given first step 8 | Given second step 9 | Given third step 10 | 11 | 12 | Scenario Outline: Followed by some examples 13 | When step 14 | Then step 15 | Examples: examples 1 name 16 | | x | y | 17 | | second | third | 18 | | second | third | 19 | Examples: examples 2 name 20 | | x | y | 21 | | second | third | 22 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/TimeStampedEvent.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import java.time.Instant; 4 | import java.util.Objects; 5 | 6 | abstract class TimeStampedEvent implements Event { 7 | 8 | private final Instant instant; 9 | 10 | TimeStampedEvent(Instant timeInstant) { 11 | this.instant = Objects.requireNonNull(timeInstant); 12 | } 13 | 14 | /** 15 | * {@inheritDoc} 16 | */ 17 | @Override 18 | public Instant getInstant() { 19 | return instant; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/java/io/cucumber/examples/spring/application/Application.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.web.servlet.config.annotation.EnableWebMvc; 6 | 7 | @SpringBootApplication 8 | @EnableWebMvc 9 | public class Application { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(Application.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/rulesbackgrounds/RulesBackgrounds.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.rulesbackgrounds; 2 | 3 | import io.cucumber.java.en.Given; 4 | import io.cucumber.java.en.Then; 5 | import io.cucumber.java.en.When; 6 | 7 | public class RulesBackgrounds { 8 | 9 | @Given("an order for {string}") 10 | public void context(String item) { 11 | 12 | } 13 | 14 | @When("an action") 15 | public void action() { 16 | 17 | } 18 | 19 | @Then("an outcome") 20 | public void outcome() { 21 | 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/metaconfig/general/MetaConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.metaconfig.general; 2 | 3 | import org.springframework.test.context.ContextConfiguration; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | @Target(ElementType.TYPE) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | 13 | @ContextConfiguration("classpath:cucumber.xml") 14 | public @interface MetaConfiguration { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/java/io/cucumber/examples/calculator/RunCucumberByCompositionBase.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import org.testng.annotations.BeforeClass; 4 | import org.testng.annotations.BeforeMethod; 5 | 6 | /** 7 | * An example base class 8 | */ 9 | class RunCucumberByCompositionBase { 10 | 11 | @BeforeClass 12 | public void beforeClass() { 13 | // do expensive setup 14 | } 15 | 16 | @BeforeMethod 17 | public void beforeMethod() { 18 | // do expensive setup 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/YourModule.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | import com.google.inject.AbstractModule; 4 | import com.google.inject.Scopes; 5 | import io.cucumber.guice.ScenarioScoped; 6 | 7 | public class YourModule extends AbstractModule { 8 | 9 | @Override 10 | protected void configure() { 11 | // UnScopedObject is implicitly bound without scope 12 | bind(ScenarioScopedObject.class).in(ScenarioScoped.class); 13 | bind(SingletonObject.class).in(Scopes.SINGLETON); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/FailureMatcher.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import org.junit.runner.notification.Failure; 4 | import org.mockito.ArgumentMatcher; 5 | 6 | final class FailureMatcher implements ArgumentMatcher { 7 | 8 | private final String name; 9 | 10 | FailureMatcher(String name) { 11 | this.name = name; 12 | } 13 | 14 | @Override 15 | public boolean matches(Failure argument) { 16 | return argument != null && argument.getDescription().getDisplayName().equals(name); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/DocStringArgument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Represents a Gherkin doc string argument. 7 | */ 8 | @API(status = API.Status.STABLE) 9 | public interface DocStringArgument extends StepArgument { 10 | 11 | String getContent(); 12 | 13 | /** 14 | * @deprecated use {@link #getMediaType()} instead. 15 | */ 16 | @Deprecated 17 | String getContentType(); 18 | 19 | String getMediaType(); 20 | 21 | int getLine(); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-archetype/src/main/resources/archetype-resources/src/test/java/StepDefinitions.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | import io.cucumber.java.en.*; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | public class StepDefinitions { 8 | 9 | @Given("an example scenario") 10 | public void anExampleScenario() { 11 | } 12 | 13 | @When("all step definitions are implemented") 14 | public void allStepDefinitionsAreImplemented() { 15 | } 16 | 17 | @Then("the scenario passes") 18 | public void theScenarioPasses() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-kotlin-java8/src/test/kotlin/io/cucumber/kotlin/RunCucumberTest.kt: -------------------------------------------------------------------------------- 1 | package io.cucumber.kotlin 2 | 3 | import io.cucumber.junit.platform.engine.Constants 4 | import org.junit.platform.suite.api.ConfigurationParameter 5 | import org.junit.platform.suite.api.IncludeEngines 6 | import org.junit.platform.suite.api.SelectPackages 7 | import org.junit.platform.suite.api.Suite 8 | 9 | @Suite 10 | @IncludeEngines("cucumber") 11 | @SelectPackages("io.cucumber.kotlin") 12 | @ConfigurationParameter(key = Constants.GLUE_PROPERTY_NAME, value = "io.cucumber.kotlin") 13 | class RunCucumberTest 14 | -------------------------------------------------------------------------------- /release-notes/v2.0.1.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | nav: blog 4 | date: "2017-09-17 09:00:00" 5 | title: "Announcing Cucumber-JVM v2.0.1" 6 | author: brasmusson 7 | --- 8 | 9 | Cucumber-JVM v2.0.1 has been released. The primary reason for this release is to fix two regressions in v2.0.0: 10 | 11 | - The method `Scenario.isFailed()`, that is available to hooks, does always return `false`. 12 | 13 | - The `--dry-run` option does not work, the steps are still executed. 14 | 15 | For the full change log, see [CHANGELOG.md](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md). 16 | -------------------------------------------------------------------------------- /cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/report.css: -------------------------------------------------------------------------------- 1 | .navbar { 2 | position: fixed; 3 | width: 100%; 4 | top: 0; 5 | z-index: 10000; 6 | background-color: #FFF; 7 | } 8 | 9 | .main { 10 | margin-top: 130px; /* Add a top margin to avoid content overlay */ 11 | } 12 | 13 | *.passed { 14 | background-color: #C5D88A; 15 | } 16 | 17 | *.undefined, 18 | *.pending { 19 | background-color: #EAEC2D; 20 | } 21 | 22 | *.skipped { 23 | background-color: #2DEAEC; 24 | } 25 | 26 | *.failed { 27 | background-color: #D88A8A !important; 28 | } 29 | -------------------------------------------------------------------------------- /release-notes/v2.3.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | nav: blog 4 | date: "2017-12-11 09:00:00" 5 | title: "Announcing Cucumber-JVM v2.3.0" 6 | author: mpkorstanje 7 | --- 8 | 9 | Cucumber-JVM v2.3.0 has been released. This fixes the snapshot dependency in 10 | `cucumber-java8` along with the build process that caused the problem. 11 | 12 | Additionally Łukasz Suski provided a PR that reduced the tests execution of 13 | large test on Android 8.0 and below by approximately 50%! 14 | 15 | For the full change log, see [CHANGELOG.md](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md). 16 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/Container.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | @API(status = API.Status.STABLE) 6 | public interface Container { 7 | 8 | /** 9 | * Add a glue class to the test context. 10 | *

11 | * Invoked after creation but before {@link ObjectFactory#start()}. 12 | * 13 | * @param glueClass glue class to add to the text context. 14 | * @return should always return true, should be ignored. 15 | */ 16 | boolean addClass(Class glueClass); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-guice/src/test/java/io/cucumber/guice/integration/YourInjectorSource.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice.integration; 2 | 3 | import com.google.inject.Guice; 4 | import com.google.inject.Injector; 5 | import com.google.inject.Stage; 6 | import io.cucumber.guice.CucumberModules; 7 | import io.cucumber.guice.InjectorSource; 8 | 9 | public class YourInjectorSource implements InjectorSource { 10 | 11 | @Override 12 | public Injector getInjector() { 13 | return Guice.createInjector(Stage.PRODUCTION, CucumberModules.createScenarioModule(), new YourModule()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/HookTestStep.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Hooks are invoked before and after each scenario and before and after each 7 | * gherkin step in a scenario. 8 | * 9 | * @see TestCaseStarted 10 | * @see TestCaseFinished 11 | */ 12 | @API(status = API.Status.STABLE) 13 | public interface HookTestStep extends TestStep { 14 | 15 | /** 16 | * Returns the hook hook type. 17 | * 18 | * @return the hook type. 19 | */ 20 | HookType getHookType(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runner/Options.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runner; 2 | 3 | import io.cucumber.core.backend.ObjectFactory; 4 | import io.cucumber.core.eventbus.UuidGenerator; 5 | import io.cucumber.core.snippets.SnippetType; 6 | 7 | import java.net.URI; 8 | import java.util.List; 9 | 10 | public interface Options { 11 | 12 | List getGlue(); 13 | 14 | boolean isDryRun(); 15 | 16 | SnippetType getSnippetType(); 17 | 18 | Class getObjectFactoryClass(); 19 | 20 | Class getUuidGeneratorClass(); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/PendingException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import io.cucumber.core.backend.Pending; 4 | import org.apiguardian.api.API; 5 | 6 | /** 7 | * When thrown from a step marks it as not yet implemented. 8 | * 9 | * @see JavaSnippet 10 | */ 11 | @Pending 12 | @API(status = API.Status.STABLE) 13 | public final class PendingException extends RuntimeException { 14 | 15 | public PendingException() { 16 | this("TODO: implement me"); 17 | } 18 | 19 | public PendingException(String message) { 20 | super(message); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/InjectorSource.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import com.google.inject.Injector; 4 | import org.apiguardian.api.API; 5 | 6 | /** 7 | * An implementation of this interface is used to obtain an 8 | * com.google.inject.Injector that is used to provide instances of 9 | * all the classes that are used to run the Cucumber tests. The injector should 10 | * be configured with a binding for ScenarioScope. 11 | */ 12 | @API(status = API.Status.STABLE) 13 | public interface InjectorSource { 14 | 15 | Injector getInjector(); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-archetype/src/test/resources/projects/should-generate-project/reference/src/test/java/com/example/StepDefinitions.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | import io.cucumber.java.en.*; 4 | 5 | import static org.assertj.core.api.Assertions.assertThat; 6 | 7 | public class StepDefinitions { 8 | 9 | @Given("an example scenario") 10 | public void anExampleScenario() { 11 | } 12 | 13 | @When("all step definitions are implemented") 14 | public void allStepDefinitionsAreImplemented() { 15 | } 16 | 17 | @Then("the scenario passes") 18 | public void theScenarioPasses() { 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/commonglue/AnotherStepDef.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.commonglue; 2 | 3 | import io.cucumber.java.en.Then; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertEquals; 7 | 8 | public class AnotherStepDef { 9 | 10 | @Autowired 11 | OneStepDef oneStepDef; 12 | 13 | @Then("I can read {int} cucumbers from the other step def class") 14 | public void i_can_read_cucumbers_from_the_other_step_def_class(int arg1) { 15 | assertEquals(arg1, oneStepDef.cucumbers); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/java/io/cucumber/examples/calculator/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.calculator; 2 | 3 | import io.cucumber.testng.AbstractTestNGCucumberTests; 4 | import io.cucumber.testng.CucumberOptions; 5 | import org.testng.annotations.DataProvider; 6 | 7 | @CucumberOptions(plugin = { "html:target/results.html", "message:target/results.ndjson" }) 8 | public class RunCucumberTest extends AbstractTestNGCucumberTests { 9 | 10 | @DataProvider(parallel = true) 11 | @Override 12 | public Object[][] scenarios() { 13 | return super.scenarios(); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/java/io/cucumber/openejb/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.openejb; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.openejb") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.openejb") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/WriteEvent.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | import java.util.Objects; 7 | 8 | @API(status = API.Status.STABLE) 9 | public final class WriteEvent extends TestCaseEvent { 10 | 11 | private final String text; 12 | 13 | public WriteEvent(Instant timeInstant, TestCase testCase, String text) { 14 | super(timeInstant, testCase); 15 | this.text = Objects.requireNonNull(text); 16 | } 17 | 18 | public String getText() { 19 | return text; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/SanityTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | class SanityTest { 6 | 7 | @Test 8 | void reports_events_correctly_with_cucumber_runner() { 9 | SanityChecker.run(RunCucumberTest.class); 10 | } 11 | 12 | @Test 13 | void reports_events_correctly_with_junit_runner() { 14 | SanityChecker.run(RunCucumberTest.class); 15 | } 16 | 17 | @Test 18 | void reports_events_correctly_with_no_step_notifications() { 19 | SanityChecker.run(RunCucumberTestWithStepNotifications.class); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/TestCaseEvent.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | import java.util.Objects; 7 | 8 | @API(status = API.Status.STABLE) 9 | public abstract class TestCaseEvent extends TimeStampedEvent { 10 | 11 | private final TestCase testCase; 12 | 13 | TestCaseEvent(Instant timeInstant, TestCase testCase) { 14 | super(timeInstant); 15 | this.testCase = Objects.requireNonNull(testCase); 16 | } 17 | 18 | public TestCase getTestCase() { 19 | return testCase; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/hooks/Hooks.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.hooks; 2 | 3 | import io.cucumber.java.After; 4 | import io.cucumber.java.Before; 5 | import io.cucumber.java.en.When; 6 | 7 | public class Hooks { 8 | 9 | @Before 10 | public void before() { 11 | } 12 | 13 | @When("a step passes") 14 | public void aStepPasses() { 15 | } 16 | 17 | @When("a step fails") 18 | public void aStepFails() throws Exception { 19 | throw new Exception("Exception in step"); 20 | } 21 | 22 | @After 23 | public void after() throws Exception { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /cucumber-deltaspike/src/test/java/io/cucumber/deltaspike/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.deltaspike; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.deltaspike") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.deltaspike") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-junit/src/main/java/io/cucumber/junit/SkippedThrowable.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import static java.util.Locale.ROOT; 4 | 5 | final class SkippedThrowable extends Throwable { 6 | 7 | private static final long serialVersionUID = 1L; 8 | 9 | SkippedThrowable(NotificationLevel scenarioOrStep) { 10 | super(String.format("This %s is skipped", scenarioOrStep.lowerCaseName()), null, false, false); 11 | } 12 | 13 | enum NotificationLevel { 14 | SCENARIO, 15 | STEP; 16 | 17 | String lowerCaseName() { 18 | return name().toLowerCase(ROOT); 19 | } 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /docstring/src/main/java/io/cucumber/docstring/ConversionRequired.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.docstring; 2 | 3 | import io.cucumber.docstring.DocString.DocStringConverter; 4 | 5 | import java.lang.reflect.Type; 6 | 7 | import static java.lang.String.format; 8 | 9 | final class ConversionRequired implements DocStringConverter { 10 | 11 | @Override 12 | public T convert(DocString docString, Type type) { 13 | throw new CucumberDocStringException(format("" + 14 | "Can't convert DocString to %s. " + 15 | "You have to write the conversion for it in this method", 16 | type)); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/HookDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.Optional; 6 | 7 | @API(status = API.Status.STABLE) 8 | public interface HookDefinition extends Located { 9 | 10 | void execute(TestCaseState state); 11 | 12 | String getTagExpression(); 13 | 14 | int getOrder(); 15 | 16 | default Optional getHookType() { 17 | return Optional.empty(); 18 | } 19 | 20 | enum HookType { 21 | 22 | BEFORE, 23 | 24 | AFTER, 25 | 26 | BEFORE_STEP, 27 | 28 | AFTER_STEP; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/annotation/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.annotation; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.java.annotation") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.java.annotation") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/ColorAware.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Interface for Plugins that use ANSI escape codes to print coloured output. 7 | */ 8 | @API(status = API.Status.STABLE) 9 | public interface ColorAware extends Plugin { 10 | 11 | /** 12 | * When set to monochrome the plugin should not use colored output. 13 | *

14 | * For the benefit of systems that do not support ANSI escape codes. 15 | * 16 | * @param monochrome true if monochrome output should be used 17 | */ 18 | void setMonochrome(boolean monochrome); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/componentannotation/WithComponentAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.componentannotation; 2 | 3 | import io.cucumber.spring.beans.DummyComponent; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Component; 6 | 7 | @Component 8 | public class WithComponentAnnotation { 9 | 10 | private boolean autowired; 11 | 12 | @Autowired 13 | public void setAutowiredCollaborator(DummyComponent collaborator) { 14 | autowired = true; 15 | } 16 | 17 | public boolean isAutowired() { 18 | return autowired; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/resources/io/cucumber/examples/wicket/main/view/Create.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 | 5 | 6 | 7 | 10 | 11 | 12 | 16 | 17 |
Number of cars: 8 | 9 |
13 | 14 | 15 |
18 |
19 | 20 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/GuiceBackendProviderService.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import io.cucumber.core.backend.Backend; 4 | import io.cucumber.core.backend.BackendProviderService; 5 | import io.cucumber.core.backend.Container; 6 | import io.cucumber.core.backend.Lookup; 7 | 8 | import java.util.function.Supplier; 9 | 10 | public final class GuiceBackendProviderService implements BackendProviderService { 11 | 12 | @Override 13 | public Backend create(Lookup lookup, Container container, Supplier classLoaderSupplier) { 14 | return new GuiceBackend(container, classLoaderSupplier); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/JavaBackendProviderService.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import io.cucumber.core.backend.Backend; 4 | import io.cucumber.core.backend.BackendProviderService; 5 | import io.cucumber.core.backend.Container; 6 | import io.cucumber.core.backend.Lookup; 7 | 8 | import java.util.function.Supplier; 9 | 10 | public final class JavaBackendProviderService implements BackendProviderService { 11 | 12 | @Override 13 | public Backend create(Lookup lookup, Container container, Supplier classLoaderSupplier) { 14 | return new JavaBackend(lookup, container, classLoaderSupplier); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/PendingException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import io.cucumber.core.backend.Pending; 4 | import org.apiguardian.api.API; 5 | 6 | /** 7 | * When thrown from a step marks it as not yet implemented. 8 | * 9 | * @see Java8Snippet 10 | */ 11 | @SuppressWarnings({ "WeakerAccess", "unused" }) 12 | @Pending 13 | @API(status = API.Status.STABLE) 14 | public final class PendingException extends RuntimeException { 15 | 16 | public PendingException() { 17 | this("TODO: implement me"); 18 | } 19 | 20 | public PendingException(String message) { 21 | super(message); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/java/io/cucumber/junit/DescriptionMatcher.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import org.junit.runner.Description; 4 | import org.mockito.ArgumentMatcher; 5 | 6 | final class DescriptionMatcher implements ArgumentMatcher { 7 | 8 | private final String name; 9 | 10 | DescriptionMatcher(String name) { 11 | this.name = name; 12 | } 13 | 14 | @Override 15 | public boolean matches(Description argument) { 16 | return argument != null && argument.getDisplayName().equals(name); 17 | } 18 | 19 | @Override 20 | public String toString() { 21 | return name; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/componentannotation/WithControllerAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.componentannotation; 2 | 3 | import io.cucumber.spring.beans.DummyComponent; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Controller; 6 | 7 | @Controller 8 | public class WithControllerAnnotation { 9 | 10 | private boolean autowired; 11 | 12 | @Autowired 13 | public void setAutowiredCollaborator(DummyComponent collaborator) { 14 | autowired = true; 15 | } 16 | 17 | public boolean isAutowired() { 18 | return autowired; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/logging/LogRecordListener.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.logging; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | import java.util.concurrent.ConcurrentLinkedDeque; 6 | import java.util.logging.LogRecord; 7 | 8 | public final class LogRecordListener { 9 | 10 | private final ConcurrentLinkedDeque logRecords = new ConcurrentLinkedDeque<>(); 11 | 12 | void logRecordSubmitted(LogRecord logRecord) { 13 | logRecords.add(logRecord); 14 | } 15 | 16 | public List getLogRecords() { 17 | return Arrays.asList(logRecords.toArray(new LogRecord[0])); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/java/io/cucumber/jakarta/openejb/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.jakarta.openejb; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.jakarta.openejb") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.jakarta.openejb") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/Java8BackendProviderService.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import io.cucumber.core.backend.Backend; 4 | import io.cucumber.core.backend.BackendProviderService; 5 | import io.cucumber.core.backend.Container; 6 | import io.cucumber.core.backend.Lookup; 7 | 8 | import java.util.function.Supplier; 9 | 10 | public final class Java8BackendProviderService implements BackendProviderService { 11 | 12 | @Override 13 | public Backend create(Lookup lookup, Container container, Supplier classLoaderProvider) { 14 | return new Java8Backend(lookup, container, classLoaderProvider); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-spring/src/main/java/io/cucumber/spring/SpringBackendProviderService.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring; 2 | 3 | import io.cucumber.core.backend.Backend; 4 | import io.cucumber.core.backend.BackendProviderService; 5 | import io.cucumber.core.backend.Container; 6 | import io.cucumber.core.backend.Lookup; 7 | 8 | import java.util.function.Supplier; 9 | 10 | public final class SpringBackendProviderService implements BackendProviderService { 11 | 12 | @Override 13 | public Backend create(Lookup lookup, Container container, Supplier classLoaderSupplier) { 14 | return new SpringBackend(container, classLoaderSupplier); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/metaconfig/dirties/DirtiesMetaConfiguration.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.metaconfig.dirties; 2 | 3 | import org.springframework.test.annotation.DirtiesContext; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @Target(ElementType.TYPE) 12 | @Retention(RetentionPolicy.RUNTIME) 13 | 14 | @ContextConfiguration("classpath:cucumber.xml") 15 | @DirtiesContext 16 | public @interface DirtiesMetaConfiguration { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/StrictAware.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Interface for Plugins that need to know if the Runtime is strict. 7 | * 8 | * @deprecated strict mode is enabled by default and will be removed. 9 | */ 10 | @Deprecated 11 | @API(status = API.Status.STABLE) 12 | public interface StrictAware extends Plugin { 13 | 14 | /** 15 | * When set to strict the plugin should indicate failure for undefined and 16 | * pending steps 17 | * 18 | * @param strict true if the runtime is in strict mode 19 | */ 20 | void setStrict(boolean strict); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/TestCaseStarted.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | import java.util.Objects; 7 | 8 | @API(status = API.Status.STABLE) 9 | public final class TestCaseStarted extends TestCaseEvent { 10 | 11 | private final TestCase testCase; 12 | 13 | public TestCaseStarted(Instant timeInstant, TestCase testCase) { 14 | super(timeInstant, testCase); 15 | this.testCase = Objects.requireNonNull(testCase); 16 | } 17 | 18 | @Override 19 | public TestCase getTestCase() { 20 | return testCase; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/test/java/io/cucumber/examples/spring/application/UserStepDefinitions.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import io.cucumber.java.en.Given; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | 6 | public class UserStepDefinitions { 7 | 8 | @Autowired 9 | private UserRepository userRepository; 10 | 11 | private User currentUser; 12 | 13 | @Given("there is a user") 14 | public void there_is_a_user() { 15 | currentUser = userRepository.save(new User("John Doe")); 16 | } 17 | 18 | public User getCurrentUser() { 19 | return currentUser; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/java/io/cucumber/jakarta/cdi/example/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.jakarta.cdi.example; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.jakarta.cdi.example") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.jakarta.cdi.example") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/TableTransformer.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Transforms a table row to an instance of {@code T}. 7 | * 8 | * @param the target type 9 | */ 10 | @API(status = API.Status.STABLE) 11 | @FunctionalInterface 12 | public interface TableTransformer { 13 | /** 14 | * Transforms a table row to an instance of {@code T}. 15 | * 16 | * @param table the table 17 | * @return an instance of {@code T} 18 | * @throws Throwable when the transform fails for any reason 19 | */ 20 | T transform(DataTable table) throws Throwable; 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/runtime/StubFeatureSupplier.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import io.cucumber.core.gherkin.Feature; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | 8 | public class StubFeatureSupplier implements FeatureSupplier { 9 | 10 | private final List features; 11 | 12 | public StubFeatureSupplier(Feature... features) { 13 | this(Arrays.asList(features)); 14 | } 15 | 16 | public StubFeatureSupplier(List features) { 17 | this.features = features; 18 | } 19 | 20 | @Override 21 | public List get() { 22 | return features; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cucumber-openejb/src/test/java/io/cucumber/openejb/BellyStepDefinitions.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.openejb; 2 | 3 | import io.cucumber.java.en.Given; 4 | import io.cucumber.java.en.Then; 5 | 6 | import javax.inject.Inject; 7 | 8 | import static org.junit.jupiter.api.Assertions.assertEquals; 9 | 10 | public class BellyStepDefinitions { 11 | 12 | @Inject 13 | private Belly belly; 14 | 15 | @Given("I have {int} cukes in my belly") 16 | public void haveCukes(int n) { 17 | belly.setCukes(n); 18 | } 19 | 20 | @Then("there are {int} cukes in my belly") 21 | public void checkCukes(int n) { 22 | assertEquals(n, belly.getCukes()); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/pending/Pending.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.pending; 2 | 3 | import io.cucumber.java.PendingException; 4 | import io.cucumber.java.en.And; 5 | import io.cucumber.java.en.Given; 6 | 7 | public class Pending { 8 | 9 | @Given("an unimplemented pending step") 10 | public void anUnimplementedPendingStep() { 11 | throw new PendingException("Not yet implemented"); 12 | } 13 | 14 | @Given("an implemented non-pending step") 15 | public void anImplementedNonPendingStep() { 16 | } 17 | 18 | @And("an implemented step that is skipped") 19 | public void anImplementedStepThatIsSkipped() { 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/defaultstransformer/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.defaultstransformer; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.java.defaultstransformer") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.java.defaultstransformer") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/filter/NamePredicate.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.filter; 2 | 3 | import io.cucumber.core.gherkin.Pickle; 4 | 5 | import java.util.List; 6 | import java.util.function.Predicate; 7 | import java.util.regex.Pattern; 8 | 9 | final class NamePredicate implements Predicate { 10 | 11 | private final List patterns; 12 | 13 | NamePredicate(List patterns) { 14 | this.patterns = patterns; 15 | } 16 | 17 | @Override 18 | public boolean test(Pickle pickle) { 19 | String name = pickle.getName(); 20 | return patterns.stream().anyMatch(pattern -> pattern.matcher(name).find()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/ScenarioModule.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import com.google.inject.AbstractModule; 4 | 5 | public class ScenarioModule extends AbstractModule { 6 | 7 | private final ScenarioScope scenarioScope; 8 | 9 | public ScenarioModule(ScenarioScope scenarioScope) { 10 | this.scenarioScope = scenarioScope; 11 | } 12 | 13 | /** 14 | * Configures a {@link com.google.inject.Binder} via the exposed methods. 15 | */ 16 | @Override 17 | protected void configure() { 18 | bindScope(ScenarioScoped.class, scenarioScope); 19 | bind(ScenarioScope.class).toInstance(scenarioScope); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-java/src/test/java/io/cucumber/java/annotation/FrenchSteps.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java.annotation; 2 | 3 | import io.cucumber.java.fr.Étantdonné; 4 | 5 | import java.math.BigDecimal; 6 | 7 | import static org.hamcrest.CoreMatchers.is; 8 | import static org.hamcrest.MatcherAssert.assertThat; 9 | 10 | public class FrenchSteps { 11 | 12 | @Étantdonné("j'ai {bigdecimal} concombres fractionnaires") 13 | public void jAiConcombresFractionnaires(BigDecimal arg0) { 14 | assertThat(arg0, is(new BigDecimal("5.5"))); 15 | } 16 | 17 | @Étantdonné("j'ai {int} concombres") 18 | public void jAiConcombres(int arg0) { 19 | assertThat(arg0, is(5)); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/annotationconfig/AnnotationContextConfigurationDefinitions.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.annotationconfig; 2 | 3 | import io.cucumber.java.en.Then; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.context.ApplicationContext; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertNotNull; 8 | 9 | public class AnnotationContextConfigurationDefinitions { 10 | 11 | @Autowired 12 | private ApplicationContext context; 13 | 14 | @Then("cucumber picks up configuration class without step defs") 15 | public void pickUpContext() { 16 | assertNotNull(context); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/StepDefinedEvent.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.time.Instant; 6 | import java.util.Objects; 7 | 8 | @API(status = API.Status.STABLE) 9 | public final class StepDefinedEvent extends TimeStampedEvent { 10 | 11 | private final StepDefinition stepDefinition; 12 | 13 | public StepDefinedEvent(Instant timeInstant, StepDefinition stepDefinition) { 14 | super(timeInstant); 15 | this.stepDefinition = Objects.requireNonNull(stepDefinition); 16 | } 17 | 18 | public StepDefinition getStepDefinition() { 19 | return stepDefinition; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/beans/Belly.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.beans; 2 | 3 | import org.springframework.stereotype.Component; 4 | 5 | import java.util.concurrent.atomic.AtomicLong; 6 | 7 | @Component 8 | public class Belly { 9 | 10 | private static final AtomicLong counter = new AtomicLong(0); 11 | 12 | private final long instanceId = counter.incrementAndGet(); 13 | 14 | private int cukes = 0; 15 | 16 | public int getCukes() { 17 | return cukes; 18 | } 19 | 20 | public void setCukes(int cukes) { 21 | this.cukes = cukes; 22 | } 23 | 24 | public long getInstanceId() { 25 | return instanceId; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/CucumberPropertiesProvider.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Provides cucumber with properties from {@code testng.xml}. 7 | * 8 | * @see io.cucumber.core.options.Constants 9 | */ 10 | @API(status = API.Status.EXPERIMENTAL, since = "6.11") 11 | @FunctionalInterface 12 | public interface CucumberPropertiesProvider { 13 | 14 | /** 15 | * Returns a configuration property for the given key, or null if there is 16 | * no such property. 17 | * 18 | * @param key the property name 19 | * @return the property value or null 20 | */ 21 | String get(String key); 22 | } 23 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | io.cucumber 5 | examples 6 | 7.33.1-SNAPSHOT 7 | 8 | wicket-java-junit4 9 | pom 10 | Examples: Wicket 11 | 12 | wicket-main 13 | wicket-test 14 | 15 | 16 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/snippets/SnakeCaseJoiner.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.snippets; 2 | 3 | import java.util.List; 4 | 5 | class SnakeCaseJoiner implements Joiner { 6 | 7 | @Override 8 | public String concatenate(List words) { 9 | StringBuilder functionName = new StringBuilder(); 10 | boolean firstWord = true; 11 | for (String word : words) { 12 | if (firstWord) { 13 | firstWord = false; 14 | } else { 15 | functionName.append('_'); 16 | } 17 | functionName.append(word.toLowerCase()); 18 | } 19 | return functionName.toString(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-jakarta-openejb/src/test/java/io/cucumber/jakarta/openejb/BellyStepDefinitions.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.jakarta.openejb; 2 | 3 | import io.cucumber.java.en.Given; 4 | import io.cucumber.java.en.Then; 5 | import jakarta.inject.Inject; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class BellyStepDefinitions { 10 | 11 | @Inject 12 | private Belly belly; 13 | 14 | @Given("I have {int} cukes in my belly") 15 | public void haveCukes(int n) { 16 | belly.setCukes(n); 17 | } 18 | 19 | @Then("there are {int} cukes in my belly") 20 | public void checkCukes(int n) { 21 | assertEquals(n, belly.getCukes()); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/TypeReference.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import java.lang.reflect.ParameterizedType; 4 | import java.lang.reflect.Type; 5 | 6 | public abstract class TypeReference { 7 | 8 | private final Type type; 9 | 10 | protected TypeReference() { 11 | Type superclass = getClass().getGenericSuperclass(); 12 | if (superclass instanceof Class) { 13 | throw new CucumberDataTableException("Missing type parameter: " + superclass); 14 | } 15 | this.type = ((ParameterizedType) superclass).getActualTypeArguments()[0]; 16 | } 17 | 18 | public Type getType() { 19 | return this.type; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/contextcaching/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.contextcaching; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectClasspathResource; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectClasspathResource("io/cucumber/spring/contextCaching.feature") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.spring.contextcaching") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/test/java/io/cucumber/examples/spring/application/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.spring.application; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectPackages("io.cucumber.examples.spring.application") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.examples.spring.application") 14 | public class RunCucumberTest { 15 | } 16 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/java/io/cucumber/examples/wicket/main/view/Available.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.examples.wicket.main.view; 2 | 3 | import io.cucumber.examples.wicket.main.Application; 4 | import org.apache.wicket.markup.html.WebPage; 5 | import org.apache.wicket.markup.html.basic.Label; 6 | 7 | public class Available extends WebPage { 8 | 9 | public Available() { 10 | String availableCars = "" + getAvailableCars(); 11 | Label message = new Label("availableCars", availableCars); 12 | add(message); 13 | } 14 | 15 | public int getAvailableCars() { 16 | return ((Application) getApplication()).getNumberOfAvailableCars(); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /release-notes/v2.2.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | layout: post 3 | nav: blog 4 | date: "2017-12-05 09:00:00" 5 | title: "Announcing Cucumber-JVM v2.2.0" 6 | author: mpkorstanje 7 | --- 8 | 9 | Cucumber-JVM v2.2.0 has been released. This release fixes two regressions introduced in v2.0.x: 10 | 11 | - The Json Formatter `tags` node was missing for features 12 | - Fixed detection of XStreamsConverters annotation 13 | 14 | This release also fixes: 15 | 16 | - Fixed a nullpointer when using invalid options with TestNG 17 | 18 | Additionally this release also adds support for: 19 | 20 | - Empty tag expressions 21 | 22 | For the full change log, see [CHANGELOG.md](https://github.com/cucumber/cucumber-jvm/blob/main/CHANGELOG.md). 23 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/CucumberBackendException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Thrown when the backend could not invoke some glue code. Not to be confused 7 | * with {@link CucumberInvocationTargetException} which is thrown when the glue 8 | * code throws an exception. 9 | */ 10 | @API(status = API.Status.STABLE) 11 | public class CucumberBackendException extends RuntimeException { 12 | 13 | public CucumberBackendException(String message) { 14 | super(message); 15 | } 16 | 17 | public CucumberBackendException(String message, Throwable cause) { 18 | super(message, cause); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/Argument.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Represents an argument in a cucumber or regular expressions 7 | *

8 | * The step definition {@code I have {long} cukes in my belly} when matched with 9 | * {@code I have 7 cukes in my belly} will produce one argument with value 10 | * {@code "4"}, starting at {@code 7} and ending at {@code 8}. 11 | */ 12 | @API(status = API.Status.STABLE) 13 | public interface Argument { 14 | 15 | String getParameterTypeName(); 16 | 17 | String getValue(); 18 | 19 | int getStart(); 20 | 21 | int getEnd(); 22 | 23 | Group getGroup(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /cucumber-plugin/src/main/java/io/cucumber/plugin/event/TestStep.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.plugin.event; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.UUID; 6 | 7 | /** 8 | * A test step can either represent the execution of a hook or a pickle step. 9 | * Each step is tied to some glue code. 10 | * 11 | * @see TestCaseStarted 12 | * @see TestCaseFinished 13 | */ 14 | 15 | @API(status = API.Status.STABLE) 16 | public interface TestStep { 17 | 18 | /** 19 | * Returns a string representation of the glue code location. 20 | * 21 | * @return a string representation of the glue code location. 22 | */ 23 | String getCodeLocation(); 24 | 25 | UUID getId(); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /cucumber-java/src/test/resources/io/cucumber/java/annotation/scenario_outline_substitution.feature: -------------------------------------------------------------------------------- 1 | Feature: Scenario Outline Substitution 2 | 3 | Scenario Outline: Email confirmation 4 | Given I have a user account with my name "Jojo Binks" 5 | When an Admin grants me rights 6 | Then I should receive an email with the body: 7 | """ 8 | Dear Jojo Binks, 9 | You have been granted rights. You are

. Please be responsible. 10 | -The Admins 11 | """ 12 | Examples: 13 | | Role | details | 14 | | Manager | now able to manage your employee accounts | 15 | | Admin | able to manage any user account on the system | 16 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/dirtiescontextconfig/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.dirtiescontextconfig; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectClasspathResource; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectClasspathResource("io/cucumber/spring/dirtyCukes.feature") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.spring.dirtiescontextconfig") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/CucumberExceptionWrapper.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import io.cucumber.core.exception.CucumberException; 4 | 5 | /** 6 | * The only purpose of this class is to move parse errors from the DataProvider 7 | * to the test execution of the TestNG tests. 8 | * 9 | * @see TestNGCucumberRunner#provideScenarios() 10 | */ 11 | final class CucumberExceptionWrapper implements PickleWrapper { 12 | 13 | private final CucumberException exception; 14 | 15 | CucumberExceptionWrapper(CucumberException e) { 16 | this.exception = e; 17 | } 18 | 19 | @Override 20 | public Pickle getPickle() { 21 | throw this.exception; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/backend/Pending.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.lang.annotation.ElementType; 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.RetentionPolicy; 8 | import java.lang.annotation.Target; 9 | 10 | /** 11 | * Any exception class annotated with this annotation will be treated as a 12 | * "pending" exception. That is - if the exception is thrown from a step 13 | * definition or hook, the scenario's status will be pending instead of failed. 14 | */ 15 | @API(status = API.Status.STABLE) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @Target(ElementType.TYPE) 18 | public @interface Pending { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/annotationconfig/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.annotationconfig; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectClasspathResource; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectClasspathResource("io/cucumber/spring/annotationContextConfiguration.feature") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.spring.annotationconfig") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/skipped/Skipped.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.skipped; 2 | 3 | import io.cucumber.java.Before; 4 | import io.cucumber.java.en.And; 5 | import io.cucumber.java.en.Given; 6 | import org.junit.jupiter.api.Assumptions; 7 | 8 | public class Skipped { 9 | 10 | @Before("@skip") 11 | public void before() { 12 | Assumptions.abort(); 13 | } 14 | 15 | @Given("a step that is skipped") 16 | public void aStepThatIsSkipped() { 17 | } 18 | 19 | @Given("a step that does not skip") 20 | public void aStepThatDoesNotSkip() { 21 | } 22 | 23 | @And("I skip a step") 24 | public void iSkipAStep() { 25 | Assumptions.abort(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runtime/TestCaseFailed.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runtime; 2 | 3 | import java.util.function.Function; 4 | import java.util.function.Supplier; 5 | 6 | /** 7 | * Failures as asserted by 8 | * {@link TestCaseResultObserver#assertTestCasePassed(Supplier, Function, Function, Function)} 9 | * should not be collected by the rethrowing 10 | * {@link RethrowingThrowableCollector}. 11 | *

12 | * This wrapper facilitates cooperation between the two. Any exceptions caught 13 | * this way should be unpacked and rethrown. 14 | */ 15 | class TestCaseFailed extends RuntimeException { 16 | 17 | public TestCaseFailed(Throwable throwable) { 18 | super(throwable); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-junit/src/main/java/io/cucumber/junit/JUnitOptions.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | final class JUnitOptions { 4 | 5 | private boolean filenameCompatibleNames = false; 6 | private boolean stepNotifications = false; 7 | 8 | boolean filenameCompatibleNames() { 9 | return filenameCompatibleNames; 10 | } 11 | 12 | boolean stepNotifications() { 13 | return stepNotifications; 14 | } 15 | 16 | void setFilenameCompatibleNames(boolean filenameCompatibleNames) { 17 | this.filenameCompatibleNames = filenameCompatibleNames; 18 | } 19 | 20 | void setStepNotifications(boolean stepNotifications) { 21 | this.stepNotifications = stepNotifications; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/metaconfig/dirties/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.metaconfig.dirties; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectClasspathResource; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectClasspathResource("io/cucumber/spring/dirtyCukesWithMetaConfiguration.feature") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "io.cucumber.spring.metaconfig.dirties") 14 | public class RunCucumberTest { 15 | 16 | } 17 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/TableCellTransformer.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | /** 6 | * Transforms a single table cell to an instance of {@code T}. 7 | * 8 | * @param the target type 9 | */ 10 | @API(status = API.Status.STABLE) 11 | @FunctionalInterface 12 | public interface TableCellTransformer { 13 | 14 | /** 15 | * Transforms a single table cell to an instance of {@code T}. 16 | * 17 | * @param cell the contents of a cell. Never null. 18 | * @return an instance of {@code T} 19 | * @throws Throwable when the transform fails for any reason 20 | */ 21 | T transform(String cell) throws Throwable; 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-java/src/main/java/io/cucumber/java/InvalidMethodException.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java; 2 | 3 | import io.cucumber.core.backend.CucumberBackendException; 4 | 5 | import java.lang.reflect.Method; 6 | 7 | final class InvalidMethodException extends CucumberBackendException { 8 | 9 | private InvalidMethodException(String message) { 10 | super(message); 11 | } 12 | 13 | static InvalidMethodException createInvalidMethodException(Method method, Class glueCodeClass) { 14 | return new InvalidMethodException( 15 | "You're not allowed to extend classes that define Step Definitions or hooks. " 16 | + glueCodeClass + " extends " + method.getDeclaringClass()); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /cucumber-java8/src/main/java/io/cucumber/java8/Java8DefaultParameterTransformerDefinition.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.java8; 2 | 3 | import io.cucumber.core.backend.DefaultParameterTransformerDefinition; 4 | import io.cucumber.cucumberexpressions.ParameterByTypeTransformer; 5 | 6 | class Java8DefaultParameterTransformerDefinition extends AbstractGlueDefinition 7 | implements DefaultParameterTransformerDefinition { 8 | 9 | Java8DefaultParameterTransformerDefinition(DefaultParameterTransformerBody body) { 10 | super(body, new Exception().getStackTrace()[3]); 11 | } 12 | 13 | @Override 14 | public ParameterByTypeTransformer parameterByTypeTransformer() { 15 | return this::invokeMethod; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/java/io/cucumber/guice/ScenarioScoped.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.guice; 2 | 3 | import com.google.inject.ScopeAnnotation; 4 | import org.apiguardian.api.API; 5 | 6 | import java.lang.annotation.Retention; 7 | import java.lang.annotation.Target; 8 | 9 | import static java.lang.annotation.ElementType.METHOD; 10 | import static java.lang.annotation.ElementType.TYPE; 11 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 12 | 13 | /** 14 | * A custom Guice scope annotation that is usually bound to an instance of 15 | * ScenarioScope. 16 | */ 17 | @Target({ TYPE, METHOD }) 18 | @Retention(RUNTIME) 19 | @ScopeAnnotation 20 | @API(status = API.Status.STABLE) 21 | public @interface ScenarioScoped { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/cucumbercontextconfigannotation/WithMetaAnnotation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.cucumbercontextconfigannotation; 2 | 3 | import io.cucumber.spring.CucumberContextConfiguration; 4 | import org.springframework.test.context.ContextConfiguration; 5 | 6 | import java.lang.annotation.ElementType; 7 | import java.lang.annotation.Retention; 8 | import java.lang.annotation.RetentionPolicy; 9 | import java.lang.annotation.Target; 10 | 11 | @MyTestAnnotation 12 | public class WithMetaAnnotation { 13 | } 14 | 15 | @Target(ElementType.TYPE) 16 | @Retention(RetentionPolicy.RUNTIME) 17 | @CucumberContextConfiguration 18 | @ContextConfiguration("classpath:cucumber.xml") 19 | @interface MyTestAnnotation { 20 | } 21 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/datatables/DataTables.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.datatables; 2 | 3 | import io.cucumber.datatable.DataTable; 4 | import io.cucumber.java.en.Then; 5 | import io.cucumber.java.en.When; 6 | 7 | import static org.junit.jupiter.api.Assertions.assertEquals; 8 | 9 | public class DataTables { 10 | 11 | private DataTable toTranspose; 12 | 13 | @When("the following table is transposed:") 14 | public void theFollowingTableIsTransposed(DataTable toTranspose) { 15 | this.toTranspose = toTranspose; 16 | } 17 | 18 | @Then("it should be:") 19 | public void itShouldBe(DataTable expected) { 20 | assertEquals(expected, toTranspose.transpose()); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/plugin/UrlReporter.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.plugin; 2 | 3 | import io.cucumber.plugin.ColorAware; 4 | 5 | import java.io.PrintStream; 6 | 7 | final class UrlReporter implements ColorAware { 8 | private final PrintStream out; 9 | private boolean monochrome; 10 | 11 | public UrlReporter(PrintStream out) { 12 | this.out = out; 13 | } 14 | 15 | public void report(String message) { 16 | if (monochrome) { 17 | message = message.replaceAll("\u001B\\[[;\\d]*m", ""); 18 | } 19 | out.print(message); 20 | } 21 | 22 | @Override 23 | public void setMonochrome(boolean monochrome) { 24 | this.monochrome = monochrome; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/options/SnippetTypeParser.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | import io.cucumber.core.snippets.SnippetType; 4 | 5 | public final class SnippetTypeParser { 6 | 7 | private SnippetTypeParser() { 8 | 9 | } 10 | 11 | public static SnippetType parseSnippetType(String nextArg) { 12 | SnippetType underscore; 13 | if ("underscore".equals(nextArg)) { 14 | underscore = SnippetType.UNDERSCORE; 15 | } else if ("camelcase".equals(nextArg)) { 16 | underscore = SnippetType.CAMELCASE; 17 | } else { 18 | throw new IllegalArgumentException("Unrecognized SnippetType " + nextArg); 19 | } 20 | return underscore; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/resource/ClassLoaders.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.resource; 2 | 3 | import static io.cucumber.core.exception.UnrecoverableExceptions.rethrowIfUnrecoverable; 4 | 5 | public final class ClassLoaders { 6 | 7 | private ClassLoaders() { 8 | 9 | } 10 | 11 | public static ClassLoader getDefaultClassLoader() { 12 | try { 13 | ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); 14 | if (contextClassLoader != null) { 15 | return contextClassLoader; 16 | } 17 | } catch (Throwable t) { 18 | rethrowIfUnrecoverable(t); 19 | } 20 | return ClassLoader.getSystemClassLoader(); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/TableRowTransformer.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | import org.apiguardian.api.API; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Transforms a single table row to an instance of {@code T}. 9 | * 10 | * @param the target type 11 | */ 12 | @API(status = API.Status.STABLE) 13 | @FunctionalInterface 14 | public interface TableRowTransformer { 15 | /** 16 | * Transforms a single table row to an instance of {@code T}. 17 | * 18 | * @param row the contents of a row. Never null. 19 | * @return an instance of {@code T} 20 | * @throws Throwable when the transform fails for any reason 21 | */ 22 | T transform(List row) throws Throwable; 23 | } 24 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/ordering.feature: -------------------------------------------------------------------------------- 1 | Feature: 1. A feature to order scenarios 2 | 3 | Scenario: 1.1 4 | Given a single scenario 5 | 6 | Scenario Outline: 1.2 7 | Given a single scenario 8 | 9 | Examples: 1.2.1 10 | 11 | | key | 12 | | a | 13 | | b | 14 | 15 | Examples: 1.2.2 16 | 17 | | key | 18 | | c | 19 | | d | 20 | 21 | Rule: 1.3 A rule 22 | 23 | Example: 1.3.1 24 | Given a single scenario 25 | 26 | Example: 1.3.2 27 | Given a single scenario 28 | 29 | Rule: 1.4 30 | 31 | Example: 1.4.1 32 | Given a single scenario 33 | 34 | Example: 1.4.2 35 | Given a single scenario 36 | 37 | 38 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/runner/Match.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.runner; 2 | 3 | import io.cucumber.core.stepexpression.Argument; 4 | 5 | import java.util.List; 6 | 7 | import static java.util.Objects.requireNonNull; 8 | 9 | abstract class Match { 10 | 11 | private final List arguments; 12 | private final String location; 13 | 14 | Match(List arguments, String location) { 15 | requireNonNull(arguments, "argument may not be null"); 16 | this.arguments = arguments; 17 | this.location = location; 18 | } 19 | 20 | public List getArguments() { 21 | return arguments; 22 | } 23 | 24 | public String getLocation() { 25 | return location; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/exception/UnrecoverableExceptionsTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.exception; 2 | 3 | import org.junit.jupiter.api.Test; 4 | 5 | import static io.cucumber.core.exception.UnrecoverableExceptions.rethrowIfUnrecoverable; 6 | import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; 7 | import static org.junit.jupiter.api.Assertions.assertThrows; 8 | 9 | class UnrecoverableExceptionsTest { 10 | 11 | @Test 12 | void rethrowsOutOfMemoryError() { 13 | assertThrows(OutOfMemoryError.class, () -> rethrowIfUnrecoverable(new OutOfMemoryError())); 14 | } 15 | 16 | @Test 17 | void ignoresThrowable() { 18 | assertDoesNotThrow(() -> rethrowIfUnrecoverable(new Throwable())); 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /cucumber-core/src/test/java/io/cucumber/core/options/RuntimeOptionsBuilderTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.options; 2 | 3 | import io.cucumber.core.eventbus.IncrementingUuidGenerator; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertEquals; 7 | 8 | class RuntimeOptionsBuilderTest { 9 | 10 | @Test 11 | void build() { 12 | // Given 13 | RuntimeOptionsBuilder builder = new RuntimeOptionsBuilder() 14 | .setUuidGeneratorClass(IncrementingUuidGenerator.class); 15 | 16 | // When 17 | RuntimeOptions runtimeOptions = builder.build(); 18 | 19 | // Then 20 | assertEquals(IncrementingUuidGenerator.class, runtimeOptions.getUuidGeneratorClass()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /cucumber-archetype/src/main/resources/archetype-resources/src/test/java/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package ${package}; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectPackages; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | import static io.cucumber.junit.platform.engine.Constants.PLUGIN_PROPERTY_NAME; 10 | 11 | @Suite 12 | @IncludeEngines("cucumber") 13 | @SelectPackages("${package}") 14 | @ConfigurationParameter(key = PLUGIN_PROPERTY_NAME, value = "pretty") 15 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "${package}") 16 | public class RunCucumberTest { 17 | } 18 | -------------------------------------------------------------------------------- /cucumber-junit/src/main/java/io/cucumber/junit/NoObjectFactory.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit; 2 | 3 | import io.cucumber.core.backend.ObjectFactory; 4 | 5 | /** 6 | * This object factory does nothing. It is solely needed for marking purposes. 7 | */ 8 | final class NoObjectFactory implements ObjectFactory { 9 | 10 | private NoObjectFactory() { 11 | // No need for instantiation 12 | } 13 | 14 | @Override 15 | public boolean addClass(Class glueClass) { 16 | return false; 17 | } 18 | 19 | @Override 20 | public T getInstance(Class glueClass) { 21 | return null; 22 | } 23 | 24 | @Override 25 | public void start() { 26 | } 27 | 28 | @Override 29 | public void stop() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/java/io/cucumber/spring/contextconfig/RunCucumberTest.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.spring.contextconfig; 2 | 3 | import org.junit.platform.suite.api.ConfigurationParameter; 4 | import org.junit.platform.suite.api.IncludeEngines; 5 | import org.junit.platform.suite.api.SelectClasspathResource; 6 | import org.junit.platform.suite.api.Suite; 7 | 8 | import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; 9 | 10 | @Suite 11 | @IncludeEngines("cucumber") 12 | @SelectClasspathResource("io/cucumber/spring/stepdefInjection.feature") 13 | @ConfigurationParameter(key = GLUE_PROPERTY_NAME, 14 | value = "io.cucumber.spring.contextconfig," + 15 | "io.cucumber.spring.commonglue") 16 | public class RunCucumberTest { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /cucumber-testng/src/main/java/io/cucumber/testng/NoObjectFactory.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.testng; 2 | 3 | import io.cucumber.core.backend.ObjectFactory; 4 | 5 | /** 6 | * This object factory does nothing. It is solely needed for marking purposes. 7 | */ 8 | final class NoObjectFactory implements ObjectFactory { 9 | 10 | private NoObjectFactory() { 11 | // No need for instantiation 12 | } 13 | 14 | @Override 15 | public boolean addClass(Class glueClass) { 16 | return false; 17 | } 18 | 19 | @Override 20 | public T getInstance(Class glueClass) { 21 | return null; 22 | } 23 | 24 | @Override 25 | public void start() { 26 | } 27 | 28 | @Override 29 | public void stop() { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /cucumber-core/src/main/java/io/cucumber/core/plugin/CanonicalOrderEventPublisher.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.plugin; 2 | 3 | import io.cucumber.core.eventbus.AbstractEventPublisher; 4 | import io.cucumber.plugin.event.Event; 5 | import io.cucumber.plugin.event.TestRunFinished; 6 | 7 | import java.util.LinkedList; 8 | import java.util.List; 9 | 10 | final class CanonicalOrderEventPublisher extends AbstractEventPublisher { 11 | 12 | private final List queue = new LinkedList<>(); 13 | 14 | public void handle(final Event event) { 15 | queue.add(event); 16 | if (event instanceof TestRunFinished) { 17 | queue.sort(new CanonicalEventOrder()); 18 | sendAll(queue); 19 | queue.clear(); 20 | } 21 | } 22 | 23 | } 24 | --------------------------------------------------------------------------------