Cucumber feature file does not identify the steps

Ash picture Ash · Feb 22, 2016 · Viewed 41.9k times · Source

I have written my firsy cucumber feature file. When I run the feature file as Cucumber Feature, I get below errors

  1. "WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead." - I used "plugin" in my @CucumberOptions of runner class, but still getting the same error

2.It says I do not have any scenario and steps Feature: Validate Modular GUI pages

Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 Given: Modular GUI is opened When: Validate the login page Then: Login to the Modular

0 Scenarios 0 Steps

  1. I'm not getting snippets for my steps.

I have added following jars to the library Jars

This is my runner class, package GUI;

import org.junit.runner.RunWith;

import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;

@RunWith(Cucumber.class)
@CucumberOptions(
        format = {"pretty", "json:target/"},
        features = {"src/GUI/"}
        )
public class GUIRunner {

}

This is my feature file,

Feature: Validate Modular GUI pages

  Scenario: Validate Login Page
    Given: Modular GUI is opened
    When: Validate the login page
    Then: Login to the Modular

I would really appreciate if someone can point out what is missing in my code.

Thank you very much

[EDITED] This is the actual error:

WARNING: Cucumber-JVM's --format option is deprecated. Please use --plugin instead. Feature: Validate Modular GUI pages

Scenario: Validate Login Page # C:/Selenium/RegressionTest/ModularRegression/src/GUI/features/Validate.feature:3 Given: Modular GUI is opened When: Validate the login page Then: Login to the Modular

0 Scenarios 0 Steps 0m0.000s

Answer

Ash picture Ash · Feb 23, 2016

I had an extra ":" in my feature file after Given, When and Then.

It's working now.