黄瓜 .feature 在 intellij 中不起作用

Cucumber .feature not working in intellij

我正在尝试开始使用黄瓜,但我似乎无法弄清楚为什么无法识别 *.feature 文件。

这就是我到目前为止所做的:

Pom 文件:

    <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>groupId</groupId>
    <artifactId>untitled1</artifactId>
    <version>1.0-SNAPSHOT</version>


<dependencies>
    <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-junit -->
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.8.0</version>
        <scope>test</scope>
    </dependency>

    <!-- https://mvnrepository.com/artifact/com.jayway.restassured/rest-assured -->
    <dependency>
        <groupId>com.jayway.restassured</groupId>
        <artifactId>rest-assured</artifactId>
        <version>2.9.0</version>
        <scope>test</scope>
    </dependency>


</dependencies>

</project>

然后我在test\java下制作了一个名为features的包,在这个包中当我制作*.feature文件时,它会出现一个“?”在它旁边,它没有打开,这应该是一个黄瓜文件,对吧?

我编译了整个东西,没有错误

您使用的是最新版本的 Cucumber(thnx!),有时 IDE 插件需要一段时间才能赶上: 1. 尝试升级您的 IDE 和插件。 2. 在 YouTrack 中搜索与 Cucumber 插件相关的已知问题(请为它们点赞!),如果尚不存在,请创建一个。 3. 降级到适用于您的 IDE.

的稍旧版本的 Cucumber