hhrzc
hhrzc

Reputation: 2050

cucumber.runtime.junit.UndefinedThrowable: The step is undefined

I have one scenario for two different classes.

My Cucumber structure:

Why is everything going well in the first case but not the second?

Upvotes: 2

Views: 4814

Answers (2)

Nilesh Pawar
Nilesh Pawar

Reputation: 26

You have a simple problem in your below step definition function. You got an extra $ sign after second (\\d+).

When("^Accept (\\\d+) (\\\d+)$ (\\\d+)$", (Integer arg1, Integer arg2, Integer arg3) -> {
    });

Upvotes: 1

Denounce'IN
Denounce'IN

Reputation: 105

Your second accept regexp is wrong. You have $ symbol appearing twice in that expression. $ means end of line EOL. Remove the first $ and it should work fine. Looks like a simple copy paste error.

Upvotes: 2

Related Questions