├── .checkstyle └── checkstyle.xml ├── .editorconfig ├── .github ├── FUNDING.yml ├── lock.yml ├── renovate.json ├── stale.yml └── workflows │ ├── release-github.yml │ ├── release-java.yml │ ├── test-java.yml │ └── test-testdata.yml ├── .gitignore ├── .mvn ├── jvm.config └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .revapi └── api-changes.json ├── .spotless ├── eclipse-formatter-settings.xml └── intellij-idea.importorder ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── RELEASING.md ├── SEMVER.md ├── compatibility ├── pom.xml └── src │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── compatibility │ │ ├── AComparableMessage.java │ │ ├── CompatibilityTest.java │ │ ├── TestCase.java │ │ ├── attachments │ │ └── Attachments.java │ │ ├── cdata │ │ └── Cdata.java │ │ ├── datatables │ │ └── DataTables.java │ │ ├── empty │ │ └── Empty.java │ │ ├── examplestables │ │ └── ExamplesTable.java │ │ ├── examplestablesattachment │ │ └── ExampleTablesAttachment.java │ │ ├── hooks │ │ └── Hooks.java │ │ ├── hooksattachment │ │ └── HooksAttachment.java │ │ ├── hooksconditional │ │ └── HooksConditional.java │ │ ├── minimal │ │ └── Minimal.java │ │ ├── parametertypes │ │ └── ParameterTypes.java │ │ ├── pending │ │ └── Pending.java │ │ ├── rules │ │ └── Rules.java │ │ ├── skipped │ │ └── Skipped.java │ │ ├── stacktraces │ │ └── StackTraces.java │ │ ├── undefined │ │ └── Undefined.java │ │ └── unknownparametertype │ │ └── UnknownParameterType.java │ └── resources │ ├── .gitattributes │ ├── .gitignore │ ├── README.md │ ├── features │ ├── attachments │ │ ├── attachments.feature │ │ ├── attachments.feature.ndjson │ │ ├── cucumber.jpeg │ │ ├── cucumber.png │ │ └── document.pdf │ ├── cdata │ │ ├── cdata.feature │ │ └── cdata.feature.ndjson │ ├── data-tables │ │ ├── data-tables.feature │ │ └── data-tables.feature.ndjson │ ├── empty │ │ ├── empty.feature │ │ └── empty.feature.ndjson │ ├── examples-tables-attachment │ │ ├── cucumber.jpeg │ │ ├── cucumber.png │ │ ├── examples-tables-attachment.feature │ │ └── examples-tables-attachment.feature.ndjson │ ├── examples-tables │ │ ├── examples-tables.feature │ │ └── examples-tables.feature.ndjson │ ├── hooks-attachment │ │ ├── .gitattributes │ │ ├── cucumber.svg │ │ ├── hooks-attachment.feature │ │ └── hooks-attachment.feature.ndjson │ ├── hooks-conditional │ │ ├── hooks-conditional.feature │ │ └── hooks-conditional.feature.ndjson │ ├── hooks-named │ │ ├── hooks-named.feature │ │ └── hooks-named.feature.ndjson │ ├── hooks │ │ ├── hooks.feature │ │ └── hooks.feature.ndjson │ ├── markdown │ │ ├── markdown.feature.md │ │ └── markdown.feature.md.ndjson │ ├── minimal │ │ ├── minimal.feature │ │ └── minimal.feature.ndjson │ ├── parameter-types │ │ ├── parameter-types.feature │ │ └── parameter-types.feature.ndjson │ ├── pending │ │ ├── pending.feature │ │ └── pending.feature.ndjson │ ├── retry │ │ ├── retry.arguments.txt │ │ ├── retry.feature │ │ └── retry.feature.ndjson │ ├── rules │ │ ├── rules.feature │ │ └── rules.feature.ndjson │ ├── skipped │ │ ├── skipped.feature │ │ └── skipped.feature.ndjson │ ├── stack-traces │ │ ├── stack-traces.feature │ │ └── stack-traces.feature.ndjson │ ├── undefined │ │ ├── undefined.feature │ │ └── undefined.feature.ndjson │ └── unknown-parameter-type │ │ ├── unknown-parameter-type.feature │ │ └── unknown-parameter-type.feature.ndjson │ ├── package-lock.json │ └── package.json ├── cucumber-archetype ├── README.md ├── pom.xml └── src │ ├── main │ └── resources │ │ ├── META-INF │ │ └── maven │ │ │ └── archetype-metadata.xml │ │ └── archetype-resources │ │ ├── pom.xml │ │ └── src │ │ └── test │ │ ├── java │ │ ├── RunCucumberTest.java │ │ └── StepDefinitions.java │ │ └── resources │ │ └── __packageInPathFormat__ │ │ └── example.feature │ └── test │ └── resources │ └── projects │ └── should-generate-project │ ├── archetype.pom.properties │ ├── archetype.properties │ ├── goal.txt │ └── reference │ ├── pom.xml │ └── src │ └── test │ ├── java │ └── com │ │ └── example │ │ ├── RunCucumberTest.java │ │ └── StepDefinitions.java │ └── resources │ └── com │ └── example │ └── example.feature ├── cucumber-bom ├── README.md └── pom.xml ├── cucumber-cdi2 ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── cdi2 │ │ │ └── Cdi2Factory.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── cdi2 │ │ ├── Cdi2FactoryTest.java │ │ ├── IgnoreLocalBeansXmlClassLoader.java │ │ └── example │ │ ├── Belly.java │ │ ├── BellyStepDefinitions.java │ │ └── RunCucumberTest.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── io │ └── cucumber │ │ └── cdi2 │ │ └── example │ │ └── cukes.feature │ └── junit-platform.properties ├── cucumber-core ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ ├── cucumber │ │ │ └── api │ │ │ │ └── cli │ │ │ │ └── Main.java │ │ └── io │ │ │ └── cucumber │ │ │ └── core │ │ │ ├── api │ │ │ └── TypeRegistry.java │ │ │ ├── backend │ │ │ ├── Backend.java │ │ │ ├── BackendProviderService.java │ │ │ ├── Container.java │ │ │ ├── CucumberBackendException.java │ │ │ ├── CucumberInvocationTargetException.java │ │ │ ├── DataTableTypeDefinition.java │ │ │ ├── DefaultDataTableCellTransformerDefinition.java │ │ │ ├── DefaultDataTableEntryTransformerDefinition.java │ │ │ ├── DefaultObjectFactory.java │ │ │ ├── DefaultParameterTransformerDefinition.java │ │ │ ├── DocStringTypeDefinition.java │ │ │ ├── Glue.java │ │ │ ├── HookDefinition.java │ │ │ ├── JavaMethodReference.java │ │ │ ├── Located.java │ │ │ ├── Lookup.java │ │ │ ├── ObjectFactory.java │ │ │ ├── Options.java │ │ │ ├── ParameterInfo.java │ │ │ ├── ParameterTypeDefinition.java │ │ │ ├── Pending.java │ │ │ ├── ScenarioScoped.java │ │ │ ├── Snippet.java │ │ │ ├── SourceReference.java │ │ │ ├── StackTraceElementReference.java │ │ │ ├── StaticHookDefinition.java │ │ │ ├── Status.java │ │ │ ├── StepDefinition.java │ │ │ ├── TestCaseState.java │ │ │ └── TypeResolver.java │ │ │ ├── cli │ │ │ ├── CommandlineOptions.java │ │ │ └── Main.java │ │ │ ├── eventbus │ │ │ ├── AbstractEventBus.java │ │ │ ├── AbstractEventPublisher.java │ │ │ ├── EventBus.java │ │ │ ├── IncrementingUuidGenerator.java │ │ │ ├── Options.java │ │ │ ├── RandomUuidGenerator.java │ │ │ └── UuidGenerator.java │ │ │ ├── exception │ │ │ ├── CompositeCucumberException.java │ │ │ ├── CucumberException.java │ │ │ ├── ExceptionUtils.java │ │ │ └── UnrecoverableExceptions.java │ │ │ ├── feature │ │ │ ├── FeatureIdentifier.java │ │ │ ├── FeatureParser.java │ │ │ ├── FeaturePath.java │ │ │ ├── FeatureWithLines.java │ │ │ ├── GluePath.java │ │ │ └── Options.java │ │ │ ├── filter │ │ │ ├── Filters.java │ │ │ ├── LinePredicate.java │ │ │ ├── NamePredicate.java │ │ │ ├── Options.java │ │ │ └── TagPredicate.java │ │ │ ├── logging │ │ │ ├── LogRecordListener.java │ │ │ ├── Logger.java │ │ │ └── LoggerFactory.java │ │ │ ├── options │ │ │ ├── BooleanString.java │ │ │ ├── CommandlineOptionsParser.java │ │ │ ├── Constants.java │ │ │ ├── CucumberOptionsAnnotationParser.java │ │ │ ├── CucumberProperties.java │ │ │ ├── CucumberPropertiesParser.java │ │ │ ├── CucumberPropertiesProvider.java │ │ │ ├── CurlOption.java │ │ │ ├── FeatureWithLinesOrRerunPath.java │ │ │ ├── GlueFile.java │ │ │ ├── ObjectFactoryParser.java │ │ │ ├── PickleOrderParser.java │ │ │ ├── PluginOption.java │ │ │ ├── RerunPath.java │ │ │ ├── RuntimeOptions.java │ │ │ ├── RuntimeOptionsBuilder.java │ │ │ ├── ShellWords.java │ │ │ ├── SnippetTypeParser.java │ │ │ └── UuidGeneratorParser.java │ │ │ ├── order │ │ │ ├── PickleOrder.java │ │ │ └── StandardPickleOrders.java │ │ │ ├── plugin │ │ │ ├── AnsiEscapes.java │ │ │ ├── Banner.java │ │ │ ├── CanonicalEventOrder.java │ │ │ ├── CanonicalOrderEventPublisher.java │ │ │ ├── DefaultSummaryPrinter.java │ │ │ ├── Format.java │ │ │ ├── Formats.java │ │ │ ├── HtmlFormatter.java │ │ │ ├── JUnitFormatter.java │ │ │ ├── Jackson.java │ │ │ ├── JsonFormatter.java │ │ │ ├── MessageFormatter.java │ │ │ ├── NoPublishFormatter.java │ │ │ ├── Options.java │ │ │ ├── PluginFactory.java │ │ │ ├── Plugins.java │ │ │ ├── PrettyFormatter.java │ │ │ ├── ProgressFormatter.java │ │ │ ├── PublishFormatter.java │ │ │ ├── RerunFormatter.java │ │ │ ├── Stats.java │ │ │ ├── TeamCityPlugin.java │ │ │ ├── TestNGFormatter.java │ │ │ ├── TestSourceReadResource.java │ │ │ ├── TestSourcesModel.java │ │ │ ├── TimelineFormatter.java │ │ │ ├── UTF8OutputStreamWriter.java │ │ │ ├── UTF8PrintWriter.java │ │ │ ├── UnusedStepsSummaryPrinter.java │ │ │ ├── UrlOutputStream.java │ │ │ ├── UrlReporter.java │ │ │ └── UsageFormatter.java │ │ │ ├── resource │ │ │ ├── ClassLoaders.java │ │ │ ├── ClasspathScanner.java │ │ │ ├── ClasspathSupport.java │ │ │ ├── CloseablePath.java │ │ │ ├── JarUriFileSystemService.java │ │ │ ├── PathScanner.java │ │ │ ├── Resource.java │ │ │ ├── ResourceScanner.java │ │ │ └── Resources.java │ │ │ ├── runner │ │ │ ├── AmbiguousPickleStepDefinitionsMatch.java │ │ │ ├── AmbiguousStepDefinitionsException.java │ │ │ ├── CachingGlue.java │ │ │ ├── CamelCaseStringConverter.java │ │ │ ├── CoreDefaultDataTableEntryTransformerDefinition.java │ │ │ ├── CoreHookDefinition.java │ │ │ ├── CoreStepDefinition.java │ │ │ ├── DefinitionArgument.java │ │ │ ├── DuplicateDefaultDataTableCellTransformers.java │ │ │ ├── DuplicateDefaultDataTableEntryTransformers.java │ │ │ ├── DuplicateDefaultParameterTransformers.java │ │ │ ├── DuplicateStepDefinitionException.java │ │ │ ├── ExecutionMode.java │ │ │ ├── HookDefinitionMatch.java │ │ │ ├── HookTestStep.java │ │ │ ├── Match.java │ │ │ ├── NoStepDefinition.java │ │ │ ├── Options.java │ │ │ ├── PickleStepDefinitionMatch.java │ │ │ ├── PickleStepTestStep.java │ │ │ ├── Runner.java │ │ │ ├── StackManipulation.java │ │ │ ├── StepDefinitionMatch.java │ │ │ ├── TestAbortedExceptions.java │ │ │ ├── TestCase.java │ │ │ ├── TestCaseState.java │ │ │ ├── TestStep.java │ │ │ ├── TestStepResultStatusMapper.java │ │ │ ├── ThrowableCollector.java │ │ │ ├── UndefinedPickleStepDefinitionMatch.java │ │ │ └── UndefinedStepDefinitionException.java │ │ │ ├── runtime │ │ │ ├── BackendServiceLoader.java │ │ │ ├── BackendSupplier.java │ │ │ ├── CucumberExecutionContext.java │ │ │ ├── ExitStatus.java │ │ │ ├── FeaturePathFeatureSupplier.java │ │ │ ├── FeatureSupplier.java │ │ │ ├── ObjectFactoryServiceLoader.java │ │ │ ├── ObjectFactorySupplier.java │ │ │ ├── RethrowingThrowableCollector.java │ │ │ ├── RunnerSupplier.java │ │ │ ├── Runtime.java │ │ │ ├── SingletonObjectFactorySupplier.java │ │ │ ├── SingletonRunnerSupplier.java │ │ │ ├── SynchronizedEventBus.java │ │ │ ├── TestCaseFailed.java │ │ │ ├── TestCaseResultObserver.java │ │ │ ├── ThreadLocalObjectFactorySupplier.java │ │ │ ├── ThreadLocalRunnerSupplier.java │ │ │ ├── TimeServiceEventBus.java │ │ │ └── UuidGeneratorServiceLoader.java │ │ │ ├── snippets │ │ │ ├── ArgumentPattern.java │ │ │ ├── CamelCaseJoiner.java │ │ │ ├── IdentifierGenerator.java │ │ │ ├── Joiner.java │ │ │ ├── SnakeCaseJoiner.java │ │ │ ├── SnippetGenerator.java │ │ │ └── SnippetType.java │ │ │ └── stepexpression │ │ │ ├── Argument.java │ │ │ ├── ArgumentMatcher.java │ │ │ ├── DataTableArgument.java │ │ │ ├── DocStringArgument.java │ │ │ ├── DocStringTransformer.java │ │ │ ├── ExpressionArgument.java │ │ │ ├── RawTableTransformer.java │ │ │ ├── StepExpression.java │ │ │ ├── StepExpressionFactory.java │ │ │ └── StepTypeRegistry.java │ └── resources │ │ ├── META-INF │ │ └── services │ │ │ ├── io.cucumber.core.backend.ObjectFactory │ │ │ └── io.cucumber.core.eventbus.UuidGenerator │ │ └── io │ │ └── cucumber │ │ └── core │ │ ├── options │ │ └── USAGE.txt │ │ ├── plugin │ │ └── timeline │ │ │ ├── chosen-sprite.png │ │ │ ├── chosen.jquery.min.js │ │ │ ├── chosen.min.css │ │ │ ├── chosen.override.css │ │ │ ├── formatter.js │ │ │ ├── index.html │ │ │ ├── jquery-3.5.1.min.js │ │ │ ├── report.css │ │ │ ├── vis-timeline-graph2d.min.css │ │ │ ├── vis-timeline-graph2d.min.js │ │ │ └── vis-timeline-graph2d.override.css │ │ └── version.properties │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── core │ │ ├── backend │ │ ├── DefaultObjectFactoryTest.java │ │ ├── StubBackendProviderService.java │ │ ├── StubHookDefinition.java │ │ ├── StubLocation.java │ │ ├── StubPendingException.java │ │ ├── StubStaticHookDefinition.java │ │ └── StubStepDefinition.java │ │ ├── cli │ │ └── MainDemo.java │ │ ├── eventbus │ │ ├── IncrementingUuidGeneratorTest.java │ │ └── RandomUuidGeneratorTest.java │ │ ├── exception │ │ ├── CompositeCucumberExceptionTest.java │ │ ├── CucumberExceptionTest.java │ │ └── UnrecoverableExceptionsTest.java │ │ ├── feature │ │ ├── FeatureIdentifierTest.java │ │ ├── FeaturePathTest.java │ │ ├── FeatureWithLinesTest.java │ │ ├── GluePathTest.java │ │ └── TestFeatureParser.java │ │ ├── filter │ │ ├── LinePredicateTest.java │ │ ├── NamePredicateTest.java │ │ └── TagPredicateTest.java │ │ ├── logging │ │ ├── LoggerFactoryTest.java │ │ └── WithLogRecordListener.java │ │ ├── options │ │ ├── BooleanStringTest.java │ │ ├── CommandlineOptionsParserTest.java │ │ ├── CucumberOptions.java │ │ ├── CucumberOptionsAnnotationParserTest.java │ │ ├── CucumberPropertiesParserTest.java │ │ ├── CucumberPropertiesTest.java │ │ ├── CurlOptionTest.java │ │ ├── NoObjectFactory.java │ │ ├── NoUuidGenerator.java │ │ ├── PluginOptionTest.java │ │ ├── RerunFileTest.java │ │ ├── RuntimeOptionsBuilderTest.java │ │ ├── RuntimeOptionsTest.java │ │ ├── ShellWordsTest.java │ │ ├── TestPluginOption.java │ │ └── UuidGeneratorParserTest.java │ │ ├── order │ │ └── PickleOrderTest.java │ │ ├── plugin │ │ ├── BannerTest.java │ │ ├── Bytes.java │ │ ├── CanonicalEventOrderTest.java │ │ ├── DefaultSummaryPrinterTest.java │ │ ├── HtmlFormatterTest.java │ │ ├── IsEqualCompressingLineSeparators.java │ │ ├── JUnitFormatterTest.java │ │ ├── JsonFormatterTest.java │ │ ├── JsonParallelRuntimeTest.java │ │ ├── MessageFormatterTest.java │ │ ├── NoPublishFormatterTest.java │ │ ├── PluginFactoryTest.java │ │ ├── PluginsTest.java │ │ ├── PrettyFormatterTest.java │ │ ├── ProgressFormatterTest.java │ │ ├── RerunFormatterTest.java │ │ ├── StatsTest.java │ │ ├── StubException.java │ │ ├── StubFormatter.java │ │ ├── TeamCityPluginTest.java │ │ ├── TestNGFormatterTest.java │ │ ├── TimelineFormatterTest.java │ │ ├── UTF8PrintWriterTest.java │ │ ├── UnusedStepsSummaryPrinterTest.java │ │ ├── UrlOutputStreamTest.java │ │ ├── UrlReporterTest.java │ │ └── UsageFormatterTest.java │ │ ├── resource │ │ ├── ClasspathScannerTest.java │ │ ├── ClasspathSupportTest.java │ │ ├── JarUriFileSystemServiceTest.java │ │ ├── ResourceScannerTest.java │ │ └── test │ │ │ ├── ExampleClass.java │ │ │ ├── ExampleInterface.java │ │ │ └── OtherClass.java │ │ ├── runner │ │ ├── AmbiguousStepDefinitionMatchTest.java │ │ ├── AmbiguousStepDefinitionsExceptionTest.java │ │ ├── CachingGlueTest.java │ │ ├── CamelCaseConverterTest.java │ │ ├── ClockStub.java │ │ ├── CoreStepDefinitionTest.java │ │ ├── DuplicateStepDefinitionExceptionTest.java │ │ ├── EventBusTest.java │ │ ├── HookOrderTest.java │ │ ├── HookTest.java │ │ ├── HookTestStepTest.java │ │ ├── PickleStepTestStepTest.java │ │ ├── ResultTest.java │ │ ├── RunnerTest.java │ │ ├── StepDefinitionMatchTest.java │ │ ├── StepDurationTimeService.java │ │ ├── StubStepDefinition.java │ │ ├── TestAbortedExceptionsTest.java │ │ ├── TestBackendSupplier.java │ │ ├── TestCaseStateResultTest.java │ │ ├── TestCaseStateTest.java │ │ ├── TestCaseTest.java │ │ ├── TestDefinitionArgument.java │ │ ├── TestRunnerSupplier.java │ │ ├── ThrowableCollectorTest.java │ │ └── UndefinedStepDefinitionMatchTest.java │ │ ├── runtime │ │ ├── BackendServiceLoaderTest.java │ │ ├── CucumberExecutionContextTest.java │ │ ├── DryRunTest.java │ │ ├── ExitStatusTest.java │ │ ├── FeatureBuilderTest.java │ │ ├── FeaturePathFeatureSupplierTest.java │ │ ├── ObjectFactoryServiceLoaderTest.java │ │ ├── RuntimeTest.java │ │ ├── ServiceLoaderTestClassLoader.java │ │ ├── SingletonRunnerSupplierTest.java │ │ ├── StubBackendSupplier.java │ │ ├── StubFeatureSupplier.java │ │ ├── ThreadLocalRunnerSupplierTest.java │ │ └── UuidGeneratorServiceLoaderTest.java │ │ ├── snippets │ │ ├── ArgumentPatternTest.java │ │ ├── IdentifierGeneratorTest.java │ │ └── TestSnippet.java │ │ └── stepexpression │ │ ├── StepExpressionFactoryTest.java │ │ └── StepTypeRegistryTest.java │ ├── resource-symlink │ └── resources │ ├── META-INF │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ ├── env-test.properties │ └── io │ └── cucumber │ └── core │ ├── bar.properties │ ├── foo.properties │ ├── has spaces.properties │ ├── options │ ├── runtime-options-empty-rerun.txt │ └── runtime-options-rerun.txt │ ├── plugin │ ├── FormatterInParallel.feature │ ├── JsonPrettyFormatterTest.feature │ ├── JsonPrettyFormatterTest.json │ └── surefire-test-report-3.0.xsd │ ├── resource │ └── test │ │ ├── jar-resource.jar │ │ ├── other-resource.txt │ │ ├── resource.txt │ │ ├── spaces in name resource.txt │ │ └── spring-resource.jar │ └── runtime │ └── empty.feature ├── cucumber-deltaspike ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── deltaspike │ │ │ └── DeltaSpikeObjectFactory.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── deltaspike │ │ ├── Belly.java │ │ ├── BellyStepDefinitions.java │ │ ├── DeltaSpikeObjectFactoryTest.java │ │ └── RunCucumberTest.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── io │ └── cucumber │ │ └── deltaspike │ │ └── cukes.feature │ └── junit-platform.properties ├── cucumber-gherkin-messages ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── core │ │ │ └── gherkin │ │ │ └── messages │ │ │ ├── CucumberQuery.java │ │ │ ├── GherkinMessagesDataTableArgument.java │ │ │ ├── GherkinMessagesDocStringArgument.java │ │ │ ├── GherkinMessagesExample.java │ │ │ ├── GherkinMessagesExamples.java │ │ │ ├── GherkinMessagesFeature.java │ │ │ ├── GherkinMessagesFeatureParser.java │ │ │ ├── GherkinMessagesLocation.java │ │ │ ├── GherkinMessagesPickle.java │ │ │ ├── GherkinMessagesRule.java │ │ │ ├── GherkinMessagesScenario.java │ │ │ ├── GherkinMessagesScenarioOutline.java │ │ │ └── GherkinMessagesStep.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.gherkin.FeatureParser │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── core │ │ └── gherkin │ │ └── messages │ │ └── FeatureParserTest.java │ └── resources │ ├── META-INF │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ └── io │ └── cucumber │ └── core │ └── gherkin │ └── messages │ ├── background.feature │ ├── doc-string.feature │ ├── empty-table.feature │ ├── empty.feature │ ├── lexer-error.feature │ ├── no-pickles.feature │ └── unnamed.feature ├── cucumber-gherkin ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── core │ │ └── gherkin │ │ ├── Argument.java │ │ ├── DataTableArgument.java │ │ ├── DocStringArgument.java │ │ ├── Feature.java │ │ ├── FeatureParser.java │ │ ├── FeatureParserException.java │ │ ├── Pickle.java │ │ ├── Step.java │ │ └── StepType.java │ └── test │ └── java │ └── io │ └── cucumber │ └── core │ └── gherkin │ └── FeatureParserTest.java ├── cucumber-guice ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── guice │ │ │ ├── CucumberModules.java │ │ │ ├── CucumberScopes.java │ │ │ ├── GuiceBackend.java │ │ │ ├── GuiceBackendProviderService.java │ │ │ ├── GuiceFactory.java │ │ │ ├── InjectorSource.java │ │ │ ├── InjectorSourceFactory.java │ │ │ ├── InjectorSourceInstantiationFailed.java │ │ │ ├── ScenarioModule.java │ │ │ ├── ScenarioScope.java │ │ │ ├── ScenarioScoped.java │ │ │ ├── SequentialScenarioScope.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ ├── io.cucumber.core.backend.BackendProviderService │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── guice │ │ ├── GuiceBackendTest.java │ │ ├── GuiceFactoryTest.java │ │ ├── InjectorSourceFactoryTest.java │ │ ├── collection │ │ ├── CollectionUtil.java │ │ └── CollectionUtilTest.java │ │ ├── factory │ │ └── SecondInjectorSource.java │ │ ├── impl │ │ └── LivesInChildClassLoader.java.txt │ │ ├── integration │ │ ├── HelloWorldSteps.java │ │ ├── RunCucumberTest.java │ │ ├── ScenarioScopedObject.java │ │ ├── ScenarioScopedSteps.java │ │ ├── SingletonObject.java │ │ ├── SingletonScopedSteps.java │ │ ├── UnScopedObject.java │ │ ├── UnScopedSteps.java │ │ ├── YourInjectorSource.java │ │ └── YourModule.java │ │ └── matcher │ │ ├── AbstractMatcherTest.java │ │ ├── ElementsAreAllEqualMatcher.java │ │ ├── ElementsAreAllEqualMatcherTest.java │ │ ├── ElementsAreAllMatcher.java │ │ ├── ElementsAreAllUniqueMatcher.java │ │ └── ElementsAreAllUniqueMatcherTest.java │ └── resources │ ├── io │ └── cucumber │ │ └── guice │ │ └── integration │ │ ├── guice-no-scope.feature │ │ ├── guice-scenario-scope.feature │ │ ├── guice-singleton-scope.feature │ │ └── hello.feature │ └── junit-platform.properties ├── cucumber-jakarta-cdi ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── jakarta │ │ │ └── cdi │ │ │ └── CdiJakartaFactory.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── jakarta │ │ └── cdi │ │ ├── CdiJakartaFactoryTest.java │ │ ├── IgnoreLocalBeansXmlClassLoader.java │ │ └── example │ │ ├── Belly.java │ │ ├── BellyStepDefinitions.java │ │ └── RunCucumberTest.java │ └── resources │ ├── META-INF │ ├── beans.xml │ └── openwebbeans.properties │ ├── io │ └── cucumber │ │ └── jakarta │ │ └── cdi │ │ └── example │ │ └── cukes.feature │ └── junit-platform.properties ├── cucumber-jakarta-openejb ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── jakarta │ │ │ └── openejb │ │ │ ├── OpenEJBObjectFactory.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── jakarta │ │ └── openejb │ │ ├── Belly.java │ │ ├── BellyStepDefinitions.java │ │ ├── OpenEJBObjectFactoryTest.java │ │ └── RunCucumberTest.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── io │ └── cucumber │ │ └── jakarta │ │ └── openejb │ │ └── cukes.feature │ └── junit-platform.properties ├── cucumber-java ├── README.md ├── pom.xml └── src │ ├── codegen │ ├── java │ │ └── GenerateI18n.java │ └── resources │ │ └── templates │ │ ├── annotation.java.ftl │ │ └── package-info.ftl │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── java │ │ │ ├── AbstractDatatableElementTransformerDefinition.java │ │ │ ├── AbstractGlueDefinition.java │ │ │ ├── AbstractJavaSnippet.java │ │ │ ├── After.java │ │ │ ├── AfterAll.java │ │ │ ├── AfterStep.java │ │ │ ├── Before.java │ │ │ ├── BeforeAll.java │ │ │ ├── BeforeStep.java │ │ │ ├── DataTableType.java │ │ │ ├── DefaultDataTableCellTransformer.java │ │ │ ├── DefaultDataTableEntryTransformer.java │ │ │ ├── DefaultParameterTransformer.java │ │ │ ├── DocStringType.java │ │ │ ├── GlueAdaptor.java │ │ │ ├── InvalidMethodException.java │ │ │ ├── InvalidMethodSignatureException.java │ │ │ ├── Invoker.java │ │ │ ├── JavaBackend.java │ │ │ ├── JavaBackendProviderService.java │ │ │ ├── JavaDataTableTypeDefinition.java │ │ │ ├── JavaDefaultDataTableCellTransformerDefinition.java │ │ │ ├── JavaDefaultDataTableEntryTransformerDefinition.java │ │ │ ├── JavaDefaultParameterTransformerDefinition.java │ │ │ ├── JavaDocStringTypeDefinition.java │ │ │ ├── JavaHookDefinition.java │ │ │ ├── JavaParameterInfo.java │ │ │ ├── JavaParameterTypeDefinition.java │ │ │ ├── JavaSnippet.java │ │ │ ├── JavaStaticHookDefinition.java │ │ │ ├── JavaStepDefinition.java │ │ │ ├── MethodFormat.java │ │ │ ├── MethodScanner.java │ │ │ ├── ParameterType.java │ │ │ ├── PendingException.java │ │ │ ├── Scenario.java │ │ │ ├── Status.java │ │ │ ├── StepDefinitionAnnotation.java │ │ │ ├── StepDefinitionAnnotations.java │ │ │ └── Transpose.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── java │ │ ├── AbstractGlueDefinitionTest.java │ │ ├── GlueAdaptorTest.java │ │ ├── JavaBackendTest.java │ │ ├── JavaDataTableTypeDefinitionTest.java │ │ ├── JavaDefaultDataTableCellTransformerDefinitionTest.java │ │ ├── JavaDefaultDataTableEntryTransformerDefinitionTest.java │ │ ├── JavaDefaultParameterTransformerDefinitionTest.java │ │ ├── JavaDocStringTypeDefinitionTest.java │ │ ├── JavaHookDefinitionTest.java │ │ ├── JavaParameterTypeDefinitionTest.java │ │ ├── JavaSnippetTest.java │ │ ├── JavaStaticHookDefinitionTest.java │ │ ├── JavaStepDefinitionTest.java │ │ ├── JavaStepDefinitionTransposeTest.java │ │ ├── MethodFormatTest.java │ │ ├── MethodScannerTest.java │ │ ├── SingletonFactory.java │ │ ├── TestFeatureParser.java │ │ ├── annotation │ │ ├── DataTableSteps.java │ │ ├── FrenchSteps.java │ │ ├── ParameterTypeSteps.java │ │ ├── RunCucumberTest.java │ │ ├── ScenarioSteps.java │ │ ├── Steps.java │ │ └── SubstitutionSteps.java │ │ ├── defaultstransformer │ │ ├── DataTableSteps.java │ │ └── RunCucumberTest.java │ │ ├── incorrectlysubclassedsteps │ │ └── SubclassesSteps.java │ │ ├── repeatable │ │ └── Steps.java │ │ └── steps │ │ └── Steps.java │ └── resources │ ├── io │ └── cucumber │ │ └── java │ │ ├── annotation │ │ ├── cukes.feature │ │ ├── data-table.feature │ │ ├── french-iso-8859-1-cukes.feature │ │ ├── french-numbers.feature │ │ ├── parameter-types.feature │ │ ├── scenario.feature │ │ └── scenario_outline_substitution.feature │ │ └── defaultstransformer │ │ └── default-transformer.feature │ └── junit-platform.properties ├── cucumber-java8 ├── README.md ├── pom.xml └── src │ ├── codegen │ ├── java │ │ └── GenerateI18n.java │ └── resources │ │ └── templates │ │ └── lambda.java.ftl │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── java8 │ │ │ ├── AbstractDatatableElementTransformerDefinition.java │ │ │ ├── AbstractGlueDefinition.java │ │ │ ├── AbstractJavaSnippet.java │ │ │ ├── ClosureAwareGlueRegistry.java │ │ │ ├── DataTableCellDefinitionBody.java │ │ │ ├── DataTableDefinitionBody.java │ │ │ ├── DataTableEntryDefinitionBody.java │ │ │ ├── DataTableRowDefinitionBody.java │ │ │ ├── DefaultDataTableCellTransformerBody.java │ │ │ ├── DefaultDataTableEntryTransformerBody.java │ │ │ ├── DefaultParameterTransformerBody.java │ │ │ ├── DocStringDefinitionBody.java │ │ │ ├── HookBody.java │ │ │ ├── HookNoArgsBody.java │ │ │ ├── Invoker.java │ │ │ ├── Java8Backend.java │ │ │ ├── Java8BackendProviderService.java │ │ │ ├── Java8DataTableCellDefinition.java │ │ │ ├── Java8DataTableDefinition.java │ │ │ ├── Java8DataTableEntryDefinition.java │ │ │ ├── Java8DataTableRowDefinition.java │ │ │ ├── Java8DataTableTypeDefinition.java │ │ │ ├── Java8DefaultDataTableCellTransformerDefinition.java │ │ │ ├── Java8DefaultDataTableEntryTransformerDefinition.java │ │ │ ├── Java8DefaultParameterTransformerDefinition.java │ │ │ ├── Java8DocStringTypeDefinition.java │ │ │ ├── Java8HookDefinition.java │ │ │ ├── Java8ParameterInfo.java │ │ │ ├── Java8ParameterTypeDefinition.java │ │ │ ├── Java8Snippet.java │ │ │ ├── Java8StepDefinition.java │ │ │ ├── LambdaGlue.java │ │ │ ├── LambdaGlueRegistry.java │ │ │ ├── LambdaTypeResolver.java │ │ │ ├── ParameterDefinitionBody.java │ │ │ ├── PendingException.java │ │ │ ├── Scenario.java │ │ │ ├── Status.java │ │ │ └── StepDefinitionBody.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── java8 │ │ ├── AnonInnerClassStepDefinitions.java │ │ ├── ClosureAwareGlueRegistryTest.java │ │ ├── Java8AnonInnerClassStepDefinitionTest.java │ │ ├── Java8BackendTest.java │ │ ├── Java8LambdaStepDefinitionMarksCorrectStackElementTest.java │ │ ├── Java8LambdaStepDefinitionTest.java │ │ ├── Java8SnippetTest.java │ │ ├── LambdaGlueTest.java │ │ ├── LambdaStepDefinitions.java │ │ ├── RunCucumberTest.java │ │ ├── SingletonFactory.java │ │ ├── TestFeatureParser.java │ │ ├── TypeDefinitionsStepDefinitions.java │ │ └── steps │ │ └── Steps.java │ └── resources │ ├── io │ └── cucumber │ │ └── java8 │ │ ├── anon-inner-class-step-definitions.feature │ │ ├── lambda-step-definitions.feature │ │ └── lambda-type-definitions.feature │ └── junit-platform.properties ├── cucumber-junit-platform-engine ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── junit │ │ │ └── platform │ │ │ └── engine │ │ │ ├── CachingFeatureParser.java │ │ │ ├── Constants.java │ │ │ ├── Cucumber.java │ │ │ ├── CucumberEngineDescriptor.java │ │ │ ├── CucumberEngineExecutionContext.java │ │ │ ├── CucumberEngineOptions.java │ │ │ ├── CucumberTestEngine.java │ │ │ ├── DefaultNamingStrategyProvider.java │ │ │ ├── DiscoverySelectorResolver.java │ │ │ ├── FeatureDescriptor.java │ │ │ ├── FeatureOrigin.java │ │ │ ├── FeatureResolver.java │ │ │ ├── NamingStrategy.java │ │ │ ├── NodeDescriptor.java │ │ │ ├── TestCaseResultObserver.java │ │ │ ├── TestDescriptorOnLine.java │ │ │ └── UndefinedStepException.java │ ├── java9 │ │ └── module-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── org.junit.platform.engine.TestEngine │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── junit │ │ └── platform │ │ └── engine │ │ ├── CucumberEngineOptionsTest.java │ │ ├── CucumberTestEngineTest.java │ │ ├── DiscoverySelectorResolverTest.java │ │ ├── EmptyConfigurationParameters.java │ │ ├── EmptyEngineDiscoveryRequest.java │ │ ├── EmptyEngineExecutionListener.java │ │ ├── FeatureResolverTest.java │ │ ├── MapConfigurationParameters.java │ │ ├── RunCucumberTest.java │ │ ├── StubBackendProviderService.java │ │ ├── TestCaseResultObserverTest.java │ │ ├── UndefinedStepExceptionTest.java │ │ ├── WithLogRecordListener.java │ │ └── nofeatures │ │ └── NoFeatures.java │ └── resources │ ├── META-INF │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ ├── feature.jar │ ├── io │ └── cucumber │ │ └── junit │ │ └── platform │ │ └── engine │ │ ├── disabled.feature │ │ ├── empty-feature.feature │ │ ├── empty-scenario.feature │ │ ├── feature-with-outline.feature │ │ ├── rule.feature │ │ ├── single.feature │ │ └── with space.feature │ ├── junit-platform.properties │ └── root.feature ├── cucumber-junit ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── junit │ │ ├── Assertions.java │ │ ├── Cucumber.java │ │ ├── CucumberOptions.java │ │ ├── FeatureRunner.java │ │ ├── FileNameCompatibleNames.java │ │ ├── JUnitCucumberOptionsProvider.java │ │ ├── JUnitOptions.java │ │ ├── JUnitOptionsBuilder.java │ │ ├── JUnitOptionsParser.java │ │ ├── JUnitReporter.java │ │ ├── NoObjectFactory.java │ │ ├── NoUuidGenerator.java │ │ ├── PickleRunners.java │ │ ├── SkippedThrowable.java │ │ └── UndefinedStepException.java │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── junit │ │ ├── AssertionsTest.java │ │ ├── CucumberTest.java │ │ ├── DescriptionMatcher.java │ │ ├── FailureMatcher.java │ │ ├── FeatureRunnerTest.java │ │ ├── InvokeMethodsAroundEventsTest.java │ │ ├── JUnitCucumberOptionsProviderTest.java │ │ ├── JUnitReporterWithStepNotificationsTest.java │ │ ├── PickleRunnerWithNoStepDescriptionsTest.java │ │ ├── PickleRunnerWithStepDescriptionsTest.java │ │ ├── RunCucumberTest.java │ │ ├── RunCucumberTestWithStepNotifications.java │ │ ├── SanityChecker.java │ │ ├── SanityTest.java │ │ ├── StubBackendProviderService.java │ │ ├── TestFeatureParser.java │ │ ├── TestPendingException.java │ │ ├── TestPickleBuilder.java │ │ └── UndefinedStepExceptionTest.java │ └── resources │ ├── META-INF │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ ├── cucumber.properties │ └── io │ └── cucumber │ ├── error │ └── lexer_error.feature │ └── junit │ ├── empty-feature.feature │ ├── empty-scenario.feature │ ├── fa.feature │ ├── fb.feature │ ├── feature-with-outline.feature │ ├── rule.feature │ ├── single-duplicate.feature │ └── single.feature ├── cucumber-kotlin-java8 ├── README.md ├── pom.xml └── src │ └── test │ ├── kotlin │ └── io │ │ └── cucumber │ │ └── kotlin │ │ ├── LambdaStepDefinitions.kt │ │ └── RunCucumberTest.kt │ └── resources │ ├── io │ └── cucumber │ │ └── kotlin │ │ └── kotlin.feature │ └── junit-platform.properties ├── cucumber-openejb ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── openejb │ │ │ ├── OpenEJBObjectFactory.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── openejb │ │ ├── Belly.java │ │ ├── BellyStepDefinitions.java │ │ ├── OpenEJBObjectFactoryTest.java │ │ └── RunCucumberTest.java │ └── resources │ ├── META-INF │ └── beans.xml │ ├── io │ └── cucumber │ │ └── openejb │ │ └── cukes.feature │ └── junit-platform.properties ├── cucumber-picocontainer ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── picocontainer │ │ │ ├── PicoFactory.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── picocontainer │ │ ├── DisposableCucumberBelly.java │ │ ├── PicoFactoryTest.java │ │ ├── RunCucumberTest.java │ │ ├── SanityChecker.java │ │ ├── SanityTest.java │ │ ├── SomeTest.java │ │ ├── StepDefinitions.java │ │ └── StepDefinitionsWithTransitiveDependencies.java │ └── resources │ ├── cucumber.properties │ └── io │ └── cucumber │ └── picocontainer │ ├── cukes.feature │ └── issue-225.feature ├── cucumber-plugin ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── plugin │ │ ├── ColorAware.java │ │ ├── ConcurrentEventListener.java │ │ ├── EventListener.java │ │ ├── Plugin.java │ │ ├── StrictAware.java │ │ ├── SummaryPrinter.java │ │ └── event │ │ ├── Argument.java │ │ ├── DataTableArgument.java │ │ ├── DocStringArgument.java │ │ ├── EmbedEvent.java │ │ ├── Event.java │ │ ├── EventHandler.java │ │ ├── EventPublisher.java │ │ ├── Group.java │ │ ├── HookTestStep.java │ │ ├── HookType.java │ │ ├── Location.java │ │ ├── Node.java │ │ ├── PickleStepTestStep.java │ │ ├── Result.java │ │ ├── SnippetsSuggestedEvent.java │ │ ├── Status.java │ │ ├── Step.java │ │ ├── StepArgument.java │ │ ├── StepDefinedEvent.java │ │ ├── StepDefinition.java │ │ ├── TestCase.java │ │ ├── TestCaseEvent.java │ │ ├── TestCaseFinished.java │ │ ├── TestCaseStarted.java │ │ ├── TestRunFinished.java │ │ ├── TestRunStarted.java │ │ ├── TestSourceParsed.java │ │ ├── TestSourceRead.java │ │ ├── TestStep.java │ │ ├── TestStepFinished.java │ │ ├── TestStepStarted.java │ │ ├── TimeStampedEvent.java │ │ └── WriteEvent.java │ └── test │ └── java │ └── io │ └── cucumber │ └── plugin │ └── event │ └── NodeTest.java ├── cucumber-spring ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── spring │ │ │ ├── CucumberContextConfiguration.java │ │ │ ├── CucumberScenarioScope.java │ │ │ ├── CucumberTestContext.java │ │ │ ├── ScenarioScope.java │ │ │ ├── SpringBackend.java │ │ │ ├── SpringBackendProviderService.java │ │ │ ├── SpringFactory.java │ │ │ ├── TestContextAdaptor.java │ │ │ └── package-info.java │ └── resources │ │ └── META-INF │ │ └── services │ │ ├── io.cucumber.core.backend.BackendProviderService │ │ └── io.cucumber.core.backend.ObjectFactory │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── spring │ │ ├── Issue1970Test.java │ │ ├── SpringBackendTest.java │ │ ├── SpringFactoryTest.java │ │ ├── TestTestContextAdaptorTest.java │ │ ├── annotationconfig │ │ ├── AnnotationContextConfiguration.java │ │ ├── AnnotationContextConfigurationDefinitions.java │ │ └── RunCucumberTest.java │ │ ├── beans │ │ ├── Belly.java │ │ ├── BellyBean.java │ │ ├── DummyComponent.java │ │ ├── GlueScopedComponent.java │ │ └── TestController.java │ │ ├── commonglue │ │ ├── AnotherStepDef.java │ │ ├── AutowiresThirdStepDef.java │ │ ├── OneStepDef.java │ │ └── ThirdStepDef.java │ │ ├── componentannotation │ │ ├── WithComponentAnnotation.java │ │ └── WithControllerAnnotation.java │ │ ├── contextcaching │ │ ├── ContextCachingSteps.java │ │ ├── ContextConfig.java │ │ ├── ContextCounter.java │ │ ├── RunCucumberTest.java │ │ └── SharedContextTest.java │ │ ├── contextconfig │ │ ├── BellyStepDefinitions.java │ │ └── RunCucumberTest.java │ │ ├── contexthierarchyconfig │ │ └── WithContextHierarchyAnnotation.java │ │ ├── cucumbercontextconfigannotation │ │ ├── AbstractWithComponentAnnotation.java │ │ ├── AnnotatedInterface.java │ │ ├── WithInheritedAnnotation.java │ │ └── WithMetaAnnotation.java │ │ ├── dirtiescontextconfig │ │ ├── DirtiesContextBellyStepDefinitions.java │ │ └── RunCucumberTest.java │ │ ├── metaconfig │ │ ├── dirties │ │ │ ├── DirtiesContextBellyMetaStepDefinitions.java │ │ │ ├── DirtiesMetaConfiguration.java │ │ │ └── RunCucumberTest.java │ │ └── general │ │ │ ├── BellyMetaStepDefinitions.java │ │ │ ├── MetaConfiguration.java │ │ │ └── RunCucumberTest.java │ │ └── threading │ │ ├── RunParallelCucumberTest.java │ │ └── ThreadingStepDefinitions.java │ └── resources │ ├── applicationContext.xml │ ├── cucumber.properties │ ├── cucumber.xml │ ├── cucumber2.xml │ ├── io │ └── cucumber │ │ └── spring │ │ ├── annotationContextConfiguration.feature │ │ ├── contextCaching.feature │ │ ├── dirtyCukes.feature │ │ ├── dirtyCukesWithMetaConfiguration.feature │ │ ├── springBeanInjection.feature │ │ ├── springBeanInjectionWithMetaConfiguration.feature │ │ ├── stepdefInjection.feature │ │ └── threadingCukes.feature │ ├── junit-platform.properties │ └── logback-test.xml ├── cucumber-testng ├── .gitignore ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── testng │ │ ├── AbstractTestNGCucumberTests.java │ │ ├── CucumberExceptionWrapper.java │ │ ├── CucumberOptions.java │ │ ├── CucumberPropertiesProvider.java │ │ ├── FeatureWrapper.java │ │ ├── FeatureWrapperImpl.java │ │ ├── NoObjectFactory.java │ │ ├── NoUuidGenerator.java │ │ ├── Pickle.java │ │ ├── PickleWrapper.java │ │ ├── PickleWrapperImpl.java │ │ ├── TestCaseResultObserver.java │ │ ├── TestNGCucumberOptionsProvider.java │ │ ├── TestNGCucumberRunner.java │ │ └── UndefinedStepException.java │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── testng │ │ ├── AbstractTestNGCucumberTestsTest.java │ │ ├── RunCucumberTest.java │ │ ├── RunFeatureWithThreeScenariosTest.java │ │ ├── ScenariosInDifferentGroupsTest.java │ │ ├── StubBackendProviderService.java │ │ ├── TestCaseResultObserverTest.java │ │ ├── TestNGCucumberOptionsProviderTest.java │ │ ├── TestNGCucumberRunnerTest.java │ │ ├── TestPendingException.java │ │ └── UndefinedStepExceptionTest.java │ └── resources │ ├── META-INF │ └── services │ │ └── io.cucumber.core.backend.BackendProviderService │ ├── cucumber.properties │ └── io │ └── cucumber │ ├── error │ └── parse-error.feature │ ├── testng │ ├── empty-feature.feature │ ├── empty-scenario.feature │ ├── fa.feature │ ├── fb.feature │ ├── feature-with-outline.feature │ ├── feature-with-same-steps-in-different-scenarios.feature │ ├── scenarios-with-tags.feature │ └── three-scenarios.feature │ └── undefined │ └── undefined_steps.feature ├── datatable-matchers ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── datatable │ │ └── matchers │ │ └── DataTableHasTheSameRowsAs.java │ └── test │ └── java │ └── io │ └── cucumber │ └── datatable │ └── matchers │ └── DataTableHasTheSameRowsAsTest.java ├── datatable ├── CHANGELOG.md ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── datatable │ │ ├── ConversionRequired.java │ │ ├── CucumberDataTableException.java │ │ ├── DataTable.java │ │ ├── DataTableCellByTypeTransformer.java │ │ ├── DataTableDiff.java │ │ ├── DataTableFormatter.java │ │ ├── DataTableType.java │ │ ├── DataTableTypeRegistry.java │ │ ├── DataTableTypeRegistryTableConverter.java │ │ ├── DiffType.java │ │ ├── DiffableRow.java │ │ ├── DuplicateTypeException.java │ │ ├── InvalidDataTableTypeException.java │ │ ├── NumberParser.java │ │ ├── TableCellByTypeTransformer.java │ │ ├── TableCellTransformer.java │ │ ├── TableDiffException.java │ │ ├── TableDiffer.java │ │ ├── TableEntryByTypeTransformer.java │ │ ├── TableEntryTransformer.java │ │ ├── TableRowTransformer.java │ │ ├── TableTransformer.java │ │ ├── TypeFactory.java │ │ ├── TypeReference.java │ │ └── UndefinedDataTableTypeException.java │ └── test │ └── java │ └── io │ └── cucumber │ └── datatable │ ├── DataTableFormatterTest.java │ ├── DataTableTest.java │ ├── DataTableTypeRegistryTableConverterTest.java │ ├── DataTableTypeRegistryTest.java │ ├── DataTableTypeTest.java │ ├── NoConverterDefinedTest.java │ ├── NumberParserTest.java │ ├── Place.java │ ├── TableDifferTest.java │ ├── TableParser.java │ └── TypeFactoryTest.java ├── docstring ├── pom.xml └── src │ ├── main │ └── java │ │ └── io │ │ └── cucumber │ │ └── docstring │ │ ├── ConversionRequired.java │ │ ├── CucumberDocStringException.java │ │ ├── DocString.java │ │ ├── DocStringFormatter.java │ │ ├── DocStringType.java │ │ ├── DocStringTypeRegistry.java │ │ └── DocStringTypeRegistryDocStringConverter.java │ └── test │ └── java │ └── io │ └── cucumber │ └── docstring │ ├── DocStringFormatterTest.java │ ├── DocStringTest.java │ ├── DocStringTypeRegistryDocStringConverterTest.java │ └── DocStringTypeRegistryTest.java ├── examples ├── README.md ├── calculator-java-cli │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateCalculator.java │ │ │ └── RpnCalculator.java │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateStepDefinitions.java │ │ │ ├── ParameterTypes.java │ │ │ ├── RpnCalculatorStepDefinitions.java │ │ │ └── ShoppingStepDefinitions.java │ │ └── resources │ │ ├── cucumber.properties │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ ├── basic_arithmetic.feature │ │ ├── date_calculator.feature │ │ └── shopping.feature ├── calculator-java-junit4 │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateCalculator.java │ │ │ └── RpnCalculator.java │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateStepDefinitions.java │ │ │ ├── ParameterTypes.java │ │ │ ├── RpnCalculatorStepDefinitions.java │ │ │ ├── RunCucumberTest.java │ │ │ └── ShoppingStepDefinitions.java │ │ └── resources │ │ ├── cucumber.properties │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ ├── basic_arithmetic.feature │ │ ├── date_calculator.feature │ │ └── shopping.feature ├── calculator-java-junit5 │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateCalculator.java │ │ │ └── RpnCalculator.java │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateStepDefinitions.java │ │ │ ├── Example.java │ │ │ ├── ParameterTypes.java │ │ │ ├── RpnCalculatorSteps.java │ │ │ ├── RunCucumberTest.java │ │ │ └── ShoppingSteps.java │ │ └── resources │ │ ├── io │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── basic_arithmetic.feature │ │ │ ├── date_calculator.feature │ │ │ └── shopping.feature │ │ └── junit-platform.properties ├── calculator-java-testng │ ├── .gitignore │ ├── README.md │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateCalculator.java │ │ │ └── RpnCalculator.java │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateStepDefinitions.java │ │ │ ├── RpnCalculatorStepDefinitions.java │ │ │ ├── RunCucumberByCompositionBase.java │ │ │ ├── RunCucumberByCompositionTest.java │ │ │ ├── RunCucumberTest.java │ │ │ └── ShoppingStepDefinitions.java │ │ └── resources │ │ ├── cucumber.properties │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ ├── basic_arithmetic.feature │ │ ├── date_calculator.feature │ │ └── shopping.feature ├── calculator-java8-cli │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ └── RpnCalculator.java │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── RpnCalculatorSteps.java │ │ │ └── ShoppingSteps.java │ │ └── resources │ │ ├── cucumber.properties │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ ├── basic_arithmetic.feature │ │ └── shopping.feature ├── calculator-kotlin-junit5 │ ├── .gitignore │ ├── pom.xml │ └── src │ │ ├── main │ │ └── kotlin │ │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calaculator │ │ │ ├── DateCalculator.kt │ │ │ └── RpnCalculator.kt │ │ └── test │ │ ├── kotlin │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── calculator │ │ │ ├── DateStepDefinitions.kt │ │ │ ├── RunCucumberKotlinTest.kt │ │ │ └── ShoppingStepDefinitions.kt │ │ └── resources │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── calculator │ │ ├── date_calculator.feature │ │ └── shopping.feature ├── pom.xml ├── spring-java-junit5 │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── cucumber │ │ │ │ └── examples │ │ │ │ └── spring │ │ │ │ └── application │ │ │ │ ├── Application.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageRepository.java │ │ │ │ ├── User.java │ │ │ │ ├── UserController.java │ │ │ │ └── UserRepository.java │ │ └── resources │ │ │ ├── application.yml │ │ │ ├── logback.xml │ │ │ └── templates │ │ │ └── user.html │ │ └── test │ │ ├── java │ │ └── io │ │ │ └── cucumber │ │ │ └── examples │ │ │ └── spring │ │ │ └── application │ │ │ ├── CucumberTestContextConfiguration.java │ │ │ ├── MessageStepDefinitions.java │ │ │ ├── ParameterTypes.java │ │ │ ├── RunCucumberTest.java │ │ │ ├── SeeMessagesStepDefinitions.java │ │ │ ├── SpringTransactionHooks.java │ │ │ └── UserStepDefinitions.java │ │ └── resources │ │ ├── io │ │ └── cucumber │ │ │ └── examples │ │ │ └── spring │ │ │ └── application │ │ │ ├── search-messages.feature │ │ │ └── see-messages.feature │ │ └── junit-platform.properties └── wicket-java-junit4 │ ├── README.md │ ├── pom.xml │ ├── wicket-main │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── io │ │ │ │ └── cucumber │ │ │ │ └── examples │ │ │ │ └── wicket │ │ │ │ └── main │ │ │ │ ├── Application.java │ │ │ │ ├── model │ │ │ │ ├── dao │ │ │ │ │ ├── CarDAO.java │ │ │ │ │ └── InMemoryCarDAO.java │ │ │ │ └── entity │ │ │ │ │ └── Car.java │ │ │ │ └── view │ │ │ │ ├── Available.java │ │ │ │ ├── Create.java │ │ │ │ └── Rent.java │ │ ├── resources │ │ │ ├── io │ │ │ │ └── cucumber │ │ │ │ │ └── examples │ │ │ │ │ └── wicket │ │ │ │ │ └── main │ │ │ │ │ └── view │ │ │ │ │ ├── Available.html │ │ │ │ │ ├── Create.html │ │ │ │ │ └── Rent.html │ │ │ └── logback.xml │ │ └── webapp │ │ │ └── WEB-INF │ │ │ └── web.xml │ │ └── test │ │ └── java │ │ └── io │ │ └── cucumber │ │ └── examples │ │ └── wicket │ │ └── main │ │ └── RentCarTest.java │ └── wicket-test │ ├── pom.xml │ └── src │ └── test │ ├── java │ └── io │ │ └── cucumber │ │ └── examples │ │ └── wicket │ │ └── test │ │ ├── RunCucumberIT.java │ │ └── steps │ │ ├── RentACarSupport.java │ │ └── RentStepDefinitions.java │ └── resources │ ├── cucumber.properties │ ├── io │ └── cucumber │ │ └── examples │ │ └── wicket │ │ └── main │ │ └── Rent.feature │ └── logback-test.xml ├── mvnw ├── mvnw.cmd ├── pom.xml └── release-notes ├── v1-CHANGELOG.md ├── v1.2.5.md ├── v2-CHANGELOG.md ├── v2.0.0.md ├── v2.0.1.md ├── v2.1.0.md ├── v2.2.0.md ├── v2.3.0.md ├── v3-CHANGELOG.md ├── v3.0.0.md ├── v4-CHANGELOG.md ├── v4.0.0.md ├── v4.2.0.md ├── v5-CHANGELOG.md ├── v5.0.0.md ├── v5.1.0-v5.7.0.md ├── v6-CHANGELOG.md ├── v6.0.0.md ├── v6.5.0.md └── v7.0.0.md /.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 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | open_collective: cucumber 2 | github: cucumber 3 | -------------------------------------------------------------------------------- /.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 | "matchPackagePatterns": ["io.cucumber:(messages|gherkin|html-formatter|junit-xml-formatter)"], 9 | "groupName": "Messages and dependants" 10 | }, 11 | { 12 | "matchPackageNames": ["org.apache.maven.plugins:maven-surefire-plugin"], 13 | "allowedVersions": "!/^3.5.3$/" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.github/workflows/release-github.yml: -------------------------------------------------------------------------------- 1 | name: Release GitHub 2 | 3 | on: 4 | push: 5 | branches: [release/*] 6 | 7 | jobs: 8 | create-github-release: 9 | name: Create GitHub Release and Git tag 10 | runs-on: ubuntu-latest 11 | environment: Release 12 | permissions: 13 | contents: write 14 | steps: 15 | - uses: actions/checkout@v4 16 | - uses: cucumber/action-create-github-release@v1.1.1 17 | with: 18 | github-token: ${{ secrets.GITHUB_TOKEN }} 19 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | -Dfile.encoding=UTF-8 2 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /RELEASING.md: -------------------------------------------------------------------------------- 1 | See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md). 2 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /compatibility/src/test/java/io/cucumber/compatibility/empty/Empty.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.compatibility.empty; 2 | 3 | public class Empty { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/.gitattributes: -------------------------------------------------------------------------------- 1 | # Ensure that LF line endings are kept on checkout (even on windows). Tests will fail otherwise 2 | *.ndjson text eol=lf 3 | *.feature text eol=lf 4 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | *.ts 3 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/README.md: -------------------------------------------------------------------------------- 1 | # Acceptance test data 2 | 3 | The compatibility kit uses the examples from the [cucumber compatibility kit](https://github.com/cucumber/compatibility-kit) 4 | for acceptance testing. These examples consist of `.feature` and `.ndjson` files created by 5 | the [`fake-cucumber` reference implementation](https://github.com/cucumber/fake-cucumber). 6 | 7 | * The files are copied in by running `npm install`. 8 | 9 | * We ensure the `.ndjson` files stay up to date by running `npm install` in CI 10 | and verifying nothing changed. 11 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/attachments/cucumber.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/compatibility/src/test/resources/features/attachments/cucumber.jpeg -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/attachments/cucumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/compatibility/src/test/resources/features/attachments/cucumber.png -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/attachments/document.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/compatibility/src/test/resources/features/attachments/document.pdf -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/cdata/cdata.feature: -------------------------------------------------------------------------------- 1 | Feature: cdata 2 | Cucumber xml formatters should be able to handle xml cdata elements 3 | 4 | Scenario: cdata 5 | Given I have 42 in my belly 6 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/data-tables/data-tables.feature: -------------------------------------------------------------------------------- 1 | Feature: Data Tables 2 | Data Tables can be placed underneath a step and will be passed as the last 3 | argument to the step definition. 4 | 5 | They can be used to represent richer data structures, and can be transformed to other data-types. 6 | 7 | Scenario: transposed table 8 | When the following table is transposed: 9 | | a | b | 10 | | 1 | 2 | 11 | Then it should be: 12 | | a | 1 | 13 | | b | 2 | 14 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/empty/empty.feature: -------------------------------------------------------------------------------- 1 | Feature: Empty Scenarios 2 | Sometimes we want to quickly jot down a new scenario without specifying any actual steps 3 | for what should be executed. 4 | 5 | In this instance we want to stipulate what should / shouldn't run and what the output is 6 | 7 | Scenario: Blank Scenario 8 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/examples-tables-attachment/cucumber.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/compatibility/src/test/resources/features/examples-tables-attachment/cucumber.jpeg -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/examples-tables-attachment/cucumber.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/compatibility/src/test/resources/features/examples-tables-attachment/cucumber.png -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/examples-tables-attachment/examples-tables-attachment.feature: -------------------------------------------------------------------------------- 1 | Feature: Examples Tables - With attachments 2 | It is sometimes useful to take a screenshot while a scenario runs. 3 | Or capture some logs. 4 | 5 | This can also be done in an examples table. 6 | 7 | Scenario Outline: Attaching images in an examples table 8 | When a image is attached 9 | 10 | Examples: 11 | | type | 12 | | JPEG | 13 | | PNG | 14 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/hooks-attachment/.gitattributes: -------------------------------------------------------------------------------- 1 | # SVG files are plain text. So git will change line endings on windows. 2 | # Because we expect the image to have been encoded in base64 with lf rather than 3 | # crlf this is not desirable. 4 | cucumber.svg eol=lf 5 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/hooks-attachment/hooks-attachment.feature: -------------------------------------------------------------------------------- 1 | Feature: Hooks - Attachments 2 | Hooks are special steps that run before or after each scenario's steps. 3 | 4 | Like regular steps, it is possible to attach a file to the output. 5 | 6 | Scenario: With an valid attachment in the hook and a passed step 7 | When a step passes 8 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/hooks-conditional/hooks-conditional.feature: -------------------------------------------------------------------------------- 1 | Feature: Hooks - Conditional execution 2 | Hooks are special steps that run before or after each scenario's steps. 3 | 4 | They can also conditionally target specific scenarios, using tag expressions 5 | 6 | @fail-before 7 | Scenario: A failure in the before hook and a skipped step 8 | When a step passes 9 | 10 | @fail-after 11 | Scenario: A failure in the after hook and a passed step 12 | When a step passes 13 | 14 | @passing-hook 15 | Scenario: With an tag, a passed step and hook 16 | When a step passes 17 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/hooks-named/hooks-named.feature: -------------------------------------------------------------------------------- 1 | Feature: Hooks - Named 2 | Hooks are special steps that run before or after each scenario's steps. 3 | 4 | Hooks can be given a name. Which is nice for reporting. Otherwise they work 5 | exactly the same as regular hooks. 6 | 7 | Scenario: With a named before and after hook 8 | When a step passes 9 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/hooks/hooks.feature: -------------------------------------------------------------------------------- 1 | Feature: Hooks 2 | Hooks are special steps that run before or after each scenario's steps. 3 | 4 | Scenario: No tags and a passed step 5 | When a step passes 6 | 7 | Scenario: No tags and a failed step 8 | When a step fails 9 | 10 | Scenario: No tags and a undefined step 11 | When a step does not exist 12 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/minimal/minimal.feature: -------------------------------------------------------------------------------- 1 | Feature: minimal 2 | 3 | Cucumber doesn't execute this markdown, but @cucumber/react renders it 4 | 5 | * This is 6 | * a bullet 7 | * list 8 | 9 | Scenario: cukes 10 | Given I have 42 cukes in my belly 11 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/parameter-types/parameter-types.feature: -------------------------------------------------------------------------------- 1 | Feature: Parameter Types 2 | Cucumber lets you define your own parameter types, which can be used 3 | in Cucumber Expressions. 4 | 5 | This lets you define a precise domain-specific vocabulary which can be used to 6 | generate a glossary with examples taken from your scenarios. 7 | 8 | Parameter types also enable you to transform strings and tables into different types. 9 | 10 | Scenario: Flight transformer 11 | Given LHR-CDG has been delayed 12 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/retry/retry.arguments.txt: -------------------------------------------------------------------------------- 1 | --retry 2 2 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/stack-traces/stack-traces.feature: -------------------------------------------------------------------------------- 1 | Feature: Stack traces 2 | Stack traces can help you diagnose the source of a bug. 3 | Cucumber provides helpful stack traces that includes the stack frames from the 4 | Gherkin document and remove uninteresting frames by default 5 | 6 | The first line of the stack trace will contain a reference to the feature file. 7 | 8 | Scenario: A failing step 9 | When a step throws an exception 10 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/features/unknown-parameter-type/unknown-parameter-type.feature: -------------------------------------------------------------------------------- 1 | Feature: Parameter Types 2 | Cucumber will generate an error message if a step definition registers 3 | an unknown parameter type, but the suite will run. 4 | 5 | Scenario: undefined parameter type 6 | Given CDG is closed because of a strike 7 | -------------------------------------------------------------------------------- /compatibility/src/test/resources/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-formatter-testdata", 3 | "version": "1.0.0", 4 | "description": "The demo formatter uses some test data for acceptance testing.", 5 | "main": "index.js", 6 | "scripts": { 7 | "postinstall": "shx rm -r features && cp -r node_modules/@cucumber/compatibility-kit/features ." 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "devDependencies": { 12 | "@cucumber/compatibility-kit": "^18.0.2", 13 | "shx": "^0.3.4" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-archetype/src/test/resources/projects/should-generate-project/archetype.pom.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-archetype/src/test/resources/projects/should-generate-project/archetype.pom.properties -------------------------------------------------------------------------------- /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/goal.txt: -------------------------------------------------------------------------------- 1 | clean test verify 2 | -------------------------------------------------------------------------------- /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-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-cdi2/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.cdi2.Cdi2Factory 2 | -------------------------------------------------------------------------------- /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-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-cdi2/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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-cdi2/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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-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-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-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 | -------------------------------------------------------------------------------- /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/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-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/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/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-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 | -------------------------------------------------------------------------------- /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/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/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-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/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-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-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-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/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-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-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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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/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/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-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/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/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-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 | -------------------------------------------------------------------------------- /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-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-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-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-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 | -------------------------------------------------------------------------------- /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/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-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-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-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-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/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-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-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-core/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.core.backend.DefaultObjectFactory 2 | -------------------------------------------------------------------------------- /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/main/resources/io/cucumber/core/plugin/timeline/chosen-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/main/resources/io/cucumber/core/plugin/timeline/chosen-sprite.png -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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/test/java/io/cucumber/core/backend/StubLocation.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.core.backend; 2 | 3 | public class StubLocation implements Located { 4 | 5 | private final String location; 6 | 7 | public StubLocation(String location) { 8 | this.location = location; 9 | } 10 | 11 | @Override 12 | public boolean isDefinedAt(StackTraceElement stackTraceElement) { 13 | return false; 14 | } 15 | 16 | @Override 17 | public String getLocation() { 18 | return location; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /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", "tlh"); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-core/src/test/resource-symlink: -------------------------------------------------------------------------------- 1 | resources/io/cucumber/core/resource -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.core.backend.StubBackendProviderService -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/has spaces.properties: -------------------------------------------------------------------------------- 1 | has=spaces 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/options/runtime-options-empty-rerun.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/options/runtime-options-empty-rerun.txt -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/options/runtime-options-rerun.txt: -------------------------------------------------------------------------------- 1 | this/should/be/rerun.feature:12 2 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/plugin/FormatterInParallel.feature: -------------------------------------------------------------------------------- 1 | Feature: Feature executed in parallel 2 | 3 | Background: 4 | Given bg_1_parallel 5 | When bg_2_parallel 6 | Then bg_3_parallel 7 | 8 | Scenario: Scenario_1 9 | Given step_1_parallel 10 | When step_2_parallel 11 | Then step_3_parallel 12 | Then cliché_parallel 13 | 14 | Scenario Outline: ScenarioOutline_1_parallel 15 | Given so_1 _parallel 16 | When so_2 cucumbers_parallel 17 | Then so_3_parallel 18 | 19 | Examples: 20 | | a | b | c | 21 | | 12 | 5 | 7 | 22 | | 20 | 5 | 15 | 23 | 24 | Scenario: Scenario_2 25 | Given a_parallel 26 | Then b_parallel 27 | When c_parallel 28 | 29 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/plugin/JsonPrettyFormatterTest.feature: -------------------------------------------------------------------------------- 1 | Feature: Feature_3 2 | 3 | Background: 4 | Given bg_1 5 | When bg_2 6 | Then bg_3 7 | 8 | Scenario: Scenario_1 9 | Given step_1 10 | When step_2 11 | Then step_3 12 | Then cliché 13 | 14 | Scenario Outline: ScenarioOutline_1 15 | Given so_1 16 | When so_2 cucumbers 17 | Then so_3 18 | 19 | Examples: 20 | | a | b | c | 21 | | 12 | 5 | 7 | 22 | | 20 | 5 | 15 | 23 | 24 | Scenario: Scenario_2 25 | Given a 26 | Then b 27 | When c 28 | 29 | -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/jar-resource.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/resource/test/jar-resource.jar -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/other-resource.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/resource/test/other-resource.txt -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/resource.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/resource/test/resource.txt -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/spaces in name resource.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/resource/test/spaces in name resource.txt -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/resource/test/spring-resource.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/resource/test/spring-resource.jar -------------------------------------------------------------------------------- /cucumber-core/src/test/resources/io/cucumber/core/runtime/empty.feature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-core/src/test/resources/io/cucumber/core/runtime/empty.feature -------------------------------------------------------------------------------- /cucumber-deltaspike/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.deltaspike.DeltaSpikeObjectFactory -------------------------------------------------------------------------------- /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-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-deltaspike/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | -------------------------------------------------------------------------------- /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-deltaspike/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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-gherkin-messages/src/main/resources/META-INF/services/io.cucumber.core.gherkin.FeatureParser: -------------------------------------------------------------------------------- 1 | io.cucumber.core.gherkin.messages.GherkinMessagesFeatureParser 2 | -------------------------------------------------------------------------------- /cucumber-gherkin-messages/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.core.gherkin.messages.StubBackendProviderService 2 | -------------------------------------------------------------------------------- /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-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-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-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/empty.feature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-gherkin-messages/src/test/resources/io/cucumber/core/gherkin/messages/empty.feature -------------------------------------------------------------------------------- /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-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-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-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-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-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.net.URI; 6 | import java.util.List; 7 | 8 | public interface Feature extends Node.Feature { 9 | 10 | Pickle getPickleAt(Node node); 11 | 12 | List getPickles(); 13 | 14 | URI getUri(); 15 | 16 | String getSource(); 17 | 18 | Iterable getParseEvents(); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /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-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-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-guice/.gitignore: -------------------------------------------------------------------------------- 1 | /.project 2 | /.settings 3 | /.classpath 4 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-guice/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.guice.GuiceBackendProviderService 2 | -------------------------------------------------------------------------------- /cucumber-guice/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.guice.GuiceFactory -------------------------------------------------------------------------------- /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-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 | } -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-guice/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.jakarta.cdi.CdiJakartaFactory 2 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /cucumber-jakarta-cdi/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /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-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-jakarta-cdi/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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-jakarta-openejb/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.jakarta.openejb.OpenEJBObjectFactory 2 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-jakarta-openejb/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /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-jakarta-openejb/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-java/src/codegen/resources/templates/package-info.ftl: -------------------------------------------------------------------------------- 1 | /** 2 | * ${language_name} 3 | */ 4 | package io.cucumber.java.${normalized_language}; 5 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-java/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.java.JavaBackendProviderService -------------------------------------------------------------------------------- /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-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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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-java/src/test/resources/io/cucumber/java/annotation/french-iso-8859-1-cukes.feature: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/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-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-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-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-java/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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/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-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-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-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-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 | -------------------------------------------------------------------------------- /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-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-java8/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.java8.Java8BackendProviderService -------------------------------------------------------------------------------- /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-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-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-java8/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | cucumber.glue=io.cucumber.java8 3 | -------------------------------------------------------------------------------- /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.Example node, Pickle pickle); 11 | } 12 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/main/resources/META-INF/services/org.junit.platform.engine.TestEngine: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.platform.engine.CucumberTestEngine -------------------------------------------------------------------------------- /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-junit-platform-engine/src/test/java/io/cucumber/junit/platform/engine/nofeatures/NoFeatures.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.junit.platform.engine.nofeatures; 2 | 3 | import io.cucumber.junit.platform.engine.Cucumber; 4 | 5 | @Cucumber 6 | public class NoFeatures { 7 | 8 | } 9 | -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.platform.engine.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-junit-platform-engine/src/test/resources/feature.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cucumber/cucumber-jvm/712878d424d7af86bbe421e4b89896a09008c179/cucumber-junit-platform-engine/src/test/resources/feature.jar -------------------------------------------------------------------------------- /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-junit-platform-engine/src/test/resources/io/cucumber/junit/platform/engine/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | -------------------------------------------------------------------------------- /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/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-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 nothing else happens 7 | -------------------------------------------------------------------------------- /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-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-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-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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-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-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-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-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 | -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.junit.StubBackendProviderService -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /cucumber-junit/src/test/resources/io/cucumber/junit/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | 3 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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-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 | -------------------------------------------------------------------------------- /cucumber-kotlin-java8/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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-openejb/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.openejb.OpenEJBObjectFactory -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-openejb/src/test/resources/META-INF/beans.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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-openejb/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.picocontainer.PicoFactory -------------------------------------------------------------------------------- /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-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-picocontainer/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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-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-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/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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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-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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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/main/java/io/cucumber/spring/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Enables dependency injection by Spring 3 | *

