common icon indicating copy to clipboard operation
common copied to clipboard

Missing colons are not reported as invalid syntax

Open thigg opened this issue 4 years ago • 4 comments

Describe the bug If the colon after a scenario is missing, the scenario is simply not run, instead of being reported as invalid To Reproduce Steps to reproduce the behavior:

  1. Create the following feature:
Feature: I am buggy

  Scenario: I put the colon in the end:
    Then I run the test
  1. Run the feature

Expected behavior The scenario is reported as invalid Context & Motivation

It costs a lot of time if this happens, because the misplaced colon is not obvious

Screenshots

Your Environment Cucumber 6.8.1

thigg avatar Feb 08 '21 17:02 thigg

Fair enough.

For now I would recommend using an IDE with syntax highlighting. It should make it more apparent what the problem is:

Feature: I am buggy

  This a general description of the feature to explain what it does and put the scenarios in to context.
  It can be multiple lines long.
  
  Scenario: I put the colon in the end:
    Then I run the test

mpkorstanje avatar Feb 08 '21 19:02 mpkorstanje

This will take a lot of effort to fix, and I don’t think it’s worth the effort. Thoughts?

aslakhellesoy avatar Feb 08 '21 21:02 aslakhellesoy

I'm not sure. With the way the grammar is defined the Scenario keyword line terminates the description. The Step keyword line could be used in the same way and then used to detect this problem.

mpkorstanje avatar Feb 08 '21 21:02 mpkorstanje

Fair enough.

For now I would recommend using an IDE with syntax highlighting. It should make it more apparent what the problem is:

Thats why I opened a second issue at intellij ;)

Intellij was perfectly fine with the colon free version...

thigg avatar Feb 08 '21 23:02 thigg