vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Cannot detect cucumber steps on internationalized java annotation

Open felipecrp opened this issue 11 months ago • 0 comments

👓 What did you see?

Hi,

I was testing a project written in Java with cucumber in pt-br.

I observed that the plugin can capture the annotation written in English (e.g., @Given). Still, it cannot capture the annotation written in Portuguese (e.g., @Dado).

When I use @Dado (instead of @Given), the plugin captures zero steps. See the following log to understand the problem:

[Info  - 12:57:32 PM] * Found 12 feature file(s) in ["src/test/resources/features/**/*.feature"]
[Info  - 12:57:32 PM] * Found 455 steps in those feature files
[Info  - 12:57:33 PM] * Found 1 glue file(s) in ["src/test/java/**/*.java"]
[Info  - 12:57:33 PM] * Found 0 parameter types in those glue files
[Info  - 12:57:33 PM] * Found 0 step definitions in those glue files
[Info  - 12:57:33 PM] * Built 160 suggestions for auto complete
[Info  - 12:58:07 PM] Unable to generate step definition. Please create one first manually.

Once I change the annotation to English, it will work as expected.

Hence, cucumber can work with both annotations, but the plugin apparently expects only English.

import io.cucumber.java.en.Given;
import io.cucumber.java.pt.Dado;

✅ What did you expect to see?

The plugin should be able to capture step written in other languages

📦 Which tool/library version are you using?

vscode 1.97.1 with cucumber extension 1.10.0 cucumber 6.10.4

🔬 How could we reproduce it?

Create a step using @Dado instead of @Given

📚 Any additional context?

No response

felipecrp avatar Feb 14 '25 16:02 felipecrp