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

Add DuplicateStepDefinitionException to FAQ #436

Merged
merged 1 commit into from
Jan 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions content/docs/community/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ Otherwise, Picocontainer is the most light weight framework you can use.

# Arity Mismatch
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.

# Duplicate Step Definition
A DuplicateStepDefinitionException indicates that you have defined the same step twice. First of all, Cucumber doesn't
distinguish between [keywords](docs/gherkin/reference/#keywords) used with a particular step when
[matching steps](/docs/cucumber/api/#matching-steps). This means that `Given an order exists` and `Then an order exists`
will both match "an order exists". When providing arguments using Cucumber expressions and/or regular expressions,
multiple steps might match the same expression. Finally, this means that you cannot extend a class which defines step
definitions, as that will lead to duplicates.