cucumber / monaco

Configure Monaco editor to use cucumber-language-service
MIT License
16 stars 4 forks source link

Outline scenarios with examples are not working as expected #60

Closed oliverde8 closed 6 months ago

oliverde8 commented 1 year ago

Hello, first of all thank you for this awsome project 💖

👓 What did you see?

I am testing it with outline scenarios with examples. Undefined steps are not showing as undefined steps.

✅ What did you expect to see?

I expected my invalid step to be reported as problem

📦 Which tool/library version are you using?

Reproduced on the Live Demo to remove variables.

🔬 How could we reproduce it?

  1. Visit https://cucumber.github.io/monaco/
  2. Use the feature file below,
@foo
Feature: Hello
  Scenario Outline: Hi
    Given I have <qty> cukes in my belly
    And this is an undefined step

  Examples:
    | day            | answer |
    | Friday         | TGIF   |
    | Sunday         | Nope   |
    | anything else! | Nope   |

image

📚 Any additional context?


This text was originally generated from a template, then edited by hand. You can modify the template here.

kieran-ryan commented 1 year ago

Curious issue @oliverde8! The root cause lies within the Cucumber Language Service: it disables diagnostics for undefined steps if the test is a scenario outline (has an examples table). This is due to the challenges in ensuring clear and reliable behaviour with respect to examples table lookup to consider whether the values match the step definition. This is in comparison to steps without parameters, where we can pass the step text to a validation function in its raw format.

I have captured an issue proposing this as a feature request (cucumber/language-service#149). I would greatly appreciate if you could take a look and provide any feedback.

kieran-ryan commented 6 months ago

@oliverde8, issue resolved - thanks for raising! Welcome further requests and if you observe any edge cases.

image