Hi,
I am pretty new to Cucumber-Java development. I have written a Scenario
shown below along with a StepDef.java with matching glue code, however
in my eclipse I see an error "Step does not have a matching glue code"
My BDD:
Scenario: test scenario
Given I have testResource defined
When it contains listener
StepDef.java
@Given("^I have \"([^\"]*)\" defined$")
public void i_have_resource_defined(String searchResourceType) throws Exception {
.......
}
Error message I see in eclipse: Step 'I have testResource defined' does not have a matching glue code
However, when I change the Scenario to Scenario Outline as shown below, the BDD works fine
Scenario Outline: test scenario
Given I have "<resource>" defined
When it contains "<property>"
Examples:
| resource | property |
| testResource | listener |
I am not sure what I am missing here, and why my Scenario is not working and Scenario Outline works.
I am using cucumber v 4.2.6
Java 8
any help/input is greatly appreciated. Thanks!
Maybe drop the quotation marks in your step def? You have them in your scenario outline, but not the scenario. You don't need them at all. I'd get rid of them and write your steps like you have in your regular scenario.
--
Posting rules: https://cucumber.io/support/posting-rules
---
You received this message because you are subscribed to the Google Groups "Cukes" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cukes+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cukes/0c20c006-f2a9-475a-84e8-4675f4ec4ec4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
My BDD:
Scenario: test scenario
Given I have "testResource" defined
When it contains "listener"