Skip to content
This repository was archived by the owner on Dec 21, 2024. It is now read-only.

Commit 2b95280

Browse files
authored
Add DuplicateStepDefinitionException to FAQ (#436)
1 parent 9347311 commit 2b95280

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Diff for: content/docs/community/faq.md

+8
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,11 @@ Otherwise, Picocontainer is the most light weight framework you can use.
238238

239239
# Arity Mismatch
240240
An arity mismatch exception{{% text "java,kotlin" %}} `cucumber.runtime.CucumberException: Arity mismatch`{{% /text %}} indicates that the step does not provide the right number of arguments needed for the step definition.
241+
242+
# Duplicate Step Definition
243+
A DuplicateStepDefinitionException indicates that you have defined the same step twice. First of all, Cucumber doesn't
244+
distinguish between [keywords](docs/gherkin/reference/#keywords) used with a particular step when
245+
[matching steps](/docs/cucumber/api/#matching-steps). This means that `Given an order exists` and `Then an order exists`
246+
will both match "an order exists". When providing arguments using Cucumber expressions and/or regular expressions,
247+
multiple steps might match the same expression. Finally, this means that you cannot extend a class which defines step
248+
definitions, as that will lead to duplicates.

0 commit comments

Comments
 (0)