Pubudu
Pubudu

Reputation: 478

Create step definition option is not visible in IDEA for cucumber

I have defined a Gherkin steps for simple test case as follows. But I'm unable to see the option of "Create step definitions" when I mouse hover over a step.

Feature: This is a test feature Scenario: Access the web page Given: User is on google And: user types search term as test Then: page should load

Pom File:-

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0

<groupId>cucumberPOC</groupId>
<artifactId>cucumberTests</artifactId>
<version>1.0-SNAPSHOT</version>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>
<dependency>
    <groupId>org.seleniumhq.selenium</groupId>
    <artifactId>selenium-java</artifactId>
    <version>3.3.1</version>
</dependency>
<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-junit</artifactId>
    <version>1.2.5</version>
</dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.5</version>
    </dependency>
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>1.2.5</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/info.cukes/gherkin -->
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>gherkin</artifactId>
        <version>2.12.2</version>
    </dependency>
    <!-- https://mvnrepository.com/artifact/info.cukes/cucumber-java -->
    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java8</artifactId>
        <version>1.2.5</version>
        <scope>test</scope>
    </dependency>

</dependencies>

Upvotes: 0

Views: 2109

Answers (2)

Pubudu
Pubudu

Reputation: 478

Issue got fixed after I installed 'Cucumber plugin for java' in Intellij IDEA.

Upvotes: 2

Thomas Sundberg
Thomas Sundberg

Reputation: 4323

Can you get this to work with a smaller example? there is probably something broken with your project setup.

I would clone the getting started project supplied by the Cucumber team: https://github.com/cucumber/cucumber-java-skeleton

Build it using Maven to make sure it works. Open it using IntelliJ IDEA and see if the error you see still is present. I would expect it to be gone.

With a working example, extend it step by step to the thing you really want to do. It is a lot easier to extend something that works than to fix something that is broken.

Upvotes: 0

Related Questions