0

I have a feature file as below:

Feature: Log in to the application

@OnlyOneTime
  Scenario: Login to application as valid user
    When User enter the valid credentials
    And Click on Login
    Then Home Page should be displayed

  Scenario: Login to application as Invalid user
    When User enter the inValid credentials
    And Click on Login
    Then Error Message Should be displayed

But the problem is it is being shown as plain file not at all with the gherkin colors, also I can't see find step option when I right click on a step.

enter image description here

Krishnan Mahadevan
  • 14,121
  • 6
  • 34
  • 66
Kushal Bhalaik
  • 3,349
  • 5
  • 23
  • 46
  • I'm not able to see colors in feature file as they are supposed to for gherkin keywords. – Kushal Bhalaik Sep 16 '17 at 14:34
  • You need to install editor for gherkin language in your eclipse. Go to help->marketplace and type "gherkin" in searchbar. After install you may need to restart eclipse. – Mateusz Marchel Sep 16 '17 at 22:45
  • @MateuszMarchel : I've already installed Cucumber Eclipse Plugin for eclipse – Kushal Bhalaik Sep 17 '17 at 07:43
  • But still as I can see from screenshot your files are not opened with it, so you probably have something messed up with settings. Check general->editors->file associations in window->settings. – Mateusz Marchel Sep 17 '17 at 07:49

3 Answers3

2

I was also looking for a solution to this. Can't find anything on the web. So I keep looking on eclipse editor and found this.

  1. Window -> Preferences
  2. On the left side Preferences window click General -> Editors -> File Associations
  3. on the right side click Add... Enter *.feature on the textbox then click OK
  4. Select the newly added *.feature on the list
  5. Under Associated editors click Add... then choose the Editor with the green cucumber icon. click okay
  6. Apply and Close
NineLDev
  • 21
  • 2
1

Please follow the following steps

-Right click on . feature file -> Open With -> Cucumber Editor

0

I found an answer :

When everything is installed right, and if feature file does not display the gherkin colors, We need to first create a sample cucumber.feature file in the same path.

Once this is created if it is auto-populated with sample gherkin code, then other feature file will also work or we can simply paste content of our feature file into cucumber.feature and then rename it.

Kushal Bhalaik
  • 3,349
  • 5
  • 23
  • 46