10 | 11 | 12 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4.0.0 3 | 4 | io.cucumber 5 | examples 6 | 7.23.1-SNAPSHOT 7 | 8 | wicket-java-junit4 9 | pom 10 | Examples: Wicket 11 | 12 | wicket-main 13 | wicket-test 14 | 15 | 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-main/src/main/resources/io/cucumber/examples/wicket/main/view/Rent.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |
6 | 7 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/wicket-java-junit4/wicket-test/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | --------------------------------------------------------------------------------

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-spring/src/main/resources/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.spring.SpringBackendProviderService 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/main/resources/META-INF/services/io.cucumber.core.backend.ObjectFactory: -------------------------------------------------------------------------------- 1 | io.cucumber.spring.SpringFactory -------------------------------------------------------------------------------- /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/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-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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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-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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/cucumber2.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-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 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/junit-platform.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /cucumber-spring/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /cucumber-testng/.gitignore: -------------------------------------------------------------------------------- 1 | /test-output/ 2 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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-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-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-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 | -------------------------------------------------------------------------------- /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-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-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/META-INF/services/io.cucumber.core.backend.BackendProviderService: -------------------------------------------------------------------------------- 1 | io.cucumber.testng.StubBackendProviderService -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /cucumber-testng/src/test/resources/io/cucumber/testng/empty-feature.feature: -------------------------------------------------------------------------------- 1 | Feature: A feature without any scenarios 2 | 3 | -------------------------------------------------------------------------------- /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-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-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-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-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-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-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 | -------------------------------------------------------------------------------- /datatable/src/main/java/io/cucumber/datatable/DiffType.java: -------------------------------------------------------------------------------- 1 | package io.cucumber.datatable; 2 | 3 | enum DiffType { 4 | NONE, DELETE, INSERT 5 | } 6 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/calculator-java-cli/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /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/calculator-java-cli/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /examples/calculator-java-junit4/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | -------------------------------------------------------------------------------- /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-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/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/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-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/calculator-java-testng/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /test-output/ 5 | -------------------------------------------------------------------------------- /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-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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/calculator-java-testng/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /examples/calculator-java8-cli/src/test/resources/cucumber.properties: -------------------------------------------------------------------------------- 1 | cucumber.publish.quiet=true 2 | -------------------------------------------------------------------------------- /examples/calculator-kotlin-junit5/.gitignore: -------------------------------------------------------------------------------- 1 | /.settings 2 | /.classpath 3 | /.project 4 | /test-output/ 5 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | jpa: 3 | open-in-view: false 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /examples/spring-java-junit5/src/main/resources/templates/user.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